/* Parts Meditation Companion — app.css */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  --ink: #0b1c2c;
  --ink-2: #102536;
  --ink-a: rgba(11, 28, 44, .46);
  --ink-a-strong: rgba(11, 28, 44, .7);
  --cream: #f6efe2;
  --cream-2: rgba(246, 239, 226, .78);
  --cream-3: rgba(246, 239, 226, .58);
  --gold: #d8b25a;
  --teal: #2db4c4;
  --hair: rgba(246, 239, 226, .18);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ui: 280ms;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --shadow-text: 0 1px 2px rgba(5, 12, 20, .45), 0 2px 22px rgba(5, 12, 20, .42);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--ink); color: var(--cream);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overflow: hidden; overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
input { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 24px; height: 24px; flex: none; display: block; }

/* ---------- Stage + wide-screen backdrop ---------- */
.backdrop {
  position: fixed; inset: 0; overflow: hidden; background: var(--ink);
}
.backdrop img {
  position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover;
  filter: blur(42px) saturate(1.05) brightness(.42);
  opacity: 0; transition: opacity 900ms var(--ease);
}
.backdrop img.on { opacity: 1; }
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(11, 28, 44, .1), rgba(11, 28, 44, .7));
}
.stage {
  position: fixed; top: 0; bottom: 0; left: 50%;
  width: min(100vw, 520px); transform: translateX(-50%);
  overflow: hidden; background: var(--ink);
  isolation: isolate;
}
@media (min-width: 600px) {
  .stage { box-shadow: 0 0 0 1px rgba(246, 239, 226, .08), 0 40px 120px rgba(0, 0, 0, .55); }
}
@media (min-width: 600px) and (min-height: 760px) {
  .stage { top: 24px; bottom: 24px; border-radius: 28px; }
}

/* ---------- Boot ---------- */
.boot {
  position: absolute; inset: 0; display: grid; place-items: center; background: var(--ink);
  z-index: 60; transition: opacity 500ms var(--ease);
}
.boot.gone { opacity: 0; pointer-events: none; }
.boot-mark { font-family: var(--serif); font-size: 3rem; color: var(--cream-3); letter-spacing: -.01em; }

/* ---------- Player ---------- */
.player { position: absolute; inset: 0; user-select: none; -webkit-user-select: none; }
.track {
  position: absolute; inset: 0; display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; contain: paint;
  background: var(--ink-2);
}
.art { position: absolute; inset: 0; overflow: hidden; }
.drift { position: absolute; inset: 0; will-change: transform; transform-origin: 50% 46%; }
.paint-fallback, .art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.paint-fallback { background-color: #23384a; }
.art img.thumb { filter: blur(14px) saturate(1.05); transform: scale(1.08); opacity: 0; transition: opacity 400ms var(--ease); }
.art img.thumb.ok { opacity: 1; }
.art img.full { opacity: 0; transition: opacity 900ms var(--ease); }
.art img.full.ok { opacity: 1; }
.art img.painted { opacity: 0; transition: opacity 600ms var(--ease); }
.art img.painted.ok { opacity: 1; }

/* living light */
.glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(130% 95% at 50% 38%, rgba(255, 214, 150, 0) 38%, rgba(255, 196, 120, .9) 100%);
  mix-blend-mode: soft-light;
}
.weave {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background-size: 46px 46px; mix-blend-mode: overlay;
  -webkit-mask-image: linear-gradient(115deg, transparent 0%, transparent 38%, #000 50%, transparent 62%, transparent 100%);
          mask-image: linear-gradient(115deg, transparent 0%, transparent 38%, #000 50%, transparent 62%, transparent 100%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
}
.sweep {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background-image:
    linear-gradient(115deg, rgba(255, 220, 160, 0) 36%, rgba(255, 224, 170, .85) 47%, rgba(255, 244, 214, 1) 50%, rgba(255, 224, 170, .85) 53%, rgba(255, 220, 160, 0) 64%);
  background-size: 300% 100%; background-repeat: no-repeat; background-position: 100% 0;
  mix-blend-mode: soft-light;
}
.sweep.screen { mix-blend-mode: screen; }
.slide.sweeping .sweep { animation: sweepBand 2600ms cubic-bezier(.45, .05, .25, 1) both; }
.slide.sweeping .sweep.screen { animation-name: sweepBandFaint; }
.slide.sweeping .weave { animation: weaveReveal 2600ms cubic-bezier(.45, .05, .25, 1) both; }
@keyframes sweepBand {
  0% { opacity: 0; background-position: 100% 0; }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; background-position: 0% 0; }
}
@keyframes sweepBandFaint {
  0% { opacity: 0; background-position: 100% 0; }
  15% { opacity: .22; }
  80% { opacity: .22; }
  100% { opacity: 0; background-position: 0% 0; }
}
@keyframes weaveReveal {
  0% { opacity: 0; -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  15% { opacity: .55; }
  80% { opacity: .55; }
  100% { opacity: 0; -webkit-mask-position: 0% 0; mask-position: 0% 0; }
}
.slide .drift { animation: breathe 40s ease-in-out infinite alternate; animation-play-state: paused; }
.slide .glow { animation: warmShift 12s ease-in-out infinite alternate; animation-play-state: paused; }
.slide.breathing .drift, .slide.breathing .glow { animation-play-state: running; }
.slide.rested .drift, .slide.rested .glow { animation: none; }
@keyframes breathe {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.05) translate3d(-7px, -5px, 0); }
}
@keyframes warmShift { from { opacity: 0; } to { opacity: .08; } }
@keyframes lift { 0% { filter: brightness(1); } 45% { filter: brightness(1.08); } 100% { filter: brightness(1); } }

