/* Layout: one phone-width column (max 30rem) scrolling beneath a frosted tab bar.
   A single living orb is the hero on every surface; everything around it stays quiet.
   Dark-first ("night pond"), with a "morning mist" light theme. */
:root {
  --bg: #0e1615;
  --surface: #15201f;
  --surface-2: #1c2a28;
  --line: rgba(214, 236, 226, 0.1);
  --fg: #e7efea;
  --muted: #93a69e;
  --faint: #5e706a;
  --accent: #ebbc70;
  --accent-fg: #1d1405;
  --jade: #3f9a84;
  --lake: #2d5878;
  --ember: #ebbc70;
  --heat-0: #1a2725;
  --scrim: rgba(6, 10, 9, 0.62);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);

  --font-display:
    "Cormorant Garamond", "Cormorant", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-xs: 0.72rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.375rem;
  --t-xl: 2.75rem;
  --t-2xl: 4.25rem;

  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --tab-h: 64px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ecf0eb;
    --surface: #f7f9f5;
    --surface-2: #e1e8e2;
    --line: rgba(27, 41, 37, 0.11);
    --fg: #1b2925;
    --muted: #566761;
    --faint: #8d9b95;
    --accent: #98590f;
    --accent-fg: #fff8ee;
    --jade: #74b4a1;
    --lake: #8fb1cc;
    --ember: #edb867;
    --heat-0: #dce4de;
    --scrim: rgba(20, 32, 29, 0.32);
    --shadow: 0 24px 60px -28px rgba(30, 50, 44, 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ecf0eb;
  --surface: #f7f9f5;
  --surface-2: #e1e8e2;
  --line: rgba(27, 41, 37, 0.11);
  --fg: #1b2925;
  --muted: #566761;
  --faint: #8d9b95;
  --accent: #98590f;
  --accent-fg: #fff8ee;
  --jade: #74b4a1;
  --lake: #8fb1cc;
  --ember: #edb867;
  --heat-0: #dce4de;
  --scrim: rgba(20, 32, 29, 0.32);
  --shadow: 0 24px 60px -28px rgba(30, 50, 44, 0.35);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1615;
  --surface: #15201f;
  --surface-2: #1c2a28;
  --line: rgba(214, 236, 226, 0.1);
  --fg: #e7efea;
  --muted: #93a69e;
  --faint: #5e706a;
  --accent: #ebbc70;
  --accent-fg: #1d1405;
  --jade: #3f9a84;
  --lake: #2d5878;
  --ember: #ebbc70;
  --heat-0: #1a2725;
  --scrim: rgba(6, 10, 9, 0.62);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
html,
body {
  min-height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--t-md) / 1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition:
    background-color 0.4s var(--ease),
    color 0.4s var(--ease);
}
[hidden] {
  display: none !important;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
svg {
  display: block;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
}
h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
blockquote {
  margin: 0;
  padding: 0;
}
ol,
ul {
  list-style: none;
}

.atmos {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      60% 40% at 85% -5%,
      color-mix(in oklab, var(--lake) 32%, transparent),
      transparent 70%
    ),
    radial-gradient(
      55% 35% at 0% 8%,
      color-mix(in oklab, var(--jade) 18%, transparent),
      transparent 70%
    ),
    radial-gradient(
      70% 40% at 50% 110%,
      color-mix(in oklab, var(--ember) 9%, transparent),
      transparent 70%
    );
}

