:root {
  color-scheme: light;
  --ink: #28302e;
  --muted: #69716d;
  --paper: #f6f1e8;
  --paper-deep: #eee5d6;
  --night: #202442;
  --night-soft: #34395d;
  --moss: #58735a;
  --moss-deep: #365343;
  --sage: #dfe8d9;
  --ember: #dc7d4e;
  --sun: #edb96b;
  --line: rgba(51, 63, 57, 0.13);
  --shadow: 0 18px 55px rgba(41, 44, 39, 0.13);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: ui-rounded, "Avenir Next", "Segoe UI Rounded", "Trebuchet MS", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
  min-height: 100%;
  background: #d9d4c9;
}

body {
  min-width: 320px;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.72), transparent 35%),
    linear-gradient(150deg, #e7e3da, #ccc8c0);
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell {
  position: relative;
  width: min(100%, 560px);
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: 0 18px calc(98px + var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background:
    linear-gradient(rgba(246, 241, 232, .96), rgba(246, 241, 232, .98)),
    repeating-linear-gradient(8deg, transparent 0 5px, rgba(58, 65, 55, .035) 6px 7px);
  box-shadow: 0 0 80px rgba(42, 42, 38, .16);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 82px;
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar h1, .world-copy h2, .date-row h2, .section-heading h2,
.page-intro h2, .day-complete-card h2, .dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.025em;
}

.topbar h1 { font-size: 1.2rem; }
.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  color: #f2d49b;
  background: var(--night);
  box-shadow: 0 7px 18px rgba(32,36,66,.18);
}
.brand-mark svg { width: 30px; fill: currentColor; }
.brand-mark svg path:last-child { fill: none; stroke: var(--night); stroke-width: 2.5; }

.sound-button {
  margin-left: auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--moss-deep);
  background: rgba(255,255,255,.5);
  font-size: .73rem;
  font-weight: 800;
}

.world-card {
  position: relative;
  padding: 17px 17px 13px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: #fffaf0;
  background: var(--night);
  box-shadow: 0 25px 55px rgba(34, 38, 65, .24);
  isolation: isolate;
}

.world-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  border: 1px solid rgba(255,255,255,.12);
  border-radius: inherit;
  pointer-events: none;
}