@media (prefers-reduced-motion: reduce) {
  .slide .drift, .slide .glow { animation: none !important; }
  .slide.sweeping .sweep, .slide.sweeping .weave { animation: none !important; opacity: 0 !important; }
  .slide.sweeping .art { animation: lift 400ms ease-out both; }
  .art img.full, .art img.thumb, .overlay, .sheet { transition-duration: 1ms !important; }
}

/* per-slide caption */
.caption {
  position: absolute; left: 0; right: 0; bottom: calc(188px + var(--sab));
  padding: 0 calc(26px + var(--sar)) 0 calc(26px + var(--sal));
  pointer-events: none;
  opacity: 0; transform: translateY(8px);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
  text-shadow: var(--shadow-text);
}
.player.ui .caption { opacity: 1; transform: none; }
.player.is-ended .slide.current .caption { opacity: 0; transform: translateY(-6px); }
.meta {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-2);
}
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.meta .done { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 90, .18); }
.title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.35rem, 10.4vw, 3.15rem); line-height: 1.02; letter-spacing: -.012em;
  margin: 0 0 12px; color: var(--cream);
  text-wrap: balance;
}
.sentence {
  margin: 0; max-width: 32em;
  font-size: 1rem; line-height: 1.52; color: rgba(246, 239, 226, .9);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: pretty;
}

/* overlay (global chrome) */
.overlay {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 320ms var(--ease);
}
.player.ui .overlay { opacity: 1; }
.player.ui .overlay .topbar, .player.ui .overlay .dock { pointer-events: auto; }
.scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64%; pointer-events: none;
  opacity: 0; transition: opacity 320ms var(--ease);
  background: linear-gradient(to top,
    rgba(7, 17, 27, .94) 0%, rgba(7, 17, 27, .84) 22%, rgba(8, 19, 30, .6) 40%,
    rgba(9, 21, 33, .26) 58%, rgba(11, 28, 44, .08) 72%, rgba(11, 28, 44, 0) 100%);
}
.player.ui .scrim { opacity: 1; }

.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(10px + var(--sat)) calc(14px + var(--sar)) 0 calc(18px + var(--sal));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 17, 27, .38), rgba(7, 17, 27, 0));
}
.mark {
  font-family: var(--serif); font-size: 1.6rem; line-height: 1; color: var(--cream);
  text-shadow: var(--shadow-text); min-width: 72px;
}
.position {
  position: absolute; left: 50%; top: calc(10px + var(--sat)); height: 44px; display: flex; align-items: center;
  transform: translateX(-50%);
  font-size: 12px; font-weight: 600; letter-spacing: .12em; color: var(--cream-2);
  font-variant-numeric: tabular-nums; text-shadow: var(--shadow-text);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; min-width: 72px; justify-content: flex-end; }