.app {
  max-width: 30rem;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 8px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.eyebrow {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: var(--t-sm);
}
.lede {
  color: var(--muted);
  max-width: 32ch;
  margin-top: 10px;
  text-wrap: pretty;
}
.link {
  font-size: var(--t-sm);
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.link:hover {
  color: var(--fg);
}

/* ---------- Views ---------- */
.view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.view.enter {
  animation: rise 0.6s var(--ease) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}
.page-head {
  padding-top: 22px;
}
.page-title {
  font-size: var(--t-xl);
  font-weight: 300;
}
.greeting {
  font-size: clamp(2.5rem, 11vw, 3.25rem);
  font-weight: 300;
  margin-top: -12px;
}
.greeting em {
  font-style: italic;
  color: var(--accent);
}

.block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 500;
  font-size: var(--t-md);
  letter-spacing: 0.01em;
  transition:
    transform 0.25s var(--ease),
    background-color 0.25s,
    box-shadow 0.25s;
}
.btn:active {
  transform: scale(0.975);
}
.btn-wide {
  width: 100%;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 14px 34px -14px color-mix(in oklab, var(--accent) 70%, transparent);
}
.btn-quiet {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  justify-content: space-between;
}
.btn-quiet:hover {
  background: var(--surface);
}
.btn-meta {
  color: var(--muted);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
.btn-danger {
  background: transparent;
  color: #d9826f;
  border: 1px solid color-mix(in oklab, #d9826f 40%, transparent);
  min-height: 46px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  transition:
    background-color 0.2s,
    transform 0.2s var(--ease);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn-lg {
  width: 56px;
  height: 56px;
}
.plus-label {
  font-variant-numeric: tabular-nums;
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Today ---------- */
.hero {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: -18px;
}
.hero-orb {
  width: min(86vw, 340px);
  aspect-ratio: 1;
  max-width: 100%;
}
.intention {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--t-lg);
  line-height: 1.25;
  text-align: center;
  max-width: 24ch;
  text-wrap: balance;
  margin-top: -26px;
}
.cta-stack {
  display: grid;
  gap: 10px;
}

.streak {
  font-size: var(--t-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.streak b {
  color: var(--fg);
  font-weight: 500;
}
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.week li {
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: var(--t-xs);
  color: var(--muted);
  letter-spacing: 0.06em;
}
.week .dot {
  width: 100%;
  max-width: 38px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  position: relative;
  display: grid;
  place-items: center;
}
.week .done .dot {
  border-color: transparent;
  background: radial-gradient(
    circle at 35% 30%,
    var(--ember),
    color-mix(in oklab, var(--jade) 85%, var(--lake)) 70%
  );
}
.week .today {
  color: var(--fg);
}
.week .today .dot {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px var(--accent);
}
.week .future .dot {
  border-style: dashed;
  opacity: 0.5;
}

.picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pick {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  transition:
    transform 0.25s var(--ease),
    background-color 0.2s;
  min-width: 0;
}
.pick:active {
  transform: scale(0.98);
}
.pick:hover {
  background: var(--surface);
}
.pick .art {
  width: 46px;
  height: 46px;
}
.pick-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}
.pick-meta {
  font-size: var(--t-sm);
  color: var(--muted);
  margin-top: 4px;
}

.art {
  border-radius: 50%;
  flex: none;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.45), transparent 32%),
    radial-gradient(circle at 70% 75%, var(--a2), transparent 62%),
    radial-gradient(circle at 40% 40%, var(--a1), color-mix(in oklab, var(--a1) 40%, var(--bg)) 78%);
  box-shadow: 0 10px 26px -12px var(--a1);
}

/* ---------- Breathe ---------- */
.breath-stage {
  position: relative;
  width: min(80vw, 300px);
  max-width: 100%;
  aspect-ratio: 1;
  margin: -6px auto 0;
}
.breath-orb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.breath-label,
.phase {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  pointer-events: none;
}
.phase-word {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.1;
  text-shadow: 0 1px 18px color-mix(in oklab, var(--bg) 70%, transparent);
}
.phase-count {
  font-variant-numeric: tabular-nums;
  font-size: var(--t-sm);
  letter-spacing: 0.18em;
  color: var(--fg);
  opacity: 0.75;
  margin-top: 6px;
}
.pattern-note {
  text-align: center;
  color: var(--muted);
  font-size: var(--t-sm);
  max-width: 34ch;
  margin: -14px auto 0;
  min-height: 2.6em;
  text-wrap: balance;
}

.patterns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pattern {
  display: grid;
  gap: 10px;
  text-align: left;
  padding: 14px 16px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    transform 0.2s var(--ease);
  min-width: 0;
}
.pattern:active {
  transform: scale(0.98);
}
.pattern[aria-checked="true"] {
  border-color: color-mix(in oklab, var(--accent) 70%, transparent);
  background: color-mix(in oklab, var(--accent) 9%, var(--surface));
}
.pattern-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  margin-top: -4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pattern-use {
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pattern[aria-checked="true"] .pattern-use {
  color: var(--accent);
}
.pattern-counts {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 22px;
}
.pattern-counts i {
  display: block;
  width: 100%;
  border-radius: 3px;
  background: var(--surface-2);
  position: relative;
}
.pattern-counts i[data-k="in"],
.pattern-counts i[data-k="top"] {
  background: color-mix(in oklab, var(--jade) 75%, transparent);
}
.pattern-counts i[data-k="out"] {
  background: color-mix(in oklab, var(--lake) 85%, var(--jade));
}
.pattern-sub {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.field {
  display: grid;
  gap: 10px;
}
.seg {
  display: flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.seg button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-sm);
  font-weight: 500;
  transition:
    background-color 0.25s,
    color 0.25s;
}
.seg button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- Library ---------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.scroller {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: -20px;
  padding-inline: 20px;
  scroll-padding-inline: 20px;
}
.scroller::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-size: var(--t-sm);
  transition: all 0.2s;
}
.chip[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--accent) 65%, transparent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
}

.session-list {
  display: flex;
  flex-direction: column;
  margin-top: -8px;
}
.session-list li + li {
  border-top: 1px solid var(--line);
}
.session {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 0;
  background: none;
  border: 0;
  text-align: left;
}
.session .art {
  width: 64px;
  height: 64px;
  transition: transform 0.4s var(--ease);
}
.session:hover .art {
  transform: scale(1.06) rotate(-6deg);
}
.session-text {
  min-width: 0;
}
.session-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.05;
}
.session-blurb {
  font-size: var(--t-sm);
  color: var(--muted);
  margin-top: 4px;
  text-wrap: pretty;
}
.session-len {
  font-size: var(--t-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.session-len b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: lining-nums proportional-nums;
  letter-spacing: -0.02em;
}

/* ---------- Journey ---------- */
.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}
.figures div {
  padding: 18px 0 16px;
  display: grid;
  gap: 6px;
}
.figures div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.figures dd {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2.75rem;
  line-height: 0.9;
  font-variant-numeric: lining-nums tabular-nums;
}
.figures dd small {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--muted);
  margin-left: 3px;
  font-weight: 400;
}
.figures dt {
  order: 2;
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.heat-wrap {
  overflow-x: auto;
}
.heat {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  min-width: 260px;
}
.heat i,
.legend i {
  display: block;
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--heat-0);
}
.heat i[data-l="1"],
.legend i[data-l="1"] {
  background: color-mix(in oklab, var(--jade) 35%, var(--heat-0));
}
.heat i[data-l="2"],
.legend i[data-l="2"] {
  background: color-mix(in oklab, var(--jade) 65%, var(--heat-0));
}
.heat i[data-l="3"],
.legend i[data-l="3"] {
  background: var(--jade);
}
.heat i[data-l="4"],
.legend i[data-l="4"] {
  background: radial-gradient(circle at 35% 30%, var(--ember), var(--jade) 85%);
}
.heat i.future {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}
.heat i.today {
  box-shadow: 0 0 0 1.5px var(--accent);
}
.legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--t-xs);
  color: var(--muted);
}
.legend i {
  width: 11px;
  border-radius: 3px;
}
.legend span:first-child {
  margin-right: 2px;
}
.legend span:last-child {
  margin-left: 2px;
}

