:root {
  --app-width: 430px;
  --app-height: 932px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --ink: #42413f;
  --muted: #8d8b89;
  --faint: #c7c5c3;
  --sage: #7b906f;
  --action: #82ad9a;
  --warm-white: #f4f2ef;
  --warm-field: #e5e1dc;
  --day-selected: #f0ede8;
  --radius: 15px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: #fff;
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
}

button,
textarea {
  font: inherit;
}

button,
a,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(123, 144, 111, 0.45);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  width: min(100%, var(--app-width));
  height: min(100vh, var(--app-height));
  height: min(100dvh, var(--app-height));
  margin: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 32px rgba(31, 45, 39, 0.06);
}

.home-page {
  height: 100%;
  padding: calc(29px + var(--safe-area-top)) 15px calc(150px + var(--safe-area-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.home-page::-webkit-scrollbar,
.lessons-page::-webkit-scrollbar {
  display: none;
}

.greeting {
  margin: 0 0 17px;
  color: #858382;
  font-size: 16px;
  line-height: 1.3;
}

.progress-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.progress-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 10px;
  background: #f0eeeb;
}

.progress-icon img {
  width: 22px;
  height: 22px;
}

.progress-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.05;
}

.progress-copy strong {
  color: #4b4947;
  font-size: 17px;
  font-weight: 700;
}

.progress-copy span {
  margin-top: 4px;
  color: #aaa8a6;
  font-size: 13px;
  white-space: nowrap;
}

.day-picker {
  display: flex;
  gap: 8px;
  margin: 0 -15px 19px 0;
  padding: 0 15px 1px 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
}

.day-picker::-webkit-scrollbar {
  display: none;
}

.day-card {
  display: flex;
  width: 70px;
  min-width: 70px;
  height: 88px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  scroll-snap-align: start;
  border: 0;
  border-radius: 20px;
  color: #aaa8a6;
  background: #fbfbfb;
  cursor: pointer;
}

.day-card > span:first-child {
  font-size: 13px;
  font-weight: 600;
}

.day-card strong,
.day-number {
  color: inherit;
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.day-card.is-available {
  border: 2px solid #efefef;
  color: #a9a7a5;
  background: #fff;
}

.day-card.is-selected {
  color: #5c4d39;
  background: var(--day-selected);
}

.day-card.is-selected > span:first-child {
  color: #4c4235;
}

.day-card.is-completed:not(.is-selected) {
  border: 2px solid #ededed;
  color: #aaa8a6;
  background: #fff;
}

.day-card.is-locked {
  color: #c3c2c1;
  cursor: not-allowed;
  opacity: 1;
}

.day-number {
  display: flex;
  align-items: center;
  gap: 4px;
}

.day-lock-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: currentColor;
}

.day-lock-icon[hidden] {
  display: none;
}

.lock {
  position: relative;
  width: 12px;
  height: 10px;
  margin-top: 4px;
  border-radius: 3px;
  background: currentColor;
}

.lock::before {
  position: absolute;
  top: -6px;
  left: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: "";
}

.daily-content {
  display: grid;
  gap: 10px;
}

.practice-card {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  border-radius: var(--radius);
  color: #fff;
  background-color: rgba(114, 146, 98, 0.5);
  background-position: right center;
  background-repeat: no-repeat;
  background-size: cover;
}

.lesson-card {
  min-height: 164px;
  background-image: url("assets/lesson.jpg");
}

.daily-content[data-day="2"] .lesson-card {
  background-image: url("assets/day 2 morning lesson 2x.jpg");
}

.afternoon-card {
  cursor: pointer;
  background-image: url("assets/day-1-afternoon.jpg");
}

.afternoon-card[hidden] {
  display: none;
}

.meditation-card {
  min-height: 222px;
  background-image: url("assets/meditation.jpg");
}

.daily-content[data-day="2"] .meditation-card {
  background-image: url("assets/day 2  meditation 2x.jpg");
}

.practice-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.content-label {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 6px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(71, 55, 40, 0.25);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.practice-card h1,
.practice-card h2,
.journal-card h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 700;
}

.practice-card.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.32);
  opacity: 0.6;
}

