:root {
  color-scheme: light;
  --bg: #f7f6fc;
  --ink: #211935;
  --muted: #5f5770;
  --line: #eae5f2;
  --paper: #fff;
  --accent: #5638a9;
  --light: #f0e9ff;
  --sage: #eee8fb;
  --violet: #e9e0ff;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #8963ec; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-weight: 770; letter-spacing: -.065em; line-height: 1.04; overflow-wrap: anywhere; }
h1 { font-size: clamp(37px, 6vw, 60px); }
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -.035em; }
h3 { font-size: 15px; }
small { font-size: 12px; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon { display: inline-block; width: 21px; height: 21px; flex: none; vertical-align: middle; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1140px; margin: auto; padding: 10px 20px; gap: 12px; }
.brand { display: inline-flex; align-items: center; font-size: 26px; font-weight: 750; letter-spacing: -.075em; }
.brand > span:last-child { color: #739470; }
.brand-mark { margin-right: 8px; width: 37px; height: 37px; border-radius: 12px; color: var(--light); background: var(--accent); }
.locale, .square, .streak, .segments button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 11px; background: var(--paper); color: var(--accent); font-size: 13px; font-weight: 730; }
.locale .icon, .square .icon, .streak .icon { width: 17px; height: 17px; }
.square { min-width: 44px; padding: 0; }
.locale:hover, .square:hover, .streak:hover, .outline:hover { background: var(--sage); }
.nav { display: flex; gap: 4px; }
.nav a { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 680; min-height: 44px; padding: 7px 14px; border-radius: 12px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--sage); color: var(--accent); }
.nav .icon { width: 18px; height: 18px; }
main { max-width: 1140px; margin: auto; padding: 24px 20px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 0 0 17px; }
.page-head p { color: var(--muted); margin-top: 7px; }
.kicker { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 740; color: var(--muted); margin-bottom: 6px; }
.streak { background: #f1efde; border-color: #e8e4ce; white-space: nowrap; }
.streak .icon { color: #786624; }
.solid, .outline, .text-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 12px; font-size: 13px; line-height: 1.25; font-weight: 730; text-align: center; }
.solid { color: white; background: var(--accent); }
.solid:hover:not(:disabled) { background: #47288f; }
.outline, .text-button { color: var(--accent); background: var(--paper); border-color: var(--line); }
.text-button { justify-content: flex-start; padding-left: 0; border: 0; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.solid .icon, .outline .icon, .text-button .icon { width: 16px; height: 16px; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, 1fr); gap: 15px; margin-top: 15px; }
.stack, .inner-page { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.inner-page { max-width: 790px; margin-inline: auto; }
.inner-page > .page-head { margin-bottom: 0; align-items: center; }
.page-head > .solid { flex: none; }
.card { padding: 19px; border-radius: 19px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.heading { display: flex; align-items: center; gap: 11px; }
.heading p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.heading > .square { margin-left: auto; flex: none; }
.tile { display: inline-flex; align-items: center; justify-content: center; width: 41px; height: 41px; background: var(--sage); color: var(--accent); border-radius: 13px; flex: none; }
.peach { color: #81573c; background: #f7ebde; }
.violet { color: #5e507d; background: var(--violet); }
.mood-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.mood { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 68px; border: 1px solid #ebefe6; background: #f6f8f3; border-radius: 11px; font-size: 11px; padding: 5px 2px; overflow-wrap: anywhere; }
.mood .icon { width: 26px; height: 26px; color: #526e5b; }
.mood:hover, .mood[aria-pressed="true"] { background: #e5efde; border-color: #9c82dd; }
.mood[aria-pressed="true"] { font-weight: 740; }
.habit-list { margin-top: 8px; }
.habit-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.habit-row:first-child { border-top: 0; }
.habit-toggle { width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 55px; border: 0; background: transparent; text-align: start; padding: 6px 0; font-size: 14px; font-weight: 650; }
.habit-toggle .tile { width: 35px; height: 35px; border-radius: 10px; }
.habit-toggle .icon { width: 17px; height: 17px; }
.habit-name { overflow-wrap: anywhere; }
.tick { margin-left: auto; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; color: transparent; border: 1px solid #d3c8e4; }
.habit-toggle[aria-pressed="true"] .tick { background: var(--accent); color: white; border-color: var(--accent); }
.manage { display: flex; gap: 4px; }
.manage .square { border-color: transparent; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 13px; }
.day { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.day .day-box { width: 100%; height: 31px; border-radius: 8px; display: grid; place-items: center; background: #f2f4ee; }
.day .icon { height: 17px; width: 17px; }
.day .marked { background: var(--sage); color: var(--accent); }
.day[aria-current="date"] .day-box { box-shadow: inset 0 0 0 1px #9c82dd; }
.reset-link { display: flex; align-items: center; gap: 11px; border: 1px solid #e2daee; background: #f2eef8; border-radius: 18px; min-height: 72px; padding: 12px; }
.reset-link:hover { background: #ece5f4; }
.reset-link small { display: block; margin-top: 2px; color: #615973; }
.reset-link > :last-child { margin-left: auto; }


.chips, .segments { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { margin-top: 10px; }
.chip { color: var(--accent); background: var(--bg); border: 1px solid var(--line); padding: 7px 11px; min-height: 44px; border-radius: 999px; font-size: 13px; font-weight: 650; }
.chip[aria-pressed="true"], .segments button[aria-pressed="true"] { background: var(--sage); border-color: #a088dc; }
.challenge { background: #e8f1e3; }
.challenge progress { display: block; margin-top: 12px; width: 100%; height: 10px; accent-color: #7955ce; }
.challenge select { max-width: 100%; margin-top: 11px; }
.challenge-status { font-weight: 700; font-size: 13px; margin-top: 8px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.metric { min-width: 0; padding: 11px; border-radius: 13px; border: 1px solid var(--line); background: var(--paper); }
.metric b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 12px; }
.chart-segments { margin-top: 13px; }
.chart { height: 132px; display: grid; grid-template-columns: repeat(var(--count), minmax(0, 1fr)); gap: clamp(2px, 1vw, 8px); margin-top: 12px; }
.chart-col { display: grid; grid-template-rows: 1fr 17px; gap: 2px; justify-items: center; min-width: 0; }
.bar-track { height: 100%; width: 100%; display: flex; align-items: end; background: #f0f3ed; border-radius: 6px; overflow: hidden; }
.bar { width: 100%; height: var(--height); background: #7955ce; border-radius: 5px 5px 0 0; }
.chart-date, .chart-guide { font-size: 11px; color: var(--muted); }
.chart-guide { margin-top: 5px; }
.insight-body, .empty { margin-top: 10px; color: var(--muted); font-size: 14px; }
.history-entry { border-top: 1px solid var(--line); padding: 9px 0; margin-top: 2px; }
.history-entry:first-child { margin-top: 9px; }
.history-entry summary { cursor: pointer; min-height: 44px; padding-block: 11px; overflow-wrap: anywhere; }
.history-entry p { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.practice-grid { display: grid; gap: 9px; }
.practice-card { display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; align-items: center; gap: 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; min-height: 74px; padding: 10px 13px; text-align: start; }
.practice-card[aria-pressed="true"] { border-color: #8187a5; background: #f8f6fd; }
.practice-card b, .practice-card small { display: block; }
.practice-card small { margin-top: 2px; color: var(--muted); }
.practice-body, #practice-body { text-align: center; padding-top: 18px; }
.timer-orb { display: grid; place-items: center; width: 148px; height: 148px; border-radius: 50%; margin: 12px auto 22px; background: #e6efe0; color: #294a38; box-shadow: 0 0 0 8px #f0f5ed; transition: scale 3s ease-in-out; }
.timer-orb.inhale { scale: 1.09; }
.timer-orb output { font: 39px/1 Georgia, serif; font-variant-numeric: tabular-nums; }
#practice-phase { min-height: 26px; font-weight: 690; }
.practice-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 10px; }
.grounding-count { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.grounding-prompt { font-size: 22px; font-weight: 670; }
dialog { max-height: min(90dvh, 650px); width: min(440px, calc(100% - 24px)); padding: 17px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #14281ec0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
label, legend { display: block; font-size: 13px; font-weight: 680; }
input, select, textarea { width: 100%; padding: 7px 9px; min-height: 44px; margin: 4px 0 9px; border: 1px solid #dcd0ef; border-radius: 9px; background: #faf8fe; }
textarea { resize: vertical; }
fieldset { margin: 0 0 10px; border: 0; padding: 0; }
fieldset .chips { margin-top: 4px; }
.wide { width: 100%; }
.muted { color: var(--muted); margin: 2px 0 10px; font-size: 13px; }
.toast { position: fixed; z-index: 5; inset: auto 12px 14px; pointer-events: none; text-align: center; }
.toast:not(:empty) { width: fit-content; margin-inline: auto; max-width: calc(100% - 24px); padding: 8px 12px; border-radius: 12px; background: var(--accent); color: white; font-size: 13px; box-shadow: 0 2px 12px #14281e20; }
@media (max-width: 670px) {
  .top-inner { padding: 7px 13px; }
  main { padding: 15px 12px calc(80px + env(safe-area-inset-bottom)); }
  .nav { position: fixed; z-index: 3; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; background: var(--paper); border-top: 1px solid var(--line); padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
  .nav a { font-size: 11px; line-height: 1.1; flex-direction: column; text-align: center; gap: 3px; padding: 5px 1px; min-height: 51px; overflow-wrap: anywhere; }
  .nav .icon { width: 20px; height: 20px; }
  .page-head { margin-bottom: 13px; }
  .streak { font-size: 11px; padding-inline: 7px; }




  .dashboard { grid-template-columns: 1fr; margin-top: 10px; gap: 10px; }
  .stack, .inner-page { gap: 10px; }
  .card { padding: 12px; border-radius: 15px; }
  .page-head > .solid { max-width: 44%; }
  .mood-grid { gap: 4px; margin-top: 10px; }
  .heading p { font-size: 12px; }
  dialog { margin: auto 12px max(10px, env(safe-area-inset-bottom)); max-height: 90dvh; border-radius: 20px; }
  .toast { bottom: calc(67px + env(safe-area-inset-bottom)); }
}
@media (max-width: 365px) {
  #plan .page-head { display: grid; align-items: start; }
  #plan .page-head > .solid { width: fit-content; max-width: 100%; }
  .metric { padding-inline: 7px; }
  .streak span:last-child { white-space: normal; max-width: 80px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
.duration { justify-content: center; margin-bottom: 21px; }
.paused-heading { margin: 13px 0 4px; color: var(--muted); }
@media (min-width: 671px) { dialog { max-width: 440px; } }
body { background: radial-gradient(ellipse at 75% -30%, #ebdfff, transparent 55%), var(--bg); }
.brand { color: #241932; letter-spacing: -.075em; }
.brand-mark { background: #5638a9; color: #f7edff; }
.brand > span:last-child { color: #7e55d7; }
.top { background: #fbf9ff; }
.top-inner { max-width: 1110px; }
.locale { border-radius: 999px; }
.locale .icon { width: 19px; height: 19px; }
main { max-width: 1110px; padding-top: 32px; }
.page-head { align-items: center; margin-bottom: 18px; }
.kicker { color: #665985; font-size: 11px; font-weight: 800; }
.streak { background: #efe9ff; border-color: #e6d9fd; }
.streak .icon { color: #714bc6; }
.card { border-radius: 24px; box-shadow: 0 8px 25px #30195708; }
.dashboard { margin-top: 0; grid-template-columns: minmax(0, 1.55fr) minmax(275px, 1fr); gap: 16px; }
.check-in {
  position: relative;
  isolation: isolate;
  background: #241b37;
  border: 1px solid #3c2c55;
  color: #fff;
  padding: 20px;
  overflow: hidden;
  box-shadow: 0 12px 27px #3e255f24;
}
.check-in::before {
  position: absolute;
  content: "";
  z-index: -1;
  top: 0;
  right: 0;
  width: min(63%, 340px);
  height: 72%;
  background: url("ribbon.jpg") center 37% / 100% auto no-repeat;
  opacity: .78;
  mask-image: linear-gradient(to left, #000 58%, transparent 100%), linear-gradient(to top, transparent 0%, #000 47%);
  mask-composite: intersect;
}
.check-in-intro { position: relative; min-height: 101px; display: grid; justify-items: start; align-content: center; gap: 6px; }
.check-in-label { display: inline-flex; color: #e5cfff; align-items: center; gap: 6px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.check-in-label .icon { width: 14px; height: 14px; }
.check-in-intro h2 { font-size: clamp(26px, 4.35vw, 43px); line-height: 1.02; font-weight: 745; letter-spacing: -.06em; text-wrap: balance; max-width: 72%; }
.check-in-intro h2 { text-shadow: 0 1px 7px #241b37; }
.check-in .mood-grid { gap: 5px; margin-top: 11px; }
.check-in .mood {
  min-height: 67px;
  background: #3d2c57;
  color: #faf5ff;
  border: 1px solid #ffffff20;
  border-radius: 13px;
  line-height: 1.15;
  font-size: 11px;
  font-weight: 625;
}
.check-in .mood .icon { color: #dac8fa; width: 27px; height: 27px; }
.check-in .mood[data-mood="rough"] .icon { color: #e5b8cf; }
.check-in .mood[data-mood="great"] .icon { color: #cceacb; }
.check-in .mood:hover { background: #594475; }
.check-in .mood[aria-pressed="true"] { background: #eadbff; color: #2f2244; border-color: #c9b0f5; }
.check-in .mood[aria-pressed="true"] .icon { color: #5638a9; }
.check-in :focus-visible { outline-color: #eadbff; }
.check-in .text-button {
  width: 100%;
  margin-top: 8px;
  min-height: 42px;
  color: #eee3fa;
  padding: 4px 3px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.check-in .text-button > span:last-child { margin-left: auto; }
.routine .heading .square { border-color: transparent; background: #f6f0ff; }
.routine-ring {
  display: grid;
  place-items: center;
  flex: none;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: conic-gradient(#8057d7 var(--completion, 0%), #ede6fa 0);
}
.routine-ring > span { width: 33px; height: 33px; background: white; color: #6342b2; border-radius: 50%; }
.routine-ring .icon { width: 16px; height: 16px; }
.habit-toggle .tile { background: #f0eaff; }
.habit-toggle[data-habit="water"] .tile { background: #e5f3ff; color: #31648e; }
.habit-toggle[data-habit="move"] .tile, .habit-toggle[data-habit="outside"] .tile { background: #e1f1e7; color: #376851; }
.habit-toggle[data-habit="rest"] .tile { background: #eae5ff; color: #5d5295; }
.habit-toggle[data-habit="stretch"] .tile { background: #f9ebdc; color: #805331; }
.habit-toggle[aria-pressed="true"] .habit-name { color: #675d77; }
.day .day-box { background: #f5f0fa; }
.day .marked { background: #e8dcff; }
.reset-link {
  min-height: 83px;
  background: linear-gradient(110deg, #e5f5ed, #ecf7ec);
  border-color: #d8eade;
  color: #20382f;
  padding: 13px;
}
.reset-link:hover { background: #e0f0e7; }
.reset-link small { color: #425c50; }
.reset-link .tile { background: #d0e8dd; color: #285c48; }
.reset-link > :last-child .icon { width: 17px; height: 17px; }
.challenge { background: #f0e9fe; }
.practice-card[aria-pressed="true"] { border-color: #a58ad7; }
.timer-orb { color: #38205b; background: #e8ddfa; box-shadow: 0 0 0 8px #f0eafa; }
.timer-orb output { font-family: inherit; font-weight: 660; }
.green { background: #e8f5ed; color: #2d6149; }
.toast:not(:empty) { background: #32214e; }
dialog { border-radius: 25px; }
dialog::backdrop { background: #21163299; backdrop-filter: blur(5px); }
#settings #profile-open { margin-bottom: 7px; }

#setup { display: none; }
.onboarding main, .onboarding .nav { display: none; }
.onboarding .top { border-bottom: 0; background: transparent; }
.onboarding .top-inner { max-width: 525px; }
.onboarding #setup {
  display: block;
  max-width: 525px;
  margin: 0 auto;
  padding: 14px 20px calc(25px + env(safe-area-inset-bottom));
}
.setup h1 { font-size: clamp(36px, 7.5vw, 55px); }
.setup-description { color: var(--muted); font-size: 15px; margin: 10px 0 20px; }
.welcome-art {
  height: clamp(180px, 34svh, 327px);
  border: 1px solid #3b2b52;
  border-radius: 29px;
  overflow: hidden;
  background: #241b37;
  position: relative;
  margin-bottom: 24px;
}
.welcome-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("ribbon.jpg") center 48% / contain no-repeat;
}
.welcome-art span { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 43%, #241b37 88%); }
.welcome-content { padding-inline: 1px; }
.setup-actions { display: grid; gap: 8px; }
.setup .solid, .setup .outline { min-height: 52px; border-radius: 15px; font-size: 14px; }
.setup .solid .icon, .setup .outline .icon { width: 18px; height: 18px; }
.setup-privacy { color: var(--muted); font-size: 12px; text-align: center; margin: 13px 0 0; }
.setup-privacy .icon { width: 12px; height: 12px; margin-right: 4px; }
.setup-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; row-gap: 5px; margin-bottom: 20px; }
.setup-header .text-button { background: transparent; }
.setup-header span { font-size: 12px; color: var(--muted); font-weight: 710; }
.setup-header progress { display: block; width: 100%; height: 7px; accent-color: #7752c9; }
.setup-fields { display: grid; gap: 9px; }
.setup input:not([type="radio"], [type="checkbox"]), .setup select {
  background: white;
  border-radius: 13px;
  min-height: 51px;
  margin-block: 5px;
  padding: 8px 12px;
}
.setup-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.setup-next {
  position: sticky;
  bottom: 0;
  padding: 15px 0 calc(9px + env(safe-area-inset-bottom));
  margin-top: 10px;
  background: linear-gradient(transparent, var(--bg) 22%);
}
.setup-choice, .setup-pill { position: relative; cursor: pointer; }
.setup-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 57px;
  padding: 8px 12px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
}
.setup-choice:has(input:checked), .setup-pill:has(input:checked) {
  background: #eee3ff;
  border-color: #a98add;
  color: #402184;
}
.setup-choice:has(input:focus-visible), .setup-pill:has(input:focus-visible) { outline: 2px solid #8963ec; outline-offset: 2px; }
.setup-choice input, .setup-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  margin: 0;
}
.setup-choice-icon, .setup-choice-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #f3ecfe;
  color: var(--accent);
}
.setup-choice-mark { width: 24px; height: 24px; background: transparent; border: 1px solid #cdbddd; color: transparent; }
.setup-choice-mark .icon { width: 16px; height: 16px; }
.setup-choice:has(input:checked) .setup-choice-mark { background: var(--accent); color: white; border-color: var(--accent); }
.setup-choice-text { font-size: 15px; overflow-wrap: anywhere; }
.setup-question { min-width: 0; margin: 0 0 5px; }
.setup-question legend { padding: 0; font-size: 15px; }
.setup-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.setup-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

@media (max-width: 670px) {
  .top-inner { min-height: 55px; padding: max(7px, env(safe-area-inset-top)) 15px 5px; }
  input, select, textarea { font-size: 16px; }
  .brand { font-size: 24px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  main { padding: 17px 14px calc(91px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 13px; }
  .dashboard { grid-template-columns: 1fr; gap: 11px; }
  .stack, .inner-page { gap: 11px; }
  .card { border-radius: 20px; padding: 14px; }
  .check-in { padding: 15px 13px 7px; }
  .check-in-intro { min-height: 105px; }
  .check-in::before { width: 65%; height: 77%; background-position: center 23%; }
  .check-in-intro h2 { max-width: 71%; }
  .nav {
    inset: auto max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    padding: 4px;
    border: 1px solid #e7dff1;
    border-radius: 20px;
    box-shadow: 0 8px 26px #28133f25;
    background: #fffffff5;
    backdrop-filter: blur(15px);
  }
  .nav a { min-height: 52px; border-radius: 15px; color: #564965; }
  .nav a[aria-current="page"] { color: #4b2d99; background: #eee4ff; }
  .nav .icon { width: 19px; height: 19px; }
  .onboarding #setup { padding-top: 12px; }
}
@media (max-width: 365px) {
  .check-in-intro { min-height: 97px; }
  .check-in .mood { font-size: 10px; }
  .check-in .mood .icon { width: 23px; height: 23px; }
  .onboarding #setup { padding-inline: 14px; }
  .setup-description { margin-bottom: 14px; }
}

.app-select, .choice-option {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: start;
}
.app-select small, .app-select b, .starter-practice small { display: block; }
.app-select small { color: var(--muted); font-weight: 600; }
.app-select > :last-child, .choice-mark { margin-inline-start: auto; color: var(--accent); }
.app-select:hover, .choice-option:hover { background: var(--sage); }
.choice-options { display: grid; gap: 6px; }
.choice-option { font-weight: 650; }
.choice-option[aria-pressed="true"] { border-color: #a98add; background: var(--sage); }
.choice-mark { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: transparent; flex: none; }
.choice-option[aria-pressed="true"] .choice-mark { color: white; background: var(--accent); }
.choice-mark .icon { width: 15px; height: 15px; }
.locale-flag { display: grid; place-items: center; flex: none; width: 37px; height: 34px; border-radius: 9px; background: var(--sage); font-size: 20px; }
.choice-sheet { padding: 14px; }
#settings .wide, #settings-privacy, .theme-field { margin-top: 7px; }
.theme-field { padding: 0; margin-inline: 0; border: 0; }
.theme-options { display: flex; gap: 7px; margin-top: 4px; }
.theme-options button { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); }
.theme-options button[aria-pressed="true"] { background: var(--sage); border-color: #a98add; }
.theme-options .icon { width: 17px; height: 17px; }
#challenge-form { display: grid; gap: 8px; margin-top: 11px; }
#challenge-form .solid { justify-self: start; }
.energy-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 5px; }
.energy-option { position: relative; min-width: 0; cursor: pointer; }
.energy-option input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; }
.energy-option span { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); }
.energy-option:has(input:checked) span { border-color: #a98add; background: var(--sage); color: var(--ink); }
.energy-option:has(input:focus-visible) { outline: 2px solid #8963ec; outline-offset: 2px; border-radius: 12px; }
.energy-skip { grid-column: span 5; }
.energy-skip span { justify-items: start; padding-inline: 11px; width: fit-content; color: var(--muted); }
.history-entry { border: 1px solid var(--line); border-radius: 13px; margin-top: 6px; padding: 12px; }
details.history-entry { padding: 0; }
.history-entry summary { display: flex; list-style: none; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 13px; }
.history-entry summary::-webkit-details-marker { display: none; }
.history-entry summary .icon { width: 16px; height: 16px; color: var(--accent); }
.history-entry[open] summary .icon { rotate: 90deg; }
.history-content { padding: 0 12px 10px; }
.history-content p + p { margin-top: 5px; }

.setup-header progress, .plan-preparing progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; color: #7b53cf; background: var(--sage); }
.setup-header progress::-webkit-progress-bar, .plan-preparing progress::-webkit-progress-bar { background: var(--sage); }
.setup-header progress::-webkit-progress-value, .plan-preparing progress::-webkit-progress-value { background: linear-gradient(90deg,#6742be,#ae86ed); border-radius: 999px; transition: width .25s ease; }
.setup-header progress::-moz-progress-bar, .plan-preparing progress::-moz-progress-bar { background: #8d63dc; border-radius: 999px; }
.setup-form { animation: setup-arrive .22s ease-out; }
@keyframes setup-arrive { from { opacity: .7; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.setup h1 { letter-spacing: -.05em; line-height: 1.09; text-wrap: balance; }
.profile-art { position: relative; overflow: hidden; min-height: 148px; border-radius: 23px; margin-bottom: 18px; background: #ebe1fa; }
.profile-art::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 174px;
  height: 174px;
  transform: translate(-50%, -50%);
  background: url("onboarding.jpg") var(--art-x, 0%) var(--art-y, 0%) / 200% 200%;
  mask-image: radial-gradient(ellipse 52% 52% at center, black 63%, transparent 100%);
}
.art-age { background: #efe8f7; --art-x: 100%; }
.art-gender { background: #eee7f8; --art-y: 100%; }
.art-weight { background: #efe8f7; --art-x: 100%; --art-y: 100%; }
.profile-options { display: grid; gap: 6px; }
.step-name .field-title, .step-age .field-title, .step-weight .field-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.plain-choice { grid-template-columns: minmax(0,1fr) auto; }
.weight-field { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; }
.unit-options { display: flex; gap: 5px; margin-bottom: 6px; }
.unit-options .setup-pill { min-width: 44px; justify-content: center; }
.profile-edit .app-select { margin-bottom: 8px; }
.profile-edit .solid { margin-top: 8px; }
.setup-choice-text small { margin-top: 3px; display: block; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.setup-question { margin: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 15px; padding: 5px 10px 10px; }
.setup-question legend { padding-inline: 5px; }
.answer-feedback { margin-top: 8px; border-left: 2px solid #a485db; padding-left: 8px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.own-goal { margin-top: 5px; padding: 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--paper); }
.own-goal p { color: var(--muted); font-size: 12px; }
.own-goal p + label { margin-top: 10px; }
.starter-practice, .plan-intention { display: flex; align-items: start; gap: 10px; }
.starter-practice { padding: 11px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.starter-practice small, .plan-intention p { color: var(--muted); overflow-wrap: anywhere; }
.plan-intention p { margin-top: 5px; white-space: pre-wrap; }
.plan-preparing h1 { margin-bottom: 13px; }
.plan-preparing ul { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; color: var(--muted); }
.plan-preparing li { display: flex; align-items: center; gap: 8px; }
.plan-preparing li.complete { color: var(--ink); font-weight: 650; }
.intake-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; border-top: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.intake-row small, .intake-row p { display: block; color: var(--muted); }
.intake-row p { font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.intake-type { padding: 0; border: 0; }
.trend-summary { margin-top: 8px; border-radius: 10px; background: var(--sage); padding: 8px; color: var(--ink); font-size: 13px; }
.touch-ring { display: grid; place-items: center; width: 158px; height: 158px; margin: 5px auto 15px; border-radius: 50%; background: conic-gradient(#9a6cea var(--touch-progress, 0%), var(--sage) 0); }
#touch-hold { border: 1px solid var(--line); background: var(--paper); color: var(--ink); width: 138px; height: 138px; border-radius: 50%; display: grid; justify-items: center; align-content: center; gap: 8px; touch-action: none; user-select: none; -webkit-touch-callout: none; }
#touch-hold .icon { width: 33px; height: 33px; color: var(--accent); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151120;
  --ink: #f6efff;
  --muted: #c2b6d5;
  --line: #3a2d4b;
  --paper: #21192e;
  --accent: #9e7ee9;
  --light: #e5d4ff;
  --sage: #342545;
  --violet: #392953;
}
[data-theme="dark"] body { background: radial-gradient(ellipse at 80% -20%, #312141, transparent 60%), var(--bg); }
[data-theme="dark"] .top { background: #1d162a; }
[data-theme="dark"] .onboarding .top { background: transparent; }
[data-theme="dark"] .brand { color: #f6efff; }
[data-theme="dark"] .brand-mark, [data-theme="dark"] .solid { background: #7653ca; color: white; }
[data-theme="dark"] .solid:hover:not(:disabled) { background: #815dda; }
[data-theme="dark"] .nav a, [data-theme="dark"] .eyebrow, [data-theme="dark"] .kicker { color: var(--muted); }
[data-theme="dark"] .nav a[aria-current="page"], [data-theme="dark"] .streak { color: var(--ink); background: var(--sage); border-color: var(--line); }
[data-theme="dark"] .streak .icon { color: var(--accent); }
[data-theme="dark"] .setup-choice, [data-theme="dark"] .setup-pill, [data-theme="dark"] .setup input:not([type="radio"], [type="checkbox"]),
[data-theme="dark"] input, [data-theme="dark"] textarea { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .setup-choice:has(input:checked), [data-theme="dark"] .setup-pill:has(input:checked), [data-theme="dark"] .practice-card[aria-pressed="true"] { background: var(--sage); color: var(--ink); border-color: #7d64a4; }
[data-theme="dark"] .setup-choice-icon, [data-theme="dark"] .routine-ring > span, [data-theme="dark"] .routine .square, [data-theme="dark"] .day .day-box,
[data-theme="dark"] .challenge, [data-theme="dark"] .bar-track, [data-theme="dark"] .timer-orb, [data-theme="dark"] .reset-link { background: var(--sage); color: var(--ink); }
[data-theme="dark"] .setup-choice-mark { border-color: #786292; }
[data-theme="dark"] .setup-choice:has(input:checked) .setup-choice-mark { background: #7758b0; }
[data-theme="dark"] .violet { color: #ddc9f8; }
[data-theme="dark"] .green, [data-theme="dark"] .reset-link .tile { background: #22483a; color: #d0e9db; }
[data-theme="dark"] .reset-link { border-color: var(--line); }
[data-theme="dark"] .reset-link small, [data-theme="dark"] .habit-toggle[aria-pressed="true"] .habit-name { color: var(--muted); }
[data-theme="dark"] .day .marked { background: #4c3569; }
[data-theme="dark"] .timer-orb { box-shadow: 0 0 0 8px #2c213b; }
[data-theme="dark"] .profile-art { background: #312141; }
[data-theme="dark"] .profile-art::before { opacity: .77; }
@media (max-width: 670px) {
  .choice-sheet { max-height: 83dvh; margin-bottom: max(7px, env(safe-area-inset-bottom)); }
  .setup-form h1 { font-size: clamp(34px, 8vw, 43px); }
  [data-theme="dark"] .nav { background: #21192ef5; border-color: var(--line); }
}
@media (prefers-reduced-motion: reduce) { .setup-form { animation: none; } }