.world-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.world-copy .eyebrow { color: #b9bfd4; }
.world-copy h2 { font-size: clamp(1.35rem, 6vw, 1.8rem); }
.weather-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #d9dfeb;
  background: rgba(255,255,255,.07);
  font-size: .62rem;
  font-weight: 700;
}
.weather-pill svg { width: 13px; fill: none; stroke: #f2ca86; stroke-width: 1.8; }

.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1.58;
  overflow: hidden;
  border-radius: 20px;
  background: #30375d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.scene > svg { display: block; width: 100%; height: 100%; }
.stars { fill: #fff4d4; opacity: .72; animation: twinkle 4s ease-in-out infinite alternate; }
.trail, .trail-edge { fill: none; stroke: #d5b88c; stroke-width: 37; stroke-linecap: round; }
.trail-edge { stroke: #efd6a8; stroke-width: 12; opacity: .42; }
.pine { fill: #18393a; }.pine.small { opacity: .87; }
.scene-layer {
  opacity: 0;
  transform: translateY(12px) scale(.97);
  transform-origin: center bottom;
  transition: opacity .7s ease, transform .85s cubic-bezier(.2,.8,.2,1);
}
.scene-layer.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.hero { transform-origin: center bottom; animation: breathe 4.2s ease-in-out infinite; }
.flame { transform-origin: 360px 389px; animation: flicker 1.6s ease-in-out infinite alternate; }
.flame-core { transform-origin: 360px 389px; animation: flicker 1.1s ease-in-out infinite alternate-reverse; }
.lights-layer.is-visible circle { animation: twinkle 1.8s ease-in-out infinite alternate; }
.fox-layer.is-visible { animation: fox-arrives 1s cubic-bezier(.2,.9,.2,1) both; }
.scene-shimmer {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255,244,204,.25) 48%, transparent 75%);
  transform: translateX(-120%);
  pointer-events: none;
}
.scene.is-rewarding .scene-shimmer { animation: shimmer 1.1s ease-out; }
.world-note { margin: 11px 3px 0; color: #cfd4df; font-size: .76rem; line-height: 1.45; }

.view { animation: view-in .35s ease both; }
.view[hidden] { display: none; }
.date-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 27px 3px 14px;
}
.date-row h2 { font-size: 1.7rem; }
.phase-badge {
  max-width: 43%;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--moss-deep);
  background: var(--sage);
  font-size: .65rem;
  font-weight: 800;
  text-align: center;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 18px;
}
.week-day {
  display: grid;
  min-width: 0;
  min-height: 54px;
  place-items: center;
  padding: 6px 2px;
  border: 0;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
}
.week-day span:first-child { font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.week-day strong { font-family: Georgia, serif; font-size: 1rem; }
.week-day.is-today { color: #fff; background: var(--moss-deep); box-shadow: 0 8px 17px rgba(54,83,67,.2); }
.week-day.has-memory:not(.is-today) { color: var(--moss-deep); background: rgba(223,232,217,.75); }
.week-day.has-memory::after { width: 4px; height: 4px; border-radius: 50%; background: currentColor; content: ""; }

.today-panel {
  padding: 19px 15px 8px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.48);
  box-shadow: 0 14px 40px rgba(60,57,49,.08);
  transition: opacity .25s ease, transform .3s ease;
}
.today-panel.is-soft-hidden { display: none; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; margin: 0 3px 12px; }
.section-heading h2 { font-size: 1.45rem; }
.leaf-sketch { width: 59px; fill: none; stroke: #8fa285; stroke-width: 2; stroke-linecap: round; }
.task-list { display: grid; gap: 9px; }
.prestart-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 83px;
  padding: 14px;
  border: 1px dashed rgba(88,115,90,.3);
  border-radius: 18px;
  color: var(--moss-deep);
  background: rgba(223,232,217,.46);
}
.prestart-card > span { font-size: 1.5rem; }
.prestart-card h3 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 1rem; }
.prestart-card p { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.4; }
.task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 10px 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(252,250,246,.84);
  transition: border-color .2s, background .2s, transform .2s;
}
.task-card:active { transform: scale(.988); }
.task-card.is-done { border-color: rgba(88,115,90,.22); background: rgba(223,232,217,.64); }
.task-check { position: relative; display: grid; width: 44px; height: 44px; place-items: center; cursor: pointer; }
.task-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-visual {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 2px solid #a8ada7;
  border-radius: 11px;
  background: #fff;
  transition: .22s ease;
}
.check-visual svg { width: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: .2s; }
.task-check input:focus-visible + .check-visual { outline: 3px solid rgba(220,125,78,.28); outline-offset: 3px; }
.task-check input:checked + .check-visual { border-color: var(--moss); background: var(--moss); transform: rotate(-4deg) scale(1.04); }
.task-check input:checked + .check-visual svg { opacity: 1; transform: scale(1); }
.task-copy { min-width: 0; }
.task-copy h3 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 1rem; font-weight: 600; line-height: 1.16; }
.task-copy p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.task-card.is-done .task-copy h3 { color: #657165; text-decoration: line-through; text-decoration-color: rgba(88,115,90,.35); }
.task-detail-button {
  align-self: stretch;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  color: var(--moss-deep);
  background: transparent;
  font-size: .68rem;
  font-weight: 900;
}
.task-detail-button:hover { background: rgba(88,115,90,.08); }
.task-type-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 13px;
  color: var(--moss-deep);
  background: rgba(223,232,217,.7);
}
.task-type-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task-type-pool { color: #3e6472; background: #dce8e8; }
.task-type-mobility { color: #8a553d; background: #f2dfce; }

.day-complete-card {
  position: relative;
  padding: 31px 24px 24px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  text-align: center;
  background: linear-gradient(145deg, #e8eadb, #f7e5cc);
  box-shadow: var(--shadow);
  animation: completion-in .6s cubic-bezier(.2,.9,.2,1) both;
}
.day-complete-card::before { position: absolute; top: -65px; right: -45px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.3); content: ""; }
.complete-spark { display: grid; width: 48px; height: 48px; margin: 0 auto 12px; place-items: center; border-radius: 50%; color: #fff6da; background: var(--ember); box-shadow: 0 7px 0 rgba(126,71,46,.12); }
.day-complete-card h2 { font-size: 1.75rem; }
.day-complete-card > p:not(.eyebrow) { max-width: 320px; margin: 10px auto 18px; color: #626b63; font-size: .86rem; line-height: 1.5; }
.text-button { padding: 9px 13px; border: 0; border-bottom: 1px solid currentColor; color: var(--moss-deep); background: transparent; font-size: .75rem; font-weight: 800; }

.page-intro { padding: 30px 5px 19px; }
.page-intro h2 { margin-bottom: 9px; font-size: 1.85rem; }
.page-intro > p:last-child { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.workout-cards { display: grid; gap: 11px; }
.workout-card {
  position: relative;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.55);
}
.workout-card::after { position: absolute; right: -16px; bottom: -32px; width: 105px; height: 105px; border: 18px solid rgba(88,115,90,.08); border-radius: 50%; content: ""; }
.workout-letter { display: grid; width: 38px; height: 38px; margin-bottom: 13px; place-items: center; border-radius: 13px; color: #fff; background: var(--moss); font-family: Georgia, serif; font-size: 1.1rem; }
.workout-card:nth-child(2) .workout-letter { background: var(--ember); }
.workout-card:nth-child(3) .workout-letter { background: var(--night-soft); }
.workout-card h3 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 1.15rem; }
.workout-card p { margin: 0 0 13px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.workout-card button { position: relative; z-index: 1; padding: 8px 11px; border: 0; border-radius: 11px; color: var(--moss-deep); background: var(--sage); font-size: .7rem; font-weight: 900; }

.safety-note, .journey-rule {
  display: flex;
  gap: 13px;
  margin-top: 16px;
  padding: 17px;
  border-radius: 20px;
  color: #5f5047;
  background: #f3dfce;
}
.safety-icon { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-weight: 700; }
.safety-note h3, .journey-rule h3 { margin: 2px 0 5px; font-family: Georgia, serif; font-size: 1rem; }
.safety-note p, .journey-rule p { margin: 0; font-size: .75rem; line-height: 1.5; }
.safety-note details { margin-top: 10px; font-size: .72rem; }
.safety-note summary { cursor: pointer; font-weight: 800; }
.safety-note details p { margin-top: 7px; }

.found-items { display: flex; flex-wrap: wrap; gap: 8px; }
.found-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.62); font-size: .76rem; font-weight: 800; animation: item-in .4s ease both; }
.found-item span { font-size: 1.08rem; }
.journey-rule { margin-top: 20px; color: #e9ecdf; background: var(--moss-deep); }
.journey-rule > span { font-size: 1.5rem; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 560px);
  min-height: calc(72px + var(--safe-bottom));
  margin: auto;
  padding: 8px 20px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(61,67,62,.11);
  background: rgba(249,246,239,.9);
  box-shadow: 0 -15px 40px rgba(43,47,43,.08);
  backdrop-filter: blur(18px);
}
.nav-button { display: grid; gap: 3px; place-items: center; border: 0; border-radius: 16px; color: #8a8f8a; background: transparent; font-size: .66rem; font-weight: 800; }
.nav-button svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-button.is-active { color: var(--moss-deep); background: rgba(223,232,217,.66); }

.workout-dialog {
  width: min(100%, 560px);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0 auto;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}
.workout-dialog::backdrop { background: rgba(22,27,34,.56); backdrop-filter: blur(4px); }
.dialog-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 94%;
  padding: 23px 18px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 30px 30px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 80px rgba(20,23,27,.3);
  animation: sheet-in .38s cubic-bezier(.2,.85,.2,1) both;
}
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dialog-header h2 { font-size: 1.8rem; }
.close-button { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 14px; color: var(--muted); background: var(--paper-deep); font-size: 1.6rem; line-height: 1; }
.dialog-intro { margin: 8px 0 14px; color: var(--muted); font-size: .82rem; }
.warmup-note { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 11px 13px; border-radius: 15px; color: #5c574c; background: #efe3c9; font-size: .72rem; line-height: 1.4; }
.warmup-note span { font-size: 1.15rem; }
.exercise-list { display: grid; gap: 10px; }
.exercise-card { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.63); }
.exercise-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.exercise-heading h3 { margin: 0 0 3px; font-family: Georgia, serif; font-size: .95rem; line-height: 1.25; }
.exercise-heading p { margin: 0; color: var(--muted); font-size: .67rem; }
.exercise-count { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: var(--moss-deep); background: var(--sage); font-size: .61rem; font-weight: 900; }
.set-list { display: flex; gap: 8px; }
.set-check { position: relative; flex: 1; cursor: pointer; }
.set-check input { position: absolute; opacity: 0; }
.set-check span { display: grid; min-height: 38px; place-items: center; border: 1px solid #c9cac2; border-radius: 12px; color: var(--muted); background: #fff; font-size: .68rem; font-weight: 900; transition: .2s; }
.set-check input:checked + span { border-color: var(--moss); color: #fff; background: var(--moss); }
.set-check input:focus-visible + span { outline: 3px solid rgba(220,125,78,.28); outline-offset: 2px; }
.workout-finish-note { margin: 16px 4px 12px; color: var(--muted); font-size: .72rem; line-height: 1.45; text-align: center; }
.primary-button { width: 100%; min-height: 51px; border: 0; border-radius: 16px; color: #fff; background: var(--moss-deep); font-weight: 900; box-shadow: 0 10px 25px rgba(54,83,67,.23); }

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: calc(88px + var(--safe-bottom));
  left: 20px;
  width: fit-content;
  max-width: min(420px, calc(100% - 40px));
  margin: auto;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: #292e3f;
  box-shadow: 0 12px 32px rgba(28,31,38,.26);
  font-size: .75rem;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .25s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes completion-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes item-in { from { opacity: 0; transform: scale(.9); } }
@keyframes breathe { 50% { transform: translateY(-3px); } }
@keyframes flicker { to { transform: scale(.91, 1.08) rotate(2deg); } }
@keyframes twinkle { to { opacity: .35; } }
@keyframes shimmer { 0% { opacity: 0; transform: translateX(-120%); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateX(120%); } }
@keyframes fox-arrives { from { opacity: 0; transform: translate(40px, 8px) scale(.8); } }

@media (min-width: 561px) {
  body { padding: 24px 0; }
  .app-shell { height: calc(100dvh - 48px); border-radius: 34px; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 34px 34px; }
  .workout-dialog { height: calc(100% - 48px); margin: 24px auto; }
  .dialog-sheet { border-radius: 30px; }
}

@media (max-width: 380px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .world-card { padding: 14px 14px 12px; border-radius: 25px; }
  .weather-pill { padding: 7px; }
  .weather-pill { font-size: 0; }
  .weather-pill svg { width: 16px; }
  .task-card { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