.practice-card.is-locked .play-button {
  color: #989795;
  background: #ececea;
}

.play-button.is-locked .play-triangle {
  display: none;
}

.play-button.is-locked {
  position: relative;
}

.play-button.is-locked::before {
  position: absolute;
  top: 18px;
  left: 14px;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.play-button.is-locked::after {
  position: absolute;
  top: 11px;
  left: 16px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: "";
}

.practice-card h1 {
  font-size: 23px;
  line-height: 1;
}

.meditation-card h2 {
  max-width: calc(100% - 20px);
  font-size: clamp(23px, 4.2vw, 26px);
  line-height: 1;
}

.practice-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  line-height: 1;
}

.duration svg {
  width: 20px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.play-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--sage);
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.play-button:active {
  transform: scale(0.94);
}

.play-triangle {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
}

.play-button.is-playing .play-triangle {
  width: 10px;
  height: 14px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 36%, transparent 36% 64%, currentColor 64% 100%);
}

.journal-card {
  display: flex;
  min-height: 205px;
  flex-direction: column;
  padding: 15px;
  border-radius: var(--radius);
  background: var(--warm-white);
}

.journal-label {
  color: rgba(255, 255, 255, 0.76);
  background: #b8aa9d;
}

.journal-card h2 {
  margin-top: 13px;
  color: #494745;
  font-size: 18px;
  line-height: 1.15;
}

.journal-card textarea {
  width: 100%;
  min-height: 40px;
  max-height: 84px;
  margin-top: auto;
  padding: 11px 16px;
  resize: none;
  border: 0;
  border-radius: 999px;
  color: #725f51;
  background: var(--warm-field);
  font-size: 16px;
  line-height: 18px;
}

.journal-card textarea::placeholder {
  color: #7b6758;
  opacity: 0.85;
}

.complete-button {
  width: 100%;
  min-height: 48px;
  margin-top: 5px;
  border: 0;
  border-radius: 60px;
  color: #fff;
  background: var(--action);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.complete-button:active {
  transform: scale(0.99);
}

.complete-button.is-complete {
  filter: saturate(0.76);
}

.complete-button:disabled {
  cursor: default;
  opacity: 0.82;
}

.complete-help {
  margin: -2px 10px 0;
  color: rgba(90, 86, 82, 0.48);
  font-size: 12px;
  line-height: 1.2;
}

.bottom-nav {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: 100%;
  min-height: calc(80px + var(--safe-area-bottom));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  margin: 0;
  padding: 0 15px var(--safe-area-bottom);
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 -14px 30px rgba(0, 0, 0, 0.08);
}

.nav-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #807e7d;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item img,
.profile-icon {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.nav-item:not(.is-active) img {
  filter: grayscale(1);
  opacity: 0.72;
}

.profile-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.nav-item.is-active {
  color: var(--sage);
}

.mini-player {
  --mini-progress: 0%;
  position: absolute;
  z-index: 30;
  right: 0;
  bottom: calc(80px + var(--safe-area-bottom));
  left: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 3px;
  padding: 9px 8px 8px;
  border-bottom: 1px solid #d8d8d7;
  background: #fff;
  box-shadow: 0 -8px 22px rgba(32, 39, 35, 0.1);
}

.mini-player[hidden] {
  display: none;
}

.mini-player-progress {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--action) 0,
    var(--action) var(--mini-progress),
    #e3e3e2 var(--mini-progress),
    #e3e3e2 100%
  );
}

.mini-player-summary {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.mini-player-summary img {
  width: 44px;
  height: 48px;
  flex: 0 0 44px;
  border-radius: 8px;
  object-fit: cover;
  object-position: right center;
}

.mini-player-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.mini-player-copy strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-player-copy span {
  color: #575553;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mini-player-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
}

.mini-jump-button,
.mini-play-button,
.mini-close-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 0;
  color: #7b7b79;
  border-radius: 50%;
  background: #f0f0ef;
  cursor: pointer;
}

.mini-jump-button .jump-icon {
  width: 36px;
  height: 36px;
  transform: translateY(-4px);
}

.mini-jump-button .jump-value {
  font-size: 10px;
}

.mini-play-button {
  border: 0;
  color: var(--action);
  background: #f0f0ef;
}