.glass {
  background: var(--ink-a); border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
}
.chip-btn, .icon-btn, .play-btn, .now-pill, .ghost-btn, .secondary-btn {
  background: var(--ink-a); border: 1px solid var(--hair); color: var(--cream);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  transition: background-color 240ms var(--ease), transform 240ms var(--ease), border-color 240ms var(--ease), opacity 240ms var(--ease);
}
.chip-btn {
  height: 44px; padding: 0 16px 0 13px; border-radius: 22px;
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; letter-spacing: .01em;
}
.chip-btn .ico { width: 19px; height: 19px; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%; display: inline-grid; place-items: center;
}
.icon-btn.small { width: 44px; height: 44px; }
.icon-btn.small .ico { width: 20px; height: 20px; }
.icon-btn .ico { width: 26px; height: 26px; }
.chip-btn:active, .icon-btn:active, .ghost-btn:active, .secondary-btn:active { transform: scale(.96); background: var(--ink-a-strong); }
@media (hover: hover) {
  .chip-btn:hover, .icon-btn:hover, .ghost-btn:hover, .secondary-btn:hover, .now-pill:hover { background: var(--ink-a-strong); border-color: rgba(246, 239, 226, .3); }
}

.dock {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 calc(22px + var(--sar)) calc(14px + var(--sab)) calc(22px + var(--sal));
}
.scrub-row { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 10px; }
.time { font-size: 12px; font-weight: 600; color: var(--cream-2); font-variant-numeric: tabular-nums; text-shadow: var(--shadow-text); }
.time.right { text-align: right; }
.scrubber {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer;
  --p: 0%;
}
.scrubber:disabled { cursor: default; }
.scrubber::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(to right, var(--gold) 0, var(--gold) var(--p), rgba(246, 239, 226, .24) var(--p), rgba(246, 239, 226, .24) 100%);
}
.scrubber::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(246, 239, 226, .24); }
.scrubber::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--gold); }
.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; margin-top: -5.5px;
  background: var(--cream); border: 0; box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
  transition: transform 200ms var(--ease);
}
.scrubber::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--cream); border: 0; }
.scrubber:active::-webkit-slider-thumb { transform: scale(1.25); }
.scrubber:disabled::-webkit-slider-thumb { opacity: .0; }
.scrubber:disabled::-moz-range-thumb { opacity: 0; }
.scrubber:focus-visible { outline-offset: -8px; border-radius: 10px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 4px; }
.play-btn {
  position: relative; width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(246, 239, 226, .14); border-color: rgba(246, 239, 226, .34);
}
.play-btn .ico { width: 32px; height: 32px; grid-area: 1 / 1; transition: opacity 200ms var(--ease), transform 240ms var(--ease); }
.play-btn .i-play { transform: translateX(2px); }
.play-btn .i-pause { opacity: 0; transform: scale(.8); }
.player.playing-here .play-btn .i-play { opacity: 0; transform: translateX(2px) scale(.8); }
.player.playing-here .play-btn .i-pause { opacity: 1; transform: none; }
.play-btn:active { transform: scale(.95); }
.play-btn .ring {
  position: absolute; inset: -1px; border-radius: 50%; border: 1.75px solid transparent;
  border-top-color: var(--gold); opacity: 0; transition: opacity 200ms;
}
.player.loading .play-btn .ring { opacity: 1; animation: spin 1s linear infinite; }
.player.loading .play-btn .ico { opacity: .35; }
@keyframes spin { to { transform: rotate(360deg); } }
.restart-row { height: 30px; display: flex; justify-content: center; align-items: center; margin-top: 4px; }
.text-btn {
  min-height: 44px; padding: 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--cream-2); text-decoration: underline; text-decoration-color: rgba(246, 239, 226, .35);
  text-underline-offset: 4px; text-shadow: var(--shadow-text);
}
.text-btn:disabled { opacity: .55; text-decoration: none; }