.log li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.log li:last-child {
  border-bottom: 1px solid var(--line);
}
.log-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.1;
}
.log-when {
  font-size: var(--t-sm);
  color: var(--muted);
  grid-column: 1;
}
.log-min {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-sm);
  color: var(--muted);
}
.log-min b {
  display: block;
  color: var(--fg);
  font-weight: 500;
}
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  color: var(--fg);
  vertical-align: 1px;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 28px 12px 8px;
  color: var(--muted);
}
.log li.empty {
  grid-template-columns: 1fr;
  border: 0;
}
.empty .art {
  width: 54px;
  height: 54px;
  opacity: 0.85;
}
.empty p {
  max-width: 28ch;
}
.empty .btn {
  min-height: 46px;
  margin-top: 4px;
}

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 30rem;
  margin-inline: auto;
  padding: 6px max(12px, env(safe-area-inset-left, 0px))
    calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid var(--line);
}
@media (min-width: 30rem) {
  .tabbar {
    bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 26px;
    padding-bottom: 8px;
    left: 14px;
    right: 14px;
    box-shadow: var(--shadow);
  }
}
.tabbar a {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 0 4px;
  min-height: 52px;
  text-decoration: none;
  color: var(--faint);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: color 0.25s;
}
.tabbar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar a[aria-current="page"] {
  color: var(--fg);
}
.tabbar a[aria-current="page"] svg {
  stroke: var(--accent);
}

