:root {
  --page: #efeaf8;
  --sidebar: #e9e2f4;
  --card: #ffffff;
  --ink: #1a1740;
  --ink-soft: #6b6585;
  --coral: #ff6b5a;
  --coral-deep: #e85a4c;
  --violet: #6e5ae6;
  --violet-soft: #ece7ff;
  --peach: #ffd5c8;
  --gold: #f4c790;
  --line: #e4ddf2;
  --dock: #ffffff;
  --danger: #c44536;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 1.35rem;
  --radius-sm: 1rem;
  --shadow: 0 18px 50px rgba(28, 24, 64, 0.08);
  --dock-h: 9.5rem;
  --tab-h: 3.6rem;
  --sidebar-w: 16.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
}

html {
  background: var(--page);
  width: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
  width: 100%;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 0.6rem;
}

.skip:focus {
  top: 0.5rem;
}

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

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
}

.sidebar {
  background: var(--sidebar);
  padding: 1.15rem 1.1rem calc(var(--dock-h) + 0.45rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  border-right: 1px solid rgba(110, 90, 230, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.35rem;
  min-height: 44px;
}

.logo-mark {
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
}

.logo-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-mobile {
  display: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.side-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.85rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.side-nav a:hover,
.side-nav a.active {
  background: #fff;
  color: var(--violet);
}

.journey {
  margin-top: 0.15rem;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.journey-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.journey-title {
  margin: 0.25rem 0 0.1rem;
  font-size: 1rem;
  font-weight: 800;
}

.journey-meta {
  margin: 0 0 0.45rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journey-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.journey-steps button {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.2rem 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
}

.journey-steps button > span:last-child {
  min-width: 0;
}

.step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: #fff;
  color: var(--ink-soft);
  border: 2px solid var(--line);
}

.journey-steps button.active .step-num,
.journey-steps button[aria-current="step"] .step-num {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.step-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-sub {
  display: block;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[hidden] {
  display: none !important;
}

.cookie-pill {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.stage {
  min-width: 0;
  max-width: 100%;
  padding: 1rem 1.35rem calc(var(--dock-h) + 1.5rem);
}

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.6rem;
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--page);
  padding: 0.15rem 0;
}

.icon-link {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
}

.icon-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

.app {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.guided-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 0.7fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.1rem;
}

.page-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.page-title,
.work-title {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.work-composer {
  margin: 0.45rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.lede,
.blurb,
.page-sub,
.caption {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.btn-primary,
.btn-violet,
.btn-ghost,
.btn-text {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  font-weight: 800;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--coral);
  color: #fff;
  border: 0;
}

.btn-primary:hover {
  background: var(--coral-deep);
}

.btn-violet {
  background: #fff;
  color: var(--violet);
  border: 1.5px solid var(--violet);
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-text {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input:focus,
button:focus-visible,
a:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.landscape-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow);
}

.landscape {
  display: block;
  width: 100%;
  height: auto;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  min-width: 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card h2 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.wave {
  height: 3.2rem;
  display: flex;
  align-items: flex-end;
  gap: 0.28rem;
  margin: 0.4rem 0 0.7rem;
}

.wave span {
  display: block;
  width: 0.38rem;
  border-radius: 999px;
  background: var(--violet);
  opacity: 0.85;
}

.honest {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.chapter-list,
.work-list,
.track-list,
.master-list,
.shelf,
.folder-list,
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-list button,
.work-row,
.track-row,
.master-row,
.shelf-row,
.folder-list button,
.file-list button,
.composer-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem 0.75rem;
  align-items: center;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.1rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  min-width: 0;
  text-decoration: none;
}

.chapter-list button.active,
.track-row.playing .title,
.work-row.playing .title {
  color: var(--coral);
}

.folder-list button,
.file-list button {
  grid-template-columns: minmax(0, 1fr) auto;
}

.rank,
.kind-tag {
  font-weight: 800;
  color: var(--coral);
  font-size: 0.82rem;
}

.title {
  font-weight: 700;
  overflow-wrap: anywhere;
  min-width: 0;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.note-name {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.note-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink-soft);
  max-height: 14rem;
  overflow: auto;
}

.section-rule {
  margin: 1.6rem 0 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.composer-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.composer-index a,
.composer-card {
  display: block;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  box-shadow: var(--shadow);
  min-height: 44px;
  overflow-wrap: anywhere;
  min-width: 0;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.pick-card {
  display: grid;
  gap: 0.35rem;
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  min-height: 44px;
  min-width: 0;
}

.pick-card .who {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-journey {
  display: none;
}

.search-box,
.open-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin: 1rem 0;
}

input[type="search"],
input[type="url"],
input[type="email"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  outline: none;
}

.settings-block {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin: 0.85rem 0;
  box-shadow: var(--shadow);
  max-width: 40rem;
}

.settings-block h2 {
  font-size: 1.1rem;
  margin: 0 0 0.45rem;
}

.status {
  min-height: 1.2rem;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.status.error,
.empty.error {
  color: var(--danger);
}

.empty,
.error-panel {
  padding: 0.4rem 0;
  color: var(--ink-soft);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.crumbs button {
  background: none;
  border: 0;
  color: var(--violet);
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 0;
  min-height: 44px;
  cursor: pointer;
}

.mode-toggle {
  display: inline-flex;
  background: #fff;
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
  box-shadow: var(--shadow);
}

.mode-toggle button {
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.55rem 0.95rem;
  min-height: 44px;
  border-radius: 999px;
}

.mode-toggle button[aria-pressed="true"] {
  background: var(--coral);
  color: #fff;
}

.bottom-chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  max-width: 100%;
  overflow-x: clip;
  gap: 0;
}

.bottom-chrome > * {
  pointer-events: auto;
}

.tabbar {
  display: none;
}

.dock {
  background: var(--dock);
  color: var(--ink);
  padding: 0.7rem 1.1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 40px rgba(28, 24, 64, 0.08);
  max-width: 100%;
  overflow-x: clip;
}

.dock-inner {
  width: min(88rem, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  grid-template-areas:
    "art meta actions"
    "seek seek seek"
    "ctl ctl ctl";
  gap: 0.45rem 0.75rem;
  align-items: center;
  min-width: 0;
}

.dock-art {
  grid-area: art;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.85rem;
  overflow: hidden;
  background: linear-gradient(160deg, #f6e7ff, #ffd5c8);
}

.dock-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dock-meta {
  grid-area: meta;
  min-width: 0;
}

.now {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.seek-row {
  grid-area: seek;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.time {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  min-width: 2.4rem;
}

.time.end {
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--violet-soft);
  outline: none;
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--coral);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--coral);
  border: 0;
  border-radius: 50%;
}

.controls {
  grid-area: ctl;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
}

.controls-main,
.controls-opts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 0;
}

.controls-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin: 0.3rem 0.35rem;
}

.btn-ctl {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-ctl svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.btn-ctl.active,
.btn-toggle[aria-pressed="true"],
.btn-fav[aria-pressed="true"],
.btn-narration[aria-pressed="true"] {
  border-color: var(--coral);
  color: var(--coral);
}

.btn-fav[aria-pressed="true"] svg path {
  fill: currentColor;
}

.btn-play {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  border-radius: 50%;
}

.btn-narration {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--violet);
  background: var(--violet-soft);
  color: var(--violet);
  font: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-narration svg {
  width: 1.1rem;
  height: 1.1rem;
}

.mini-player {
  position: fixed;
  left: 50%;
  bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(140%);
  z-index: 9;
  display: none;
  align-items: center;
  gap: 0.65rem;
  width: min(32rem, calc(100% - 1.5rem));
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.mini-player.visible {
  display: flex;
  transform: translateX(-50%) translateY(0);
}

body.has-dock .stage {
  padding-bottom: calc(var(--dock-h) + 2rem);
}

body.has-mini .stage {
  padding-bottom: 5.5rem;
}

.modal {
  border: 1px solid var(--line);
  padding: 0;
  background: #fff;
  color: var(--ink);
  width: min(26rem, calc(100vw - 2rem));
  border-radius: var(--radius);
}

.modal::backdrop {
  background: rgba(26, 23, 64, 0.35);
}

.modal-card {
  padding: 1.35rem;
  display: grid;
  gap: 0.7rem;
}

.modal-title {
  margin: 0;
  font-weight: 800;
}

.modal-copy,
.modal-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .logo-mobile {
    display: flex;
    margin-right: auto;
  }

  .guided-head,
  .card-row,
  .composer-index {
    grid-template-columns: minmax(0, 1fr);
  }

  .guided-head .blurb,
  .guided-head .muted,
  .guided-home .blurb,
  .guided-home .muted {
    display: none;
  }

  body[data-view="work"] .mode-toggle,
  body[data-view="discover"] .mode-toggle {
    display: none;
  }

  .landscape-wrap {
    width: 100%;
    height: 8.5rem;
    max-height: 8.5rem;
  }

  .landscape-wrap .landscape {
    width: 100%;
    height: 100%;
  }

  .work-title {
    font-size: 1.35rem;
  }

  .work-composer {
    font-size: 0.92rem;
  }

  .hero-actions {
    margin-top: 0.55rem;
  }

  .page-kicker {
    margin-bottom: 0.2rem;
  }

  .mobile-journey {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .mobile-journey button {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: #fff;
    font: inherit;
    font-weight: 800;
    color: var(--ink-soft);
    cursor: pointer;
  }

  .mobile-journey button.active {
    background: var(--coral);
    border-color: var(--coral);
    color: #fff;
  }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 1;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 0.3rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-align: center;
    max-width: 100%;
  }

  .tabbar a {
    color: var(--ink-soft);
    text-decoration: none;
    padding: 0.65rem 0.15rem;
    min-height: 44px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .tabbar a.active {
    color: var(--coral);
  }

  .dock {
    order: 2;
    padding: 0.45rem 0.7rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }

  :root {
    --dock-h: 11.5rem;
  }

  .stage {
    padding: 0.55rem 0.85rem calc(var(--tab-h) + var(--dock-h) + 1.1rem);
  }

  body.has-dock .stage {
    padding-bottom: calc(var(--dock-h) + var(--tab-h) + 1.1rem);
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "main main"
      "narr opts";
    justify-items: center;
    column-gap: 0.35rem;
    row-gap: 0.15rem;
  }

  .controls-main {
    grid-area: main;
    gap: 0.16rem;
  }

  .btn-narration {
    grid-area: narr;
    justify-self: end;
  }

  .controls-sep {
    display: none;
  }

  .controls-opts {
    grid-area: opts;
    justify-self: start;
    gap: 0.16rem;
  }

  .btn-ctl {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .search-box,
  .open-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .mini-player {
    bottom: calc(var(--tab-h) + 0.75rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .tabbar {
    font-size: 0.62rem;
  }

  .work-title {
    font-size: 1.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