.ended {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 18px);
  padding: 0 calc(22px + var(--sar)) 0 calc(22px + var(--sal));
  text-align: center; animation: fadeUp 600ms var(--ease) both;
}
.ended-line {
  font-family: var(--serif); font-size: clamp(2.3rem, 10vw, 3rem); line-height: 1.05; margin: 0 0 20px;
  text-shadow: var(--shadow-text);
}
.ended-actions { display: flex; gap: 12px; justify-content: center; }
.ghost-btn { height: 46px; padding: 0 22px; border-radius: 23px; font-size: 14px; font-weight: 600; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.now-pill {
  position: absolute; top: calc(66px + var(--sat)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 48px); height: 36px; padding: 0 16px 0 12px; border-radius: 18px;
  display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity 320ms var(--ease);
}
.now-pill::after { content: ""; position: absolute; inset: -5px 0; }
.player.ui .now-pill { opacity: 1; pointer-events: auto; }
.now-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; animation: pulse 2.4s ease-in-out infinite; }
#nowPillText { overflow: hidden; text-overflow: ellipsis; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

.hint {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 32px;
  background: rgba(7, 17, 27, .38); z-index: 5; animation: fadeIn 500ms var(--ease) both;
}
.hint p {
  margin: 0; padding: 18px 22px; border-radius: 20px; max-width: 280px; text-align: center;
  font-size: 15px; font-weight: 500; line-height: 1.5;
  background: var(--ink-a-strong); border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Welcome + locked ---------- */
.welcome, .locked { position: absolute; inset: 0; overflow: hidden; z-index: 20; }
.welcome-art { position: absolute; inset: 0; background:
  radial-gradient(80% 60% at 70% 22%, rgba(216, 178, 90, .35), transparent 60%),
  radial-gradient(90% 70% at 15% 70%, rgba(45, 120, 140, .4), transparent 65%),
  linear-gradient(170deg, #1d3a50 0%, #0f2638 55%, #0b1c2c 100%); }
.welcome-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1200ms var(--ease); }
.welcome-art img.ok { opacity: 1; }
.welcome-art.dim img { filter: brightness(.7) saturate(.9); }
.welcome-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(7, 17, 27, .25) 0%, rgba(7, 17, 27, 0) 26%),
    linear-gradient(to top, rgba(7, 17, 27, .95) 0%, rgba(7, 17, 27, .82) 34%, rgba(7, 17, 27, .35) 60%, rgba(7, 17, 27, .05) 80%);
}
.welcome-inner, .locked-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(28px + var(--sat)) calc(26px + var(--sar)) calc(22px + var(--sab)) calc(26px + var(--sal));
  overflow-y: auto;
}
.brand { margin-bottom: 26px; }
.wordmark {
  position: relative; margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(6.2rem, 33vw, 9.4rem); line-height: .86; letter-spacing: -.025em;
  isolation: isolate;
}
.wordmark::before {
  content: attr(data-text); position: absolute; left: 0; top: 0; z-index: 0;
  color: transparent; pointer-events: none;
  text-shadow: 0 2px 3px rgba(4, 10, 18, .55), 0 10px 40px rgba(4, 10, 18, .55);
}
.wordmark-fill {
  position: relative; z-index: 1; display: inline-block; padding: 0 .04em .06em 0;
  color: var(--cream);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark-fill.painted {
    background-image: var(--paint, none), linear-gradient(160deg, #fbf5ea 0%, #f1e3c6 48%, #e3c98f 100%);
    background-size: 260% auto, cover; background-position: 32% 46%, center;
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
}
.eyebrow-wide {
  margin: 14px 0 0 4px; font-size: 12.5px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase;
  color: var(--cream); text-shadow: var(--shadow-text);
}
.lede {
  margin: 18px 0 0 3px; font-family: var(--serif); font-size: 1.5rem; line-height: 1.22;
  color: rgba(246, 239, 226, .92); max-width: 20em; text-shadow: var(--shadow-text);
}
.auth { display: flex; flex-direction: column; gap: 10px; }
.field-label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-3); margin-left: 2px; }
.field {
  height: 54px; width: 100%; padding: 0 18px; border-radius: 16px;
  background: rgba(246, 239, 226, .08); color: var(--cream); border: 1px solid var(--hair);
  font-size: 17px; font-weight: 500;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color 240ms var(--ease), background-color 240ms var(--ease);
}
.field::placeholder { color: rgba(246, 239, 226, .4); }
.field:focus { border-color: rgba(246, 239, 226, .45); background: rgba(246, 239, 226, .12); }
.field:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.field.code { font-size: 26px; letter-spacing: .32em; font-variant-numeric: tabular-nums; text-align: center; font-weight: 600; }
.field.code::placeholder { letter-spacing: .08em; font-size: 17px; font-weight: 500; }
.primary-btn {
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  min-height: 54px; padding: 0 22px; border-radius: 27px; margin-top: 4px;
  background: var(--cream); color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: .005em;
  transition: transform 240ms var(--ease), opacity 240ms var(--ease), background-color 240ms var(--ease);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
.primary-btn:active { transform: scale(.98); }
.primary-btn:disabled, .primary-btn.busy { opacity: .6; }
@media (hover: hover) { .primary-btn:hover { background: #fffaf0; } }
.secondary-btn {
  min-height: 52px; padding: 0 22px; border-radius: 26px; font-size: 15px; font-weight: 600; width: 100%;
}
.form-msg { min-height: 1.4em; margin: 2px 2px 0; font-size: 14px; line-height: 1.45; color: #f2d58e; }
.form-msg.calm { color: var(--cream-2); }
.code-intro { margin: 0 0 6px; font-size: 16px; line-height: 1.5; color: rgba(246, 239, 226, .92); }
.code-intro strong { font-weight: 700; word-break: break-all; }
.code-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin: -4px -10px 0; }
.new-here { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--cream-3); }
.new-here a { color: var(--cream); font-weight: 600; text-underline-offset: 4px; text-decoration-color: rgba(246, 239, 226, .4); display: inline-block; padding: 10px 2px; }

.locked-inner { gap: 12px; }
.eyebrow { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); }
.locked-title { margin: 4px 0 2px; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 9.5vw, 2.8rem); line-height: 1.04; text-shadow: var(--shadow-text); }
.locked-email { margin: 0 0 14px; font-size: 15px; color: var(--cream-2); word-break: break-all; }
.small-note { margin: 6px 0 0; font-size: 14px; text-align: center; color: var(--cream-3); }