/* ---------- Player ---------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  justify-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
    calc(28px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(
      80% 50% at 50% 42%,
      color-mix(in oklab, var(--lake) 26%, transparent),
      transparent 72%
    ),
    var(--bg);
  overflow: hidden;
  animation: player-in 0.9s var(--ease) both;
}
.player.leaving {
  animation: player-out 0.5s var(--ease) both;
}
@keyframes player-in {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes player-out {
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}
.player-top {
  width: 100%;
  max-width: 30rem;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
}
.player-meta {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
}
.player-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.1;
}
.player-stage {
  position: relative;
  align-self: center;
  width: min(86vw, 46vh, 400px);
  aspect-ratio: 1;
  max-width: 100%;
}
.player-orb {
  position: absolute;
  inset: 7%;
  width: 86%;
  height: 86%;
}
.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
}
.ring-track {
  stroke: var(--line);
  stroke-width: 0.8;
}
.ring-fill {
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 609.47;
  stroke-dashoffset: 609.47;
  transition: stroke-dashoffset 0.6s linear;
}
.cue {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.25;
  text-align: center;
  max-width: 22ch;
  min-height: 3.8em;
  display: grid;
  place-items: center;
  text-wrap: balance;
  transition:
    opacity 1.2s var(--ease),
    transform 1.2s var(--ease);
}
.cue.fade {
  opacity: 0;
  transform: translateY(6px);
}
.player-time {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.clock {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--t-2xl);
  line-height: 0.95;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.01em;
}
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 10px;
}
.play {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--fg);
  color: var(--bg);
  transition: transform 0.25s var(--ease);
}
.play:active {
  transform: scale(0.94);
}
.play svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.play .i-play {
  display: none;
}
.player.paused .play .i-play {
  display: block;
}
.player.paused .play .i-pause {
  display: none;
}
.player.paused .player-orb {
  opacity: 0.7;
  transition: opacity 0.6s;
}
.player.paused .clock {
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.45;
  }
}
.player.breath .cue {
  display: none;
}

.tray {
  position: absolute;
  left: 50%;
  bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(30rem, calc(100% - 32px));
  display: grid;
  gap: 14px;
  padding: 16px;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: rise 0.35s var(--ease) both;
}
.vol {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--line) var(--p, 50%));
}
input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: var(--line);
}
input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  margin-top: -8.5px;
  border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  border: 0;
}

/* ---------- Sheet ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  animation: fade-in 0.35s both;
}
.scrim.leaving {
  animation: fade-out 0.3s both;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-width: 30rem;
  margin-inline: auto;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 30px 30px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.45);
  animation: sheet-in 0.5s var(--ease) both;
}
.sheet.leaving {
  animation: sheet-out 0.3s var(--ease) both;
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}
@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 10px auto 0;
  flex: none;
}
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px max(22px, env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sheet-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.sheet-hero .art {
  width: 84px;
  height: 84px;
}
.sheet-title {
  font-size: 2.4rem;
  font-weight: 300;
}
.sheet-sub {
  color: var(--muted);
  margin-top: 8px;
  text-wrap: pretty;
}

.rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  min-height: 58px;
}
.row-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.row-text small {
  color: var(--muted);
  font-size: var(--t-sm);
}
.text-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
}
textarea.text-input {
  padding: 12px 14px;
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}
.text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background-color 0.25s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fg);
  transition: transform 0.3s var(--ease);
}
.switch input:checked + span {
  background: var(--jade);
  border-color: transparent;
}
.switch input:checked + span::after {
  transform: translateX(20px);
  background: #fff;
}
.switch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.done-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding-top: 4px;
}
.done-orb {
  width: 132px;
  height: 132px;
}
.done-title {
  font-size: 2.6rem;
  font-weight: 300;
}
.done-title em {
  font-style: italic;
}
.moods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.mood {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 2px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.78rem;
  color: var(--muted);
  transition: all 0.2s;
}
.mood i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  transition: all 0.3s var(--ease);
}
.mood[aria-pressed="true"] {
  color: var(--fg);
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
}
.mood[aria-pressed="true"] i {
  background: radial-gradient(circle at 35% 30%, var(--ember), var(--jade) 80%);
  transform: scale(1.15);
}
.mood:nth-child(1) i {
  width: 14px;
  height: 14px;
  margin: 4px;
}
.mood:nth-child(2) i {
  width: 17px;
  height: 17px;
  margin: 2.5px;
}
.mood:nth-child(3) i {
  width: 20px;
  height: 20px;
  margin: 1px;
}

.confirm {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.confirm .btn {
  min-height: 44px;
  padding: 0 18px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  z-index: 80;
  transform: translateX(-50%);
  bottom: calc(var(--tab-h) + 30px + env(safe-area-inset-bottom, 0px));
  padding: 12px 18px;
  border-radius: 999px;
  max-width: calc(100% - 32px);
  background: var(--fg);
  color: var(--bg);
  font-size: var(--t-sm);
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.4s var(--ease) both;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* ---------- Larger screens ---------- */
@media (min-width: 48rem) {
  .app {
    padding-top: 32px;
  }
}

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