.mini-play-button.is-playing {
  color: #fff;
  background: var(--action);
}

.mini-play-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
}

.mini-play-button.is-playing .mini-play-icon {
  width: 12px;
  height: 16px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66% 100%);
}

.mini-close-button {
  margin-left: 15px;
  color: var(--sage);
  background: #e9e9e8;
}

.mini-jump-button {
  background: #fff;
}

.mini-close-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.8;
}

.app-shell.has-mini-player .home-page {
  padding-bottom: calc(232px + var(--safe-area-bottom));
}

.app-shell.has-mini-player .lessons-page {
  padding-bottom: calc(214px + var(--safe-area-bottom));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Daily lessons */

.lessons-page {
  height: 100%;
  padding: calc(28px + var(--safe-area-top)) 15px calc(132px + var(--safe-area-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.screen-header {
  position: relative;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.screen-header h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 25px;
  line-height: 1;
}

.screen-back,
.player-back {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  color: #151515;
  background: transparent;
  cursor: pointer;
}

.screen-back {
  position: absolute;
  left: -8px;
  text-decoration: none;
}

.screen-back svg,
.player-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.lesson-day-section + .lesson-day-section {
  margin-top: 24px;
}

.lesson-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 9px;
}

.lesson-day-heading h2 {
  margin: 0;
  color: #4c4a48;
  font-size: 17px;
  line-height: 1;
}

.lesson-day-heading span {
  color: #aaa8a6;
  font-size: 12px;
}

.lesson-list-card {
  position: relative;
  display: flex;
  min-height: 122px;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  border-radius: 15px;
  color: #fff;
  background-color: #8b9b91;
  background-image: url("assets/lesson.jpg");
  background-position: right center;
  background-repeat: no-repeat;
  background-size: cover;
  text-decoration: none;
}

.lesson-list-card[data-track-artwork="day-1-morning"] {
  background-image: url("assets/player-lesson.jpg");
}

.lesson-list-card[data-track-artwork="preparation-for-cadence-breathing"] {
  background-image: url("assets/meditation.jpg");
}

.lesson-list-card[data-track-artwork="day-1-pm"] {
  background-image: url("assets/day-1-afternoon.jpg");
}

.lesson-list-card[data-track-artwork="day-2-morning"] {
  background-image: url("assets/day 2 morning lesson 2x.jpg");
}

.lesson-list-card[data-track-artwork="cadence-breathing-meditation"] {
  background-image: url("assets/day 2  meditation 2x.jpg");
}

.lesson-list-card + .lesson-list-card {
  margin-top: 9px;
}

.lesson-list-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(47, 57, 53, 0.34), rgba(47, 57, 53, 0));
  content: "";
  pointer-events: none;
}

.lesson-list-copy,
.lesson-list-footer {
  position: relative;
  z-index: 1;
}

.lesson-list-copy span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 600;
}

.lesson-list-copy h3 {
  margin: 8px 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 21px;
  line-height: 1;
}

.lesson-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-list-duration {
  font-size: 13px;
}

.lesson-list-play {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--sage);
  background: #fff;
}

.lesson-list-play .play-triangle {
  border-top-width: 5px;
  border-bottom-width: 5px;
  border-left-width: 8px;
}

.lesson-list-play.is-locked {
  position: relative;
  color: #989795;
  background: #ececea;
}

.lesson-list-play.is-locked .play-triangle {
  display: none;
}

.lesson-list-play .lesson-lock-icon {
  display: none;
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.lesson-list-play.is-locked .lesson-lock-icon {
  display: block;
}

.lesson-list-card.is-locked {
  color: rgba(255, 255, 255, 0.65);
  filter: grayscale(0.45);
  opacity: 0.55;
  pointer-events: none;
}

.lesson-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
}

.lesson-lock .lesson-lock-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: currentColor;
}

/* Audio player */

.player-shell {
  border-radius: 0 0 0 16px;
}

.player-page {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  padding: calc(21px + var(--safe-area-top)) 24px calc(28px + var(--safe-area-bottom));
  background: #fff;
}

.player-page:focus {
  outline: none;
}