/* ---------- Sheets ---------- */
.sheet-shade {
  position: absolute; inset: 0; z-index: 30; background: rgba(5, 12, 20, .5);
  opacity: 0; transition: opacity 300ms var(--ease);
}
.sheet-shade.on { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 31;
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(216, 178, 90, .07), transparent 60%),
    linear-gradient(180deg, #10263a 0%, #0b1c2c 40%);
  border-top: 1px solid var(--hair);
  border-radius: 26px 26px 0 0;
  transform: translateY(102%); transition: transform 320ms var(--ease);
  display: flex; flex-direction: column;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
}
.sheet.open { transform: none; }
.sheet.find { top: calc(8px + var(--sat)); }
.sheet-head { position: relative; height: 60px; flex: none; display: flex; justify-content: flex-end; align-items: center; padding: 6px 12px 0; }
.grabber { position: absolute; left: 50%; top: 8px; width: 38px; height: 4px; border-radius: 2px; background: rgba(246, 239, 226, .22); transform: translateX(-50%); }
.sheet .icon-btn { background: rgba(246, 239, 226, .06); -webkit-backdrop-filter: none; backdrop-filter: none; }

.find-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 calc(22px + var(--sar)) calc(28px + var(--sab)) calc(22px + var(--sal));
}
.find-title { margin: 0 0 20px; padding-top: 4px; font-family: var(--serif); font-weight: 400; font-size: clamp(2.3rem, 10vw, 2.85rem); line-height: 1.02; letter-spacing: -.01em; }
.search-wrap { position: relative; }
.search-wrap .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--cream-3); pointer-events: none; }
.search {
  width: 100%; height: 52px; border-radius: 16px; padding: 0 16px 0 46px;
  background: rgba(246, 239, 226, .07); border: 1px solid var(--hair); color: var(--cream);
  font-size: 16px; font-weight: 500; -webkit-appearance: none; appearance: none;
}
.search::placeholder { color: rgba(246, 239, 226, .42); }
.search:focus { border-color: rgba(246, 239, 226, .42); background: rgba(246, 239, 226, .1); }
.search::-webkit-search-cancel-button { -webkit-appearance: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--hair);
  background: rgba(246, 239, 226, .04); font-size: 14px; font-weight: 600; color: rgba(246, 239, 226, .9);
  transition: background-color 240ms var(--ease), color 240ms var(--ease), border-color 240ms var(--ease);
}
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
@media (hover: hover) { .chip:hover { border-color: rgba(246, 239, 226, .4); } }
.lengths {
  display: flex; gap: 2px; margin: 16px 0 0; padding: 3px; border-radius: 16px;
  overflow-x: auto; scrollbar-width: none;
  background: rgba(246, 239, 226, .05); border: 1px solid rgba(246, 239, 226, .1);
}
.len {
  flex: 1 1 auto; min-height: 44px; padding: 0 6px; border-radius: 13px;
  font-size: clamp(11px, 3.2vw, 12.5px); font-weight: 600; color: var(--cream-2); white-space: nowrap;
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}
.len[aria-checked="true"] { background: rgba(246, 239, 226, .14); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(246, 239, 226, .2); }
.count { margin: 22px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-3); }
.results { list-style: none; margin: 0; padding: 0; }
.results li + li { border-top: 1px solid rgba(246, 239, 226, .08); }
.card {
  width: 100%; display: grid; grid-template-columns: 74px 1fr; gap: 16px; align-items: center;
  padding: 14px 0; text-align: left; border-radius: 14px;
  transition: background-color 240ms var(--ease);
}
.card:active { background: rgba(246, 239, 226, .05); }
.card-thumb {
  position: relative; width: 74px; height: 111px; border-radius: 12px; overflow: hidden;
  background: #23384a; box-shadow: 0 6px 18px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(246, 239, 226, .08);
}
.card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 400ms var(--ease); }
.card-thumb img.ok { opacity: 1; }
.card-title { display: block; font-family: var(--serif); font-size: 1.42rem; line-height: 1.08; margin: 0 0 6px; color: var(--cream); }
.card-sentence {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; line-height: 1.45; color: rgba(246, 239, 226, .72);
}
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--cream-3); }
.card-meta .done { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.tag { padding: 2px 8px; border-radius: 9px; border: 1px solid rgba(216, 178, 90, .55); color: var(--gold); font-size: 11px; letter-spacing: .04em; }
.empty { margin: 28px 0; font-size: 15px; line-height: 1.5; color: var(--cream-2); }

.sheet.account { padding-bottom: var(--sab); }
.account-body { padding: 0 calc(24px + var(--sar)) 26px calc(24px + var(--sal)); }
.account-email { margin: 6px 0 22px; font-family: var(--serif); font-weight: 400; font-size: 1.85rem; line-height: 1.1; word-break: break-all; }
.install { padding: 16px 18px; margin: 0 0 18px; border-radius: 18px; background: rgba(246, 239, 226, .05); border: 1px solid rgba(246, 239, 226, .1); }
.install h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.install p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--cream-2); }
.install p + p { margin-top: 6px; }
.install strong { color: var(--cream); font-weight: 600; }
.version { margin: 16px 0 0; text-align: center; font-size: 11px; letter-spacing: .08em; color: rgba(246, 239, 226, .4); }