/* Account sheet: maps Lull's tokens onto the shared account sheet (css/account.css). */
:root {
  --acct-bg: var(--surface);
  --acct-field: var(--bg);
  --acct-raised: var(--bg);
  --acct-raised-on: var(--surface-2);
  --acct-ink: var(--fg);
  --acct-muted: var(--muted);
  --acct-faint: var(--faint);
  --acct-line: var(--line);
  --acct-line-strong: color-mix(in oklab, var(--fg) 20%, transparent);
  --acct-accent: var(--accent);
  --acct-primary: var(--accent);
  --acct-on-primary: var(--accent-fg);
  --acct-seg-on: var(--fg);
  --acct-on-seg-on: var(--bg);
  --acct-scrim: var(--scrim);
  --acct-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.45);
  --acct-font-body: var(--font-body);
  --acct-font-display: var(--font-display);
  --acct-font-label: var(--font-body);
  --acct-display-size: 2.9rem;
  --acct-display-weight: 300;
  --acct-display-tracking: -0.015em;
  --acct-accent-style: italic;
  --acct-label-weight: 500;
  --acct-label-tracking: 0.14em;
  --acct-sheet-radius: 30px 30px 0 0;
  --acct-radius: 14px;
  --acct-btn-radius: 999px;
  --acct-seg-radius: 999px;
  --acct-btn-h: 56px;
}