.player-overlay {
  position: absolute;
  z-index: 50;
  inset: 0;
}

.player-overlay[hidden] {
  display: none;
}

.player-back {
  flex: 0 0 40px;
  margin-left: -9px;
}

.player-artwork-wrap {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  width: calc(100% + 18px);
  flex-direction: column;
  align-items: center;
  margin: clamp(24px, 5vh, 50px) -9px 0;
  overflow: hidden;
  border-radius: 15px;
}

.player-artwork {
  display: block;
  width: 100%;
  height: clamp(250px, 36.7vh, 342px);
  border-radius: 15px;
  object-fit: cover;
  object-position: right center;
}

.player-meta {
  margin-top: 17px;
}

.player-meta h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 22px;
  line-height: 1.1;
}

.player-meta p {
  margin: 8px 0 0;
  color: #92908e;
  font-size: 15px;
}

.player-meta .player-description {
  margin-top: 24px;
  color: rgba(66, 65, 63, 0.7);
  font-size: 15px;
  line-height: 1.45;
}

.player-status {
  margin: 8px 0 0;
  color: #9a603b;
  font-size: 12px;
  line-height: 1.35;
}

.download-icon-button {
  position: absolute;
  z-index: 2;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 11px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  cursor: pointer;
}
.download-icon-button:disabled { opacity: 0.45; cursor: default; }
.download-icon-button svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #0006);
}
.download-progress-outline { opacity: 0.4; }
.download-icon-button .download-progress-fill { fill: currentColor; stroke: none; }
.download-icon-button .is-indeterminate { animation: download-turn 1.2s linear infinite; }
@keyframes download-turn { to { transform: rotate(360deg); } }
.practice-card .practice-copy { padding-right: 28px; }
.lesson-download-row { position: relative; }
.lesson-download-row + .lesson-download-row { margin-top: 9px; }
.lesson-download-row .lesson-list-card h3 { padding-right: 28px; }
.download-feedback {
  position: absolute;
  z-index: 60;
  top: calc(12px + var(--safe-area-top));
  left: 15px;
  right: 15px;
  margin: 0;
  padding: 12px;
  border: 1px solid #e4e8e5;
  border-radius: 8px;
  background: #fff;
  color: #36564a;
  font-size: 13px;
  box-shadow: 0 3px 12px #0000000d;
}

.player-spacer {
  min-height: 22px;
  flex: 1 1 auto;
}

.player-author {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  margin: 10px 0 0;
}

.player-author-avatar {
  --author-skin: #c79c83;
  --author-hair: #5e564d;
  --author-shirt: #809788;
  --author-background: #c4d0c5;
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--author-background);
  box-shadow: 0 3px 10px rgba(52, 60, 52, 0.12);
}

.player-author-portrait-shape {
  position: absolute;
  inset: -10px;
  display: block;
  filter: blur(6px);
  background:
    radial-gradient(ellipse at 50% 39%, var(--author-skin) 0 18%, transparent 19%),
    radial-gradient(ellipse at 50% 29%, var(--author-hair) 0 27%, transparent 28%),
    radial-gradient(ellipse at 50% 91%, var(--author-shirt) 0 48%, transparent 49%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 45%),
    var(--author-background);
}

.player-author-avatar[data-player-author-portrait="jonah"] {
  --author-skin: #b88268;
  --author-hair: #3f443f;
  --author-shirt: #7b8b9a;
  --author-background: #c4ced2;
}

.player-author-avatar[data-player-author-portrait="leila"] {
  --author-skin: #d4aa8a;
  --author-hair: #484a43;
  --author-shirt: #aa927a;
  --author-background: #d8d0c2;
}

.player-author-avatar[data-player-author-portrait="amara"] {
  --author-skin: #9f705c;
  --author-hair: #303b36;
  --author-shirt: #a3846d;
  --author-background: #c8c2b5;
}

.player-author-avatar[data-player-author-portrait="noah"] {
  --author-skin: #ba8a70;
  --author-hair: #596055;
  --author-shirt: #617b74;
  --author-background: #b9c7c0;
}

.player-author-name {
  margin: 0;
  color: #b9b7b5;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.player-timeline {
  width: 100%;
}