/* ---------- Banners ---------- */
.offline {
  position: absolute; left: 14px; right: 14px; top: calc(66px + var(--sat)); z-index: 50;
  padding: 12px 16px; border-radius: 14px; text-align: center; font-size: 13.5px; font-weight: 600; line-height: 1.4;
  background: rgba(11, 28, 44, .82); border: 1px solid var(--hair); color: var(--cream);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: fadeIn 300ms var(--ease) both;
}
.toast {
  position: absolute; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); z-index: 55;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; text-align: center;
  background: rgba(11, 28, 44, .9); border: 1px solid var(--hair); color: var(--cream);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: fadeIn 240ms var(--ease) both;
}

@media (max-height: 700px) {
  .title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .caption { bottom: calc(176px + var(--sab)); }
  .sentence { -webkit-line-clamp: 2; }
  .play-btn { width: 72px; height: 72px; }
  .wordmark { font-size: clamp(5rem, 28vw, 7.5rem); }
}

.icon-btn:disabled { opacity: .38; }
.track-empty { flex: 0 0 100%; display: grid; place-items: center; padding: 40px; text-align: center; }
.track-empty p { max-width: 280px; font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; color: var(--cream-2); margin: 0; }

/* beta0.2: headings that receive focus for screen readers show no ring */
.find-title:focus, .find-title:focus-visible, h1:focus, h2:focus { outline: none; box-shadow: none; }