.audio-scrubber {
  --scrub-progress: 0%;
  width: 100%;
  height: 32px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  touch-action: none;
  background: transparent;
}

.audio-scrubber::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    var(--action) 0,
    var(--action) var(--scrub-progress),
    #8f918f var(--scrub-progress),
    #8f918f 100%
  );
}

.audio-scrubber::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 99px;
  background: #8f918f;
}

.audio-scrubber::-moz-range-progress {
  height: 3px;
  border-radius: 99px;
  background: var(--action);
}

.audio-scrubber::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--action);
  box-shadow: 0 1px 4px rgba(50, 65, 58, 0.25);
}

.audio-scrubber::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  background: var(--action);
  box-shadow: 0 1px 4px rgba(50, 65, 58, 0.25);
}

.audio-scrubber:focus-visible {
  outline-offset: 1px;
}

.player-time {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 5px 0 8px;
  color: #171717;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.player-time .time-left {
  color: #5f5e5c;
  font-size: 12px;
  text-align: center;
}

.player-time .remaining-time {
  text-align: right;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 37px;
  margin-top: clamp(26px, 5vh, 47px);
}

.jump-button,
.player-play-button {
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.jump-button {
  width: 52px;
  height: 52px;
  color: #7b7b79;
  background: transparent;
}

.jump-control {
  position: relative;
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
}

.jump-control .jump-icon {
  position: absolute;
  width: 45px;
  height: 45px;
  overflow: visible;
}

.jump-arrow {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.jump-value {
  fill: currentColor;
  stroke: none;
  font-size: 12px;
  font-weight: 700;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jump-loop-center {
  fill: none;
  stroke: none;
}

.player-play-button {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: #fff;
  background: var(--action);
  transition: transform 160ms ease;
}

.player-play-button:active {
  transform: scale(0.96);
}

.player-play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid currentColor;
}

.player-play-button.is-playing .player-play-icon {
  width: 16px;
  height: 21px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 34%, transparent 34% 66%, currentColor 66% 100%);
}

@media (max-height: 760px) {
  .player-page {
    padding-bottom: calc(20px + var(--safe-area-bottom));
  }

  .player-artwork-wrap {
    margin-top: 18px;
  }

  .player-spacer {
    min-height: 14px;
  }

  .player-author {
    margin-bottom: 12px;
  }

  .player-author-avatar {
    width: 48px;
    height: 48px;
  }

  .player-controls {
    margin-top: 18px;
  }
}

@media (max-width: 420px) {
  .progress-summary {
    gap: 14px;
  }

  .progress-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .day-card {
    width: 66px;
    min-width: 66px;
  }

  .journal-card h2 {
    font-size: 17px;
  }

  .nav-item {
    font-size: 10.5px;
  }
}

@media (max-width: 355px) {
  .home-page {
    padding-inline: 12px;
  }

  .progress-summary {
    gap: 14px;
  }

  .progress-item {
    gap: 7px;
  }

  .progress-copy strong {
    font-size: 16px;
  }

  .progress-copy span {
    font-size: 11.5px;
  }

  .day-picker {
    margin-right: -12px;
    margin-left: 0;
    padding-right: 12px;
    padding-left: 0;
  }

  .bottom-nav {
    padding-inline: 9px;
  }

  .nav-item {
    min-width: 42px;
    font-size: 9.5px;
  }
}

.connection-notice {
  position: absolute;
  z-index: 20;
  top: var(--safe-area-top);
  left: 0;
  right: 0;
  margin: 0;
  padding: 12px 15px;
  color: #42413f;
  background: #fff;
  font-size: 14px;
  line-height: 1.4;
}

.app-shell:has(.connection-notice:not([hidden])) .route-view {
  padding-top: calc(90px + var(--safe-area-top));
}

.is-player-open .connection-notice {
  display: none;
}

/* Keep the white canvas edge-to-edge, with controls inside the measured
   visible viewport rather than the sometimes taller iOS 100vh viewport. */
html.is-standalone body { min-height: 0; }
html.is-standalone .app-shell {
  position: fixed;
  inset: var(--installed-viewport-top, 0px) 0 auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: var(--installed-viewport-height, 100dvh);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
