:root {
  --paper: #fff0df;
  --card: #fff7eb;
  --ink: #624332;
  --muted: #96725d;
  --green: #ad613b;
  --line: #efd9c2;
  --gold: #dda45e;
  --soft: #f9e4cb;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft Yahei', sans-serif;
  color: var(--ink);
  background: #f3d5b4;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #b78b36;
  outline-offset: 4px;
}
button:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
a {
  color: inherit;
}
svg {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 18px;
}
small {
  font-size: 12px;
  color: var(--muted);
}
.app {
  position: relative;
  background: var(--paper);
  max-width: 460px;
  height: 100dvh;
  margin-left: calc(50% - 20px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 100px #29433316;
  overflow: hidden;
}
main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 22px 24px 28px;
}
main::-webkit-scrollbar {
  display: none;
}
.desktop-brand {
  position: fixed;
  right: calc(50% + 110px);
  top: calc(50% - 225px);
  width: 270px;
}
.brand-mark {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 22px;
}
.desktop-brand > p {
  font-size: 10px;
  letter-spacing: 2px;
  margin: 20px 0 30px;
}
.desktop-brand h1 {
  font:
    36px/1.6 'Songti SC',
    serif;
  letter-spacing: 2px;
  font-weight: 600;
}
.desktop-brand .brand-note {
  font-size: 14px;
  line-height: 2.1;
  letter-spacing: 1px;
  margin: 25px 0;
  color: #809080;
}
.brand-line {
  height: 1px;
  width: 45px;
  background: #c1cdbb;
  margin: 35px 0 20px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.wordmark {
  display: flex;
  gap: 9px;
  align-items: center;
}
.nest-logo {
  background: #f5e7ce url('brand-icon-180.png?v=bookshelf-1') center / cover;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: block;
}
.wordmark strong {
  font-size: 13px;
  display: block;
  letter-spacing: 0.5px;
}
.wordmark small {
  font-size: 8px;
  letter-spacing: 1.8px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e7d9b9;
  display: grid;
  place-items: center;
  color: #6c694c;
  border: 3px solid #fff7eb;
}
.avatar svg {
  width: 23px;
  height: 23px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #86917e;
  font-weight: 650;
}
.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}
.heading h2 {
  margin-top: 5px;
  font-weight: 650;
}
.pill {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid #e9cdb2;
  border-radius: 20px;
  color: #6e806b;
  white-space: nowrap;
}
.cover {
  position: relative;
  border-radius: 19px;
  overflow: hidden;
  background: #eee;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero {
  height: 275px;
  border-radius: 23px;
  box-shadow: 0 13px 25px #57603919;
}
.hero img {
  object-position: 50% 54%;
}
.cover::after {
  content: '';
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(transparent, #253c3550);
  pointer-events: none;
}
.hero-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  background: #fff9e9e6;
  backdrop-filter: blur(12px);
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  color: #465644;
}
.cover-caption {
  position: absolute;
  bottom: 18px;
  left: 19px;
  color: #fff7df;
  z-index: 1;
  font: italic 23px Georgia;
}
.cover-caption small {
  display: block;
  color: #ffffffe0;
  font: 9px/2 sans-serif;
  letter-spacing: 2px;
}
.track-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 23px 0 17px;
  gap: 10px;
}
.track-heading h2 {
  font-size: 22px;
  letter-spacing: 0.1px;
  margin-bottom: 6px;
}
.track-heading p {
  font-size: 12px;
  color: var(--muted);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
}
.favorite.active {
  color: #b9804d;
  background: #f5ead8;
}
.favorite.active svg {
  fill: #b9804d22;
}
.progress input {
  display: block;
  width: 100%;
  margin: 0;
  accent-color: var(--green);
  height: 15px;
  cursor: pointer;
}
.times {
  display: flex;
  justify-content: space-between;
  color: #949b91;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 5px 22px;
}
.control-side {
  font-size: 12px;
  color: #788375;
  min-width: 36px;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.control-side svg {
  width: 21px;
  height: 21px;
}
.skip svg {
  width: 26px;
  height: 26px;
}
.play-main {
  width: 81px;
  height: 65px;
  background: var(--green);
  border-radius: 24px;
  color: #fff;
  box-shadow: 0 8px 16px #264e4229;
  display: grid;
  place-items: center;
}
.play-main svg {
  width: 30px;
  height: 30px;
}
.play-label {
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: -10px;
}
.collection-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  background: #f8e2cb;
  border-radius: 16px;
  text-align: left;
}
.collection-link img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}
.collection-link strong {
  font-size: 13px;
  display: block;
  margin-bottom: 5px;
}
.collection-link small {
  font-size: 12px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 14px;
}
.section-head h3 {
  font-size: 16px;
}
.text-link {
  font-size: 12px;
  color: #7c8879;
  display: flex;
  gap: 3px;
  align-items: center;
}
.text-link svg {
  width: 14px;
  height: 14px;
}
.next-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.next-card {
  width: calc((100% - 20px) / 3);
  flex: none;
  text-align: left;
}
.next-card .cover {
  aspect-ratio: 1.2;
  border-radius: 12px;
}
.next-card strong {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 7px;
}
.next-card small {
  font-size: 12px;
}
.footer-note {
  text-align: center;
  color: #a0a69b;
  font-size: 12px;
  letter-spacing: 2px;
  margin-top: 28px;
}
nav {
  flex: none;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #fff1e0f5;
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 8px 16px max(13px, env(safe-area-inset-bottom));
  z-index: 4;
}
nav > button {
  width: 85px;
  display: grid;
  justify-items: center;
  gap: 5px;
  font-size: 12px;
  color: #8a9589;
}
nav > button.active {
  color: var(--green);
  font-weight: 650;
}
.nav-play {
  width: 47px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 8px #244d4220;
}
nav svg {
  width: 22px;
  height: 22px;
}
.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: #f9e3cc;
  border-top: 1px solid #efd6bd;
}
.mini img {
  height: 37px;
  width: 37px;
  border-radius: 9px;
  object-fit: cover;
}
.mini .grow {
  text-align: left;
}
.mini strong {
  font-size: 12px;
  display: block;
  margin-bottom: 3px;
}
.mini small {
  font-size: 12px;
}
.mini .icon-button {
  height: 32px;
  width: 32px;
  color: var(--green);
}
.search {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 14px;
  background: #f8e2cc;
  border-radius: 13px;
  margin: 20px 0;
}
.search svg {
  width: 18px;
  height: 18px;
  color: #9a9e91;
}
.search input {
  background: transparent;
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 12px;
  color: var(--ink);
}
.search input::placeholder {
  color: #9a9e91;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.chip {
  border: 1px solid #e9cdb2;
  color: #7a8777;
  font-size: 12px;
  padding: 8px 13px;
  border-radius: 10px;
  white-space: nowrap;
}
.chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.library-banner {
  height: 128px;
  position: relative;
  border-radius: 17px;
  background: #f5d9b6;
  margin: 20px 0 4px;
  padding: 22px;
  overflow: hidden;
}
.library-banner img {
  position: absolute;
  width: 180px;
  right: -14px;
  top: -15px;
  opacity: 0.92;
  mask-image: linear-gradient(90deg, transparent, #000 30%);
}
.library-banner p {
  position: relative;
  font-size: 12px;
  letter-spacing: 2px;
  color: #6b7c5b;
}
.library-banner h3 {
  font:
    22px/1.5 'Songti SC',
    serif;
  position: relative;
  margin: 6px 0;
}
.library-banner small {
  position: relative;
  font-size: 12px;
  color: #718069;
}
.stage-number {
  font: italic 20px Georgia;
  color: #a4ae94;
  margin-right: 8px;
}
.stage-sub {
  font-size: 12px;
  color: #9b9f92;
  margin-top: 5px;
}
.shelf {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px 13px;
}
.book {
  text-align: left;
  min-width: 0;
}
.book .cover {
  aspect-ratio: 0.95;
  border-radius: 14px;
}
.book strong {
  font-size: 13px;
  display: block;
  margin: 10px 0 5px;
}
.book small {
  font-size: 12px;
}
.book-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 12px;
  background: #fffef4dd;
  padding: 5px 7px;
  border-radius: 6px;
  z-index: 1;
}
.shelf.horizontal {
  display: flex;
  overflow-x: auto;
  margin-right: -24px;
  padding-right: 24px;
  scrollbar-width: none;
}
.shelf.horizontal .book {
  width: 142px;
  flex: none;
}
.top-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.back {
  display: flex;
  align-items: center;
  font-size: 12px;
  gap: 5px;
}
.back svg {
  width: 17px;
}
.album-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0 20px;
}
.album-hero .cover {
  width: 134px;
  height: 150px;
  flex: none;
}
.album-hero h2 {
  font-size: 23px;
  line-height: 1.45;
  margin: 8px 0;
}
.album-hero p {
  font-size: 12px;
  color: #7f8b7d;
  line-height: 1.8;
}
.album-description {
  font-size: 12px;
  color: #899183;
  line-height: 1.9;
  margin: 18px 0;
}
.primary {
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 15px 20px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
}
.primary svg {
  width: 18px;
}
.secondary {
  background: #f5dfc8;
  color: var(--green);
  font-size: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  width: 100%;
}
.view-toggle {
  display: flex;
  background: #f5dfc8;
  border-radius: 8px;
  padding: 3px;
}
.view-toggle button {
  padding: 4px 7px;
  border-radius: 5px;
  color: #87927f;
}
.view-toggle button.active {
  background: #fff5e5;
  color: var(--green);
  box-shadow: 0 1px 3px #0001;
}
.view-toggle svg {
  width: 16px;
  height: 16px;
}
.episode-list {
  display: grid;
  gap: 3px;
}
.episode-row {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.episode-row img {
  width: 49px;
  height: 49px;
  object-fit: cover;
  border-radius: 10px;
}
.episode-row .number {
  font-size: 12px;
  color: #a3aa9c;
  min-width: 15px;
}
.episode-row .episode-name {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}
.episode-row small {
  font-size: 12px;
}
.episode-row button.grow {
  text-align: left;
}
.episode-row.current .episode-name {
  color: #a35d37;
  font-weight: 600;
}
.episode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 12px;
}
.episode-tile {
  text-align: left;
}
.episode-tile .cover {
  height: 130px;
}
.episode-tile strong {
  font-size: 12px;
  display: block;
  margin: 8px 0 5px;
}
.episode-tile small {
  font-size: 12px;
}
.profile-card {
  background: #f7ddbd;
  border-radius: 20px;
  padding: 21px;
  display: flex;
  gap: 17px;
  align-items: center;
  margin: 24px 0;
}
.profile-card .avatar {
  width: 64px;
  height: 64px;
  background: #edc79d;
  border: 4px solid #fff0dc;
}
.profile-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.profile-card small {
  color: #78876c;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 23px 0 30px;
  text-align: center;
}
.stats strong {
  display: block;
  font: 25px Georgia;
  color: #9a5c38;
}
.stats small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
}
.setting-card {
  background: var(--card);
  border: 1px solid #f0dcc6;
  border-radius: 17px;
  padding: 0 16px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  text-align: left;
  border-bottom: 1px solid #f1dfcd;
}
.setting-row:last-child {
  border: 0;
}
.setting-row > svg {
  color: #819175;
  width: 20px;
}
.setting-row strong {
  font-size: 12px;
  display: block;
  font-weight: 500;
}
.setting-row small {
  display: block;
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.5;
}
.setting-value {
  font-size: 12px;
  color: #819175;
  display: flex;
  align-items: center;
  gap: 3px;
}
.setting-value svg {
  width: 14px;
}
.switch {
  width: 39px;
  height: 23px;
  background: #ddc4ad;
  border-radius: 20px;
  position: relative;
  flex: none;
}
.switch:before {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.switch.on {
  background: var(--green);
}
.switch.on:before {
  transform: translateX(16px);
}
.helper {
  font-size: 12px;
  line-height: 1.8;
  color: #98a08d;
  margin: 11px 8px 0;
}
.quote {
  margin: 30px 0 0;
  text-align: center;
  font:
    16px/1.8 'Songti SC',
    serif;
  color: #9ba68b;
}
.quote small {
  display: block;
  letter-spacing: 2px;
  font: 9px/3 sans-serif;
}
dialog {
  border: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(460px, 100%);
  max-width: 100%;
  max-height: 85dvh;
  position: fixed;
  top: auto;
  bottom: 0;
  left: auto;
  right: calc(50% - 440px);
  margin: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 100px #203b3222;
  overflow: auto;
}
dialog::backdrop {
  background: #51342666;
  backdrop-filter: blur(3px);
}
#sheet-content {
  padding: 12px 24px 30px;
}
.handle {
  width: 32px;
  height: 4px;
  background: #dfbea0;
  border-radius: 5px;
  margin: 0 auto 16px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sheet-head h2 {
  font-size: 20px;
}
.sheet-head svg {
  width: 19px;
}
.sheet-desc {
  font-size: 12px;
  color: #899481;
  line-height: 1.9;
  margin-bottom: 18px;
}
.queue-options {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.queue-options button {
  background: #f5dec4;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}
.check {
  width: 21px;
  height: 21px;
  border: 1px solid #d9b697;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
}
.check.checked {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.check svg {
  width: 15px;
  height: 15px;
}
.queue-list {
  max-height: 34vh;
  overflow: auto;
  margin-bottom: 16px;
}
.sheet-footer {
  position: sticky;
  bottom: -30px;
  background: var(--paper);
  padding: 15px 0 0;
  margin-top: 16px;
}
.field {
  display: block;
  margin: 22px 0;
}
.field span {
  display: block;
  font-size: 12px;
  margin-bottom: 10px;
}
.field input {
  width: 100%;
  padding: 13px;
  border: 1px solid #e9cdb2;
  border-radius: 11px;
  background: #fff7eb;
  color: var(--ink);
}
.stage-option {
  display: flex;
  text-align: left;
  gap: 13px;
  width: 100%;
  padding: 17px 13px;
  margin: 10px 0;
  border: 1px solid #e9cdb2;
  border-radius: 14px;
}
.stage-option.active {
  border-color: #bb7950;
  background: #f9e2c7;
}
.stage-option strong {
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
}
.stage-option small {
  font-size: 12px;
}
.stage-option .stage-number {
  margin-top: 3px;
}
.empty {
  padding: 60px 10px;
  text-align: center;
  font-size: 13px;
  color: #939e88;
  line-height: 2;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: #754b32ee;
  color: white;
  font-size: 12px;
  border-radius: 12px;
  padding: 13px 20px;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 90%;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
}
.playing-indicator {
  display: inline-flex;
  gap: 2px;
  height: 12px;
  align-items: end;
}
.playing-indicator i {
  width: 2px;
  background: var(--green);
  height: 7px;
  animation: wave 0.8s infinite alternate;
}
.playing-indicator i:nth-child(2) {
  height: 12px;
  animation-delay: -0.3s;
}
.playing-indicator i:nth-child(3) {
  height: 5px;
  animation-delay: -0.5s;
}
@keyframes wave {
  to {
    height: 3px;
  }
}
@media (min-width: 900px) {
  .app {
    height: min(960px, 100dvh);
    margin-top: max(0px, calc((100dvh - 960px) / 2));
    border-left: 1px solid #dfe4d6;
    border-right: 1px solid #dfe4d6;
  }
}
@media (max-width: 800px) {
  .desktop-brand {
    display: none;
  }
  .app {
    margin: 0 auto;
    max-width: 500px;
  }
  dialog {
    right: 0;
    left: 0;
    margin: 0 auto;
    width: min(500px, 100%);
  }
  main {
    padding-top: max(20px, env(safe-area-inset-top));
  }
}
@media (max-width: 370px) {
  main {
    padding-left: 18px;
    padding-right: 18px;
  }
  .hero {
    height: 235px;
  }
  .track-heading h2 {
    font-size: 20px;
  }
  .controls {
    margin-left: 0;
    margin-right: 0;
  }
  .shelf.horizontal .book {
    width: 130px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 420px) {
  .library-banner img {
    width: 135px;
    top: 0;
    right: -15px;
    opacity: 0.7;
    mask-image: linear-gradient(90deg, transparent, #000 60%);
  }
  .library-banner h3 {
    font-size: 19px;
  }
  .library-banner {
    padding: 22px 18px;
  }
  .library-banner p {
    font-size: 12px;
  }
}

/* A softly lit little nest: apricot paper, honey light and warm wood. */
:root {
  background:
    radial-gradient(ellipse at 24% 20%, #fff0cc 0, transparent 52%),
    linear-gradient(140deg, #f8e4cb, #efcda9);
}
.app {
  background:
    radial-gradient(ellipse at 90% 0, #ffe1af88, transparent 48%),
    linear-gradient(180deg, #ffecd5, #fff2e3 65%, #fce8d2);
  box-shadow: 0 18px 100px #97603c22;
}
.desktop-brand .brand-note,
.eyebrow,
.pill,
.text-link,
.control-side,
.profile-card small,
.stats small,
.setting-value,
.setting-row > svg,
.quote,
.helper,
.sheet-desc,
.album-description,
.album-hero p,
.stage-sub {
  color: #99745b;
}
.brand-line {
  background: #d8b48e;
}
.cover {
  background: #f3dabe;
}
.hero {
  box-shadow: 0 13px 28px #bc825527;
}
.hero-badge {
  background: #fff0dce8;
  color: #805738;
}
.play-main,
.nav-play {
  box-shadow: 0 6px 18px #b2733c30;
}
.chip {
  color: #926a50;
}
.chip.active {
  color: #fff7ed;
}
.library-banner p,
.library-banner small {
  color: #916948;
}
.stage-number {
  color: #bc8c60;
}
.profile-card .avatar {
  color: #98603e;
}
.search svg,
.search input::placeholder {
  color: #a5846d;
}
nav > button {
  color: #a78670;
}
.times,
.footer-note {
  color: #a88973;
}
.view-toggle button {
  color: #a5846d;
}
.check:not(.checked) {
  background: #fff4e6;
  color: transparent;
}
.check:not(.checked) svg {
  display: none;
}
.queue-options button[aria-pressed='true'] {
  background: var(--green);
  color: #fff7ed;
}

/* Readable inputs prevent iOS focus zoom while preserving pinch-to-zoom. */
.search input,
.field input {
  font-size: 16px;
  line-height: 1.4;
  min-width: 0;
}
.search {
  min-height: 48px;
}
.search svg {
  flex: none;
}
.listening-note {
  margin: 26px 0 0;
  padding: 18px 14px;
  text-align: center;
  background: #f8dfc4;
  border-radius: 15px;
}
.listening-note strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #815438;
  margin-bottom: 7px;
}
.listening-note p {
  font-size: 12px;
  line-height: 1.9;
  color: #93694c;
}

:where(.stage-band, .stage-option, .pill, .chip) {
  --stage-start: #f6ce97;
  --stage-end: #efb66f;
  --stage-ink: #684025;
  --stage-detail: #765036;
  --stage-accent: #b3733e;
}
[data-edition='primary'] :where(.stage-band, .stage-option, .pill, .chip) {
  --stage-start: #d4eafa;
  --stage-end: #b6d8f0;
  --stage-ink: #376b93;
  --stage-detail: #376b93;
  --stage-accent: #376b93;
}
/* Each stage has its own progressively deeper orange band. */
.stage-1 {
  --stage-start: #f6ce97;
  --stage-end: #efb66f;
  --stage-ink: #684025;
  --stage-detail: #765036;
  --stage-accent: #b3733e;
}
.stage-2 {
  --stage-start: #ecac69;
  --stage-end: #df8c48;
  --stage-ink: #57321d;
  --stage-detail: #653b23;
  --stage-accent: #945026;
}
.stage-3 {
  --stage-start: #ac6037;
  --stage-end: #92472a;
  --stage-ink: #fff6e9;
  --stage-detail: #ffead5;
  --stage-accent: #ffdbb3;
}
.stage-4 {
  --stage-start: #824528;
  --stage-end: #67311f;
  --stage-ink: #fff6e9;
  --stage-detail: #ffead5;
  --stage-accent: #ffdbb3;
}
.stage-band {
  background: linear-gradient(110deg, var(--stage-start), var(--stage-end));
  padding: 15px 14px;
  border-radius: 14px;
  gap: 10px;
  box-shadow: 0 5px 14px #ae6c2d0d;
  color: var(--stage-ink);
}
.stage-band h3 {
  font-size: 15px;
  line-height: 1.5;
}
.stage-band .stage-number {
  color: var(--stage-ink);
  font-size: 19px;
}
.stage-band .stage-sub {
  color: var(--stage-detail);
  line-height: 1.6;
}
.stage-band .text-link {
  color: var(--stage-ink);
  flex: none;
  min-height: 40px;
}
.chip[class*='stage-'] {
  background: linear-gradient(110deg, var(--stage-start), var(--stage-end));
  color: var(--stage-ink);
  border-color: transparent;
}
.chip[class*='stage-'].active {
  border-color: var(--stage-ink);
  box-shadow: inset 0 0 0 1px var(--stage-ink);
}
.pill[class*='stage-'],
.hero-badge[class*='stage-'] {
  background: linear-gradient(110deg, var(--stage-start), var(--stage-end));
  color: var(--stage-ink);
  border-color: transparent;
}
.stage-option[class*='stage-'] {
  background: linear-gradient(110deg, var(--stage-start), var(--stage-end));
  color: var(--stage-ink);
  border: 2px solid transparent;
}
.stage-option[class*='stage-'].active {
  border-color: var(--stage-ink);
}
.stage-option[class*='stage-'] .stage-number {
  color: var(--stage-ink);
}
.stage-option[class*='stage-'] small {
  color: var(--stage-detail);
}
.stage-option .grow {
  min-width: 0;
}
.stage-option small {
  display: block;
  line-height: 1.7;
}
.stage-option small + small {
  margin-top: 4px;
}
.stage-empty {
  padding: 24px 14px;
  margin: 0 0 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  text-align: center;
}

/* Compact playback controls share the episode selection sheet. */
.sheet-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.queue-head {
  gap: 8px;
}
.queue-head h2 {
  font-size: 18px;
  line-height: 1.4;
  white-space: nowrap;
}
.queue-head .sheet-actions > .icon-button {
  width: 32px;
  height: 40px;
}
.mode-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f5dfc8;
  border-radius: 12px;
}
.mode-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  color: #967052;
}
.mode-icon svg {
  width: 21px;
  height: 21px;
}
.mode-icon[aria-pressed='true'] {
  background: var(--green);
  color: #fff7ed;
  box-shadow: 0 2px 5px #9a613326;
}
.mode-icon:focus-visible {
  outline-offset: 1px;
}
@media (max-width: 370px) {
  .queue-head h2 {
    font-size: 16px;
  }
  .queue-head {
    gap: 4px;
  }
  .sheet-actions {
    gap: 3px;
  }
  .mode-icon {
    width: 36px;
  }
  .queue-options {
    gap: 4px;
  }
  .queue-options button {
    padding: 8px 8px;
    white-space: nowrap;
  }
}
.controls .control-side {
  min-width: 48px;
  min-height: 44px;
}

/* Listening is the default; selecting episodes is an explicit edit mode. */
.queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0;
}
.queue-summary .sheet-desc {
  margin: 0;
  font-size: 12px;
}
.queue-edit {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  min-width: 48px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f5dfc8;
  flex: none;
}
.queue-hint {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 5px 0 18px;
}
.queue-list.is-playing {
  max-height: 46dvh;
  display: grid;
  gap: 5px;
  margin-bottom: 0;
}
.queue-track {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 12px 10px;
  border-radius: 13px;
  min-height: 76px;
  border: 1px solid transparent;
}
.queue-track .number {
  font-size: 12px;
  color: #9d7b62;
  min-width: 17px;
}
.queue-track img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
}
.queue-track strong {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  margin-bottom: 5px;
}
.queue-track small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
}
.queue-track-state {
  display: grid;
  place-items: center;
  width: 27px;
  height: 30px;
  flex: none;
  color: #a47a5d;
}
.queue-track-state > svg {
  width: 18px;
  height: 18px;
}
.queue-track.current {
  background: #f1cda5;
  border-color: #ddb187;
}
.queue-track.current strong {
  font-weight: 650;
  color: #744226;
}
.queue-track.current small,
.queue-track.current .number {
  color: #8a5634;
}
.queue-track.current .queue-track-state {
  color: #99512c;
}
.queue-track .playing-indicator {
  height: 19px;
  gap: 3px;
}
.queue-track .playing-indicator i {
  width: 3px;
  background: currentColor;
  height: 11px;
}
.queue-track .playing-indicator i:nth-child(2) {
  height: 18px;
}
.queue-track .playing-indicator i:nth-child(3) {
  height: 8px;
}
.queue-list.is-editing .episode-row {
  padding-inline: 12px;
}
.queue-list.is-editing .episode-row.current {
  background: #f7ddbd;
  border-radius: 10px;
}

/* Keep dialog auto-focus off the mode buttons; keyboard focus remains visible. */
.queue-head h2:focus {
  outline: none;
}
.mode-icon:focus:not(:focus-visible) {
  outline: none;
}
.daily-sentence {
  position: relative;
  margin: 20px 0 4px;
  padding: 21px 20px 18px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 95% 0%, #ffe9bb 0, transparent 65%),
    linear-gradient(135deg, #fbe4c7, #f6d4ae);
  border: 1px solid #edc8a2;
  overflow: hidden;
}
.sentence-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sentence-eyebrow {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #a16b43;
  margin-bottom: 7px;
  line-height: 1.6;
}
.sentence-heading h3 {
  font-size: 19px;
  color: #805035;
}
.sentence-heading time {
  font-size: 12px;
  color: #966746;
  white-space: nowrap;
  background: #fff4df99;
  border-radius: 20px;
  padding: 7px 9px;
}
.sentence-dialogue {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  position: relative;
}
.sentence-dialogue p {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 19px;
  line-height: 1.5;
  color: #75482e;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sentence-dialogue p > span {
  font-size: 12px;
  flex: none;
  display: grid;
  place-items: center;
  background: #f2cfab;
  color: #a16b43;
  border-radius: 7px;
  min-width: 23px;
  height: 23px;
  align-self: flex-start;
  margin-top: 3px;
}
.sentence-dialogue .sentence-answer {
  color: #9a6038;
  font-weight: 500;
  padding-left: 19px;
}
.sentence-dialogue .sentence-answer > span {
  background: #fff0d8;
}
.sentence-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sentence-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--green);
  color: #fff4e6;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 600;
}
.sentence-play svg {
  width: 17px;
  height: 17px;
}
.sentence-play:disabled {
  opacity: 1;
  background: #ead0b2;
  color: #956c50;
}
.sentence-repeat {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px;
  min-height: 42px;
  border-radius: 11px;
  font-size: 12px;
  color: #926d52;
  flex: none;
}
.sentence-repeat svg {
  width: 18px;
  height: 18px;
}
.sentence-repeat[aria-pressed='true'] {
  background: #fff1da;
  color: #a45b31;
}
.sentence-repeat:disabled {
  opacity: 0.5;
}
.sentence-note {
  font-size: 12px;
  line-height: 1.7;
  color: #a07758;
  margin-top: 13px;
}
@media (max-width: 370px) {
  .daily-sentence {
    padding: 18px 16px;
  }
  .sentence-dialogue p {
    font-size: 17px;
  }
  .sentence-eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .sentence-heading time {
    font-size: 12px;
    padding: 6px 7px;
  }
}

/* Mini player describes and controls the same source as the global play button. */
.mini-sentence-art {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 9px;
  background: #f1cfaa;
  color: #92552f;
  font: 600 17px Georgia;
}
.mini .grow strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mini .icon-button[aria-pressed='true'] {
  background: #f0cda8;
}

/* Original book frames stay fully visible and follow the audio clock. */
.support-hero {
  position: relative;
  padding: 26px 23px;
  border-radius: 21px;
  background: linear-gradient(135deg, #f6d8ad, #f9e7c9);
  margin: 6px 0 23px;
  overflow: hidden;
}
.support-hero .support-mark {
  position: absolute;
  right: 19px;
  top: 21px;
  transform: rotate(-8deg);
  background: #fff1d6a6;
}
.support-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: #f3dbb9;
  color: #b17848;
}
.support-mark svg {
  width: 29px;
  height: 29px;
}
.support-hero .eyebrow {
  font-size: 9px;
  color: #ad7c4f;
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.support-hero h2 {
  font-size: 22px;
  max-width: 210px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.support-hero > p:last-child {
  font-size: 12px;
  color: #a07955;
  line-height: 1.9;
}
.support-search {
  margin-bottom: 13px;
}
.support-search input {
  font-size: 16px;
}
.faq-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -24px 20px;
  padding: 0 24px;
  scrollbar-width: none;
}
.faq-categories button {
  flex: none;
  padding: 8px 13px;
  border-radius: 15px;
  font-size: 12px;
  background: #f7e2c9;
  color: #a27653;
}
.faq-categories button[aria-pressed='true'] {
  background: #ab673f;
  color: #fff3df;
}
.faq-list {
  border: 1px solid #eed8bd;
  border-radius: 16px;
  overflow: hidden;
  background: #fff6e6;
}
.faq-list > button {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px;
  border-bottom: 1px solid #f0dec8;
}
.faq-list > button:last-child {
  border: 0;
}
.faq-list small {
  font-size: 12px;
  color: #b49473;
  display: block;
  margin-bottom: 6px;
}
.faq-list strong {
  font-size: 12px;
  line-height: 1.7;
  display: block;
  font-weight: 550;
}
.faq-list svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: #b18c67;
}
.support-human {
  margin: 25px 0 5px;
  border-radius: 17px;
  padding: 20px;
  background: #f4dfc2;
  display: grid;
  grid-template-columns: 37px 1fr;
  gap: 12px;
}
.support-small-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: #b0784d;
  background: #fff0d7;
  border-radius: 12px;
}
.support-human h3 {
  font-size: 14px;
  margin-bottom: 6px;
}
.support-human p {
  font-size: 12px;
  color: #a3805d;
  line-height: 1.7;
}
.support-human .primary {
  grid-column: 1/-1;
  margin-top: 4px;
}
.faq-answer {
  font-size: 14px;
  line-height: 2;
  color: #8d674a;
  padding: 14px 0 22px;
}
.faq-answer-actions {
  display: grid;
  gap: 10px;
}
.contact-card {
  text-align: center;
  padding: 15px 8px 0;
}
.contact-card h3 {
  font-size: 20px;
  margin: 13px 0 9px;
}
.contact-card p {
  font-size: 12px;
  line-height: 1.9;
  color: #a07d5c;
  margin: 10px 0 16px;
}
.wechat-qr {
  display: block;
  max-width: 220px;
  width: 85%;
  margin: 20px auto;
  border-radius: 10px;
}
.wechat-id {
  display: block;
  text-align: left;
  background: #f4dfc4;
  padding: 13px 15px;
  margin: 18px 0 13px;
  border-radius: 12px;
}
.wechat-id span {
  display: block;
  font-size: 12px;
  color: #a4815d;
  margin-bottom: 8px;
}
.wechat-id input {
  border: 0;
  background: none;
  width: 100%;
  color: #8d5b36;
  font-size: 18px;
  padding: 0;
  user-select: all;
}
.contact-card .contact-tip {
  padding: 16px 0 0;
  border-top: 1px solid #eed9c0;
  font-size: 12px;
}
.contact-pending {
  background: #f3dfc5;
  border-radius: 12px;
  padding: 22px 12px;
  font-size: 14px;
  line-height: 1.9;
  margin: 23px 0;
}
.contact-pending small {
  font-size: 12px;
  color: #a3886b;
}
.wechat-link {
  margin: 14px 0;
  text-decoration: none;
}
.content-unavailable {
  font-size: 12px;
  line-height: 1.8;
  padding: 13px 16px;
  border-radius: 12px;
  background: #f3dbc0;
  margin-top: 15px;
  color: #92603e;
}
.content-unavailable button {
  display: block;
  margin-top: 7px;
  font-weight: 600;
  color: #a65e37;
}
@media (max-width: 370px) {
  .faq-categories {
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .support-hero {
    padding: 22px 18px;
  }
  .support-hero h2 {
    font-size: 20px;
    max-width: 180px;
  }
  .support-hero .support-mark {
    right: 14px;
    width: 44px;
    height: 44px;
  }
  .faq-list > button {
    padding: 14px;
  }
  .support-human {
    padding: 17px;
  }
}
.picture-stage {
  margin: 0 0 8px;
  min-width: 0;
}
.picture-image {
  position: relative;
  aspect-ratio: 16/9;
  background: #eddbc5;
  overflow: hidden;
  border-radius: 17px;
  box-shadow: 0 8px 24px #a66e3d20;
}
.picture-open {
  display: block;
  width: 100%;
  height: 100%;
}
.picture-page {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.picture-page.turning {
  animation: picture-turn 0.24s ease-out;
}
@keyframes picture-turn {
  from {
    opacity: 0.55;
    transform: translateX(5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.picture-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 0;
  font-size: 12px;
  color: #8e6142;
}
.picture-meta > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.picture-meta svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.picture-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picture-counter {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}
.picture-hint {
  font-size: 12px;
  color: #a38368;
  margin: 6px 2px 0;
}
.picture-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: #f9e6ceef;
  font-size: 12px;
  color: #865b3c;
}
.picture-error[hidden] {
  display: none;
}
.picture-error button {
  padding: 10px 15px;
  border-radius: 10px;
  background: #eac39e;
}
dialog[data-kind='picture'] {
  inset: 0;
  margin: auto;
  width: min(1100px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}
dialog[data-kind='picture'] #sheet-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
dialog[data-kind='picture'] .handle {
  display: none;
}
dialog[data-kind='picture'] .sheet-head {
  flex: none;
  margin-bottom: 12px;
}
.picture-stage.expanded {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
}
.expanded .picture-image {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  box-shadow: none;
  background: #f4dfc5;
}
.expanded .picture-page {
  position: absolute;
  inset: 0;
}
.picture-tools {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.picture-tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 130px;
}
.picture-tools svg {
  width: 18px;
  height: 18px;
}
@media (orientation: landscape) and (max-height: 500px) {
  dialog[data-kind='picture'] #sheet-content {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .picture-stage.expanded {
    position: relative;
  }
  .expanded .picture-hint,
  .expanded .picture-meta {
    display: none;
  }
  .picture-tools {
    position: absolute;
    bottom: 8px;
    right: 8px;
    margin: 0;
  }
  .picture-tools button {
    min-width: 85px;
    padding: 8px 12px;
    background: #fff0dfec;
  }
  dialog[data-kind='picture'] .sheet-head {
    margin-bottom: 5px;
  }
}

/* Account onboarding: a local preview of the required login + child profile. */
.guest-card {
  padding: 26px 22px 20px;
  text-align: center;
  border: 1px solid #edcfac;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 0, #ffe5b9, transparent 70%),
    linear-gradient(150deg, #fff8eb, #f8dfc2);
  box-shadow: 0 10px 24px #ad613b0b;
}
.guest-avatar,
.account-mark {
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  width: 64px;
  height: 64px;
  border-radius: 23px;
  background: #fff4de;
  color: var(--green);
  box-shadow: 0 5px 16px #b9773920;
}
.guest-avatar svg,
.account-mark svg {
  width: 29px;
  height: 29px;
}
.guest-card .eyebrow {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #ad7554;
}
.guest-card h2 {
  margin: 12px 0 10px;
  font-size: 23px;
}
.guest-card p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.guest-card .primary {
  margin: 20px 0 12px;
}
.guest-card > small {
  font-size: 12px;
}
.profile-card {
  width: 100%;
  text-align: left;
}
.profile-card .grow {
  min-width: 0;
}
.profile-card h2,
.profile-card small {
  overflow-wrap: anywhere;
}
.account-status {
  display: block;
  font-size: 12px;
  color: var(--green);
  margin-bottom: 6px;
}
.access-notice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 13px 14px;
  margin: 0 0 20px;
  border: 1px solid #eccdab;
  border-radius: 15px;
  background: #fbe3c7;
}
.access-notice > .grow {
  min-width: 0;
}
.access-notice strong {
  font-size: 13px;
  display: block;
  margin-bottom: 3px;
}
.access-notice small {
  font-size: 12px;
  line-height: 1.5;
}
.access-notice > svg {
  width: 17px;
  flex-shrink: 0;
}
.logout-button {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 13px;
  margin-top: 23px;
  font-size: 13px;
  color: var(--muted);
  background: #fff5e8;
}
#sheet[data-kind='account'] {
  max-height: 94dvh;
}
.account-intro {
  text-align: center;
  padding: 12px 0 8px;
}
.account-intro .eyebrow {
  font-size: 9px;
  color: #a97b58;
  margin-bottom: 12px;
}
.account-intro h3 {
  font-size: 22px;
  margin-bottom: 10px;
}
.account-intro > p:last-child {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.account-steps {
  list-style: none;
  padding: 0;
  margin: 23px 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.account-steps li {
  display: flex;
  gap: 6px;
  align-items: center;
}
.account-steps span {
  display: grid;
  place-items: center;
  border: 1px solid #e6c7a7;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  font-size: 12px;
}
.account-steps .active {
  color: var(--green);
}
.account-steps .active span {
  background: var(--green);
  border-color: var(--green);
  color: #fff9ef;
}
.preview-note {
  background: #f8e3cc;
  border-radius: 13px;
  padding: 13px 15px;
  margin: 18px 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.preview-note strong {
  font-size: 12px;
  color: var(--ink);
}
.preview-note p {
  margin-top: 5px;
}
.account-later {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  padding: 18px 0 3px;
}
.profile-intro p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 10px;
}
.profile-step {
  font-size: 12px;
  padding: 6px 10px;
  display: inline-block;
  border-radius: 20px;
  background: #f4d9b8;
  color: var(--green);
}
#profile-form .field {
  margin: 19px 0 0;
}
#profile-form .field > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
#profile-form .field > span small {
  font-size: 12px;
  color: #a98569;
}
#profile-form input {
  height: 48px;
  appearance: none;
  min-width: 0;
  max-width: 100%;
}
#profile-form input[type='month'] {
  display: block;
  min-height: 48px;
}
#profile-form input[aria-invalid='true'] {
  border-color: #b45235;
  background: #fff0e5;
}
#profile-form .field-error {
  display: block;
  color: #a8472b;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 4px;
}
#profile-form .field-error:empty {
  display: none;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}
.profile-local-note {
  font-size: 12px;
  color: #9b806a;
  line-height: 1.7;
  margin-top: 19px;
}
#profile-errors:not(:empty) {
  font-size: 12px;
  color: #a8472b;
  line-height: 1.6;
  padding: 10px 12px;
  background: #f9dfc9;
  border-radius: 10px;
  margin-top: 12px;
}
#profile-form .sheet-footer {
  margin-top: 20px;
}
.wechat-login {
  background: #47835e;
  color: #fffdf5;
  box-shadow: 0 5px 14px #47835e17;
}
.wechat-login svg {
  width: 20px;
  height: 20px;
}

/* Parent-selected editions share navigation, with independent content and progress. */
.edition-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 14px;
  background: var(--soft);
  padding: 5px;
  margin: 0 0 22px;
}
.edition-switch button {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 37px;
  padding: 0 15px;
  font-size: 13px;
  border-radius: 10px;
  color: var(--muted);
}
.edition-switch button[aria-pressed='true'] {
  color: var(--green);
  background: var(--card);
  box-shadow: 0 2px 7px #41617c10;
  font-weight: 650;
}
.edition-switch button span {
  font-size: 18px;
}
.region-field {
  border: 0;
  padding: 0;
  margin: 20px 0;
}
.region-field legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.region-field legend small {
  margin-left: 8px;
  font-weight: 400;
}
.region-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.region-selects select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  font: 16px inherit;
  font-family: inherit;
  font-size: 16px;
}
.region-selects select:disabled {
  opacity: 0.6;
}
.region-selects select[aria-invalid='true'] {
  border-color: #ba553f;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
:root[data-edition='primary'] {
  --paper: #eaf5ff;
  --card: #f7fbff;
  --ink: #284b6b;
  --muted: #67839c;
  --green: #337caf;
  --line: #cee2f1;
  --gold: #85bce0;
  --soft: #dceefa;
  background:
    radial-gradient(ellipse at 20% 15%, #f1faff, transparent 55%),
    linear-gradient(140deg, #d7edfc, #9fc5e7);
}
[data-edition='primary'] .app {
  background:
    radial-gradient(ellipse at 95% 0, #bbdffa88, transparent 50%),
    linear-gradient(180deg, #e7f4ff, #f2f9ff 70%, #e6f2fc);
  box-shadow: 0 18px 100px #345e8322;
}
[data-edition='primary'] .stage-1 {
  --stage-start: #c7e6fb;
  --stage-end: #9fcfef;
  --stage-ink: #244e70;
  --stage-detail: #426c8b;
  --stage-accent: #528daf;
}
[data-edition='primary'] .stage-2 {
  --stage-start: #80b8e0;
  --stage-end: #538fbd;
  --stage-ink: #163d5d;
  --stage-detail: #244a68;
  --stage-accent: #255a83;
}
[data-edition='primary'] .stage-3 {
  --stage-start: #356a9a;
  --stage-end: #244c77;
  --stage-ink: #f3faff;
  --stage-detail: #d6eafb;
  --stage-accent: #a9d0ed;
}
[data-edition='primary'] nav {
  background: #eff8fff5;
}
[data-edition='primary'] nav > button {
  color: var(--muted);
}
[data-edition='primary'] nav > button.active {
  color: var(--green);
}
[data-edition='primary']
  :is(
    .mini,
    .search,
    .collection-link,
    .access-notice,
    .preview-note,
    .profile-step,
    .mode-toolbar,
    .queue-edit,
    .queue-options button,
    .secondary,
    .view-toggle,
    .support-human,
    .wechat-id,
    .contact-pending,
    .content-unavailable
  ) {
  background: var(--soft);
  border-color: var(--line);
}
[data-edition='primary']
  :is(
    .desktop-brand .brand-note,
    .eyebrow,
    .pill,
    .text-link,
    .control-side,
    .profile-card small,
    .stats small,
    .setting-value,
    .setting-row > svg,
    .quote,
    .helper,
    .sheet-desc,
    .album-description,
    .album-hero p,
    .times,
    .footer-note,
    .search input::placeholder,
    .search svg,
    .chip,
    .account-intro .eyebrow
  ) {
  color: var(--muted);
}
[data-edition='primary']
  :is(
    .chip.active,
    .sentence-play,
    .check.checked,
    .switch.on,
    .mode-toolbar button[aria-pressed='true']
  ) {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
[data-edition='primary']
  :is(dialog, .sheet-footer, .setting-card, .stats, .field input, .faq-list, .logout-button) {
  background: var(--card);
  border-color: var(--line);
}
[data-edition='primary']
  :is(
    .episode-row.current,
    .queue-track.current,
    .favorite.active,
    .avatar,
    .account-mark,
    .guest-avatar
  ) {
  background: #d1e8f8;
  color: var(--green);
  border-color: var(--line);
}
[data-edition='primary'] :is(.queue-track, .episode-row, .setting-row) {
  border-color: var(--line);
}
[data-edition='primary'] .guest-card {
  background:
    radial-gradient(ellipse at 50% 0, #c6e7ff, transparent 70%),
    linear-gradient(150deg, #f9fdff, #e1f0fb);
  border-color: var(--line);
}
[data-edition='primary']
  :is(
    .guest-card .eyebrow,
    .sentence-eyebrow,
    .sentence-heading time,
    .sentence-note,
    .sentence-question,
    .sentence-answer,
    .sentence-repeat
  ) {
  color: var(--muted);
}
[data-edition='primary'] .daily-sentence {
  background: linear-gradient(135deg, #d8eefe, #c2e1f6);
  border-color: var(--line);
}
[data-edition='primary'] .sentence-heading time {
  background: #edf7ff;
}
[data-edition='primary'] .sentence-dialogue p {
  color: var(--ink);
}
[data-edition='primary'] .sentence-dialogue p span {
  background: #eaf7ff;
  color: var(--green);
}
[data-edition='primary'] .support-hero {
  background: linear-gradient(135deg, #d4eafa, #ecf7ff);
}
[data-edition='primary'] .support-hero p,
[data-edition='primary'] .support-human p {
  color: var(--muted);
}
[data-edition='primary'] .wechat-login {
  background: #47835e;
  color: white;
}

.learning-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: #f8fcff;
  border: 1px solid var(--line);
  padding: 14px 12px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--ink);
}
.learning-path span {
  display: grid;
  gap: 5px;
  text-align: center;
}
.learning-path b {
  font-size: 12px;
  color: #6398bf;
  font-weight: 500;
  letter-spacing: 1px;
}
.learning-path i {
  font-style: normal;
  color: #a9c8de;
}
.primary-shelf {
  display: block;
}
.primary-book {
  display: flex;
  gap: 15px;
  width: 100%;
  align-items: center;
  text-align: left;
  border-radius: 17px;
  background: var(--card);
  padding: 13px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.primary-book .cover {
  width: 93px;
  height: 109px;
  border-radius: 12px;
  flex: none;
}
.primary-book .cover:after {
  display: none;
}
.primary-book strong {
  font-size: 15px;
  display: block;
  line-height: 1.6;
  margin: 6px 0;
}
.primary-book .grow > span {
  font: italic 13px Georgia;
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}
.primary-book small {
  font-size: 12px;
  line-height: 1.6;
}
.primary-book > svg {
  width: 16px;
  flex: none;
}
.reading-book-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 18px 4px;
}
.reading-book-row strong {
  font-size: 16px;
  display: block;
  margin-bottom: 6px;
}
.reading-book-row small {
  display: block;
}
.reading-book-row svg {
  color: var(--green);
  width: 20px;
}
.reading-title {
  margin: 10px 0 18px;
}
.reading-title .eyebrow {
  font-size: 8px;
  letter-spacing: 1.3px;
}
.reading-title h2 {
  font:
    600 29px/1.4 Georgia,
    serif;
  letter-spacing: 0;
  margin: 8px 0;
}
.reading-title > p:last-child {
  font-size: 12px;
  color: var(--muted);
}
.reading-picture {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--soft);
  aspect-ratio: 4/3;
}
.reading-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reading-picture > span {
  position: absolute;
  bottom: 13px;
  left: 13px;
  font-size: 12px;
  background: #ffffffcc;
  border-radius: 20px;
  padding: 5px 9px;
  color: #56778b;
}
.practice-tabs {
  display: flex;
  gap: 7px;
  margin: 18px 0 12px;
}
.practice-tabs button {
  width: 33.333%;
  text-align: left;
  display: grid;
  gap: 5px;
  padding: 13px 10px;
  background: #ddebf6;
  border-radius: 12px;
}
.practice-tabs b {
  font-size: 12px;
  font-weight: 600;
}
.practice-tabs small {
  font-size: 12px;
}
.practice-tabs [aria-pressed='true'] {
  background: var(--green);
  color: white;
}
.practice-tabs [aria-pressed='true'] small {
  color: #d8eeff;
}
.practice-tabs button:disabled {
  opacity: 0.65;
}
.practice-panel {
  padding: 20px 18px;
  border-radius: 19px;
  background: var(--card);
  border: 1px solid var(--line);
}
.practice-caption {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: space-between;
}
.practice-caption h3 {
  font-size: 14px;
  font-weight: 600;
}
.practice-caption .pill {
  font-size: 12px;
  padding: 4px 6px;
}
.reading-dialogue {
  display: grid;
  gap: 15px;
  margin: 24px 0;
}
.reading-dialogue p {
  display: flex;
  align-items: baseline;
  gap: 11px;
  font:
    20px/1.45 Georgia,
    serif;
  color: var(--ink);
}
.reading-dialogue small {
  font: 10px/1.2 sans-serif;
  color: #82aac7;
  flex: none;
}
.practice-counter {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 20px 0 10px;
}
.practice-counter strong {
  font: 32px Georgia;
  color: var(--green);
}
.practice-counter strong small {
  font: 17px Georgia;
  color: #8ca9bf;
}
.practice-counter > span {
  font-size: 12px;
  color: var(--muted);
}
.practice-dots {
  display: flex;
  gap: 6px;
  margin: 12px 0 22px;
}
.practice-dots i {
  height: 6px;
  flex: 1;
  border-radius: 5px;
  background: #dceaf4;
}
.practice-dots .done {
  background: #4c8fbf;
}
.reading-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 13px;
  width: 100%;
  min-height: 49px;
  background: var(--soft);
  color: var(--green);
  font-size: 13px;
  margin: 12px 0;
}
.reading-play svg {
  width: 20px;
}
.reading-play span {
  font-size: 12px;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}
.practice-note {
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
}

.qa-toggle {
  display: flex;
  gap: 5px;
  margin: 18px 0 10px;
}
.qa-toggle button {
  flex: 1;
  padding: 10px 5px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.qa-toggle [aria-pressed='true'] {
  background: var(--soft);
  color: var(--green);
}
.qa-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.qa-questions button {
  font: 12px/1.5 Georgia;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: #edf5fb;
}
.qa-questions button[aria-pressed='true'] {
  background: #cce4f6;
}
.practice-panel > .secondary {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
}
.flow-preview h3 {
  font-size: 16px;
  margin: 22px 0 9px;
}
.flow-preview p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 18px;
}
@media (max-width: 370px) {
  .edition-switch button {
    padding: 0 11px;
  }
  .primary-book {
    gap: 10px;
    padding: 10px;
  }
  .primary-book .cover {
    width: 75px;
    height: 97px;
  }
  .primary-book strong {
    font-size: 13px;
  }

  .practice-panel {
    padding: 17px 13px;
  }
  .reading-dialogue p {
    font-size: 18px;
  }
  .practice-tabs button {
    padding: 12px 8px;
  }
  .region-selects {
    grid-template-columns: 1fr;
  }
  .reading-title h2 {
    font-size: 26px;
  }
}
[data-edition='primary'] .chip[class*='stage-'] {
  color: var(--stage-ink);
}
[data-edition='primary'] #toast {
  background: #315b80;
  color: #f7fbff;
}
[data-edition='primary'] .handle {
  background: #b8d4e8;
}

/* One parent account, independent little nests for each child. */
/* Children can choose their own saved profile without entering parent settings. */
.child-quick-list {
  display: grid;
  grid-template-columns: repeat(var(--child-quick-columns, 1), minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 16px;
}
.child-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
}
.child-quick strong {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.child-quick small {
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
.child-quick .child-edition-badge {
  font-size: 12px;
  line-height: 1.4;
  padding: 1px 5px;
}
.child-quick.is-current {
  background: var(--soft);
  border-color: var(--green);
  box-shadow: inset 0 -2px var(--green);
}
.child-quick:focus-visible {
  outline-offset: -3px;
}
.child-avatar {
  width: 37px;
  height: 37px;
  border-radius: 14px;
  background: #efd6b5;
  color: #97603f;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 15px;
  font-weight: 600;
}
.child-color-1 {
  background: #dce9d0;
  color: #637a4c;
}
.child-color-2 {
  background: #e3def0;
  color: #7f6e9f;
}
.family-section {
  margin: 18px 0;
}
.family-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
}
.family-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 13px;
  border-bottom: 1px solid var(--line);
}
.family-card-head h3 {
  font-size: 13px;
}
.family-card-head h3 small {
  font-size: 12px;
  margin-left: 4px;
  font-weight: 400;
  color: var(--muted);
}
.family-card-head .text-link {
  min-height: 32px;
  font-size: 12px;
  flex: none;
}
.child-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(100% / var(--child-columns, 3));
  gap: 0;
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.child-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  overflow: hidden;
  scroll-snap-align: start;
}
.child-card:last-child {
  border-right: 0;
}
.child-card.is-current {
  background: var(--soft);
  box-shadow: inset 0 -2px var(--green);
}
.child-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 8px 6px 6px;
  flex: 1;
}
.child-profile:active {
  transform: none;
  background: var(--soft);
}
.child-profile:focus-visible,
.child-edit:focus-visible {
  outline-offset: -3px;
}
.child-profile .grow {
  min-width: 0;
  width: 100%;
}
.child-profile strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.child-profile small {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin: 1px 0 3px;
  overflow-wrap: anywhere;
}
.child-profile .child-avatar {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  font-size: 12px;
}
.child-edition-badge {
  display: inline-block;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
  line-height: 1.4;
}
.child-edition-badge.edition-toddler {
  background: #f7dfbd;
  color: #925527;
}
.child-edition-badge.edition-primary {
  background: #d5eafb;
  color: #36678e;
}
.child-edit {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.child-edit svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}
.child-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 18px;
  font-size: 12px;
  color: var(--green);
  white-space: nowrap;
}
.child-status svg {
  width: 11px;
  height: 11px;
  flex: none;
}
.child-scroll-hint {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  padding: 2px 8px;
  border-top: 1px solid var(--line);
}
.guest-edition {
  margin: 0 auto;
  min-height: 36px;
}
.family-card > .add-child-card {
  width: calc(100% - 32px);
  margin: 16px;
}
.stage-option > svg {
  flex: none;
  width: 20px;
  height: 20px;
}
.add-child-card {
  display: block;
  border: 1px dashed var(--green);
  background: var(--card);
  color: var(--green);
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  margin-top: 15px;
  font-size: 13px;
  font-weight: 550;
}
#child-edition {
  width: 100%;
  font-size: 16px;
  font-family: inherit;
  padding: 12px 10px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
}
.child-cards + .field-hint {
  margin-top: 12px;
}
[data-edition='primary'] .child-avatar {
  background: #c6e4f6;
  color: #3c6b91;
}
[data-edition='primary'] .child-color-1 {
  background: #d4e8dd;
  color: #57806c;
}
[data-edition='primary'] .child-color-2 {
  background: #dfdcf2;
  color: #756b9b;
}

.little-hero p:last-child {
  color: #976b4d;
}
.little-hero .eyebrow {
  color: #a47a5a;
}
.little-hero img {
  opacity: 1;
}

.daily-sentence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 118px;
  margin: 16px 0 4px;
  padding: 12px 14px;
  border-radius: 16px;
}
.sentence-heading {
  grid-column: 1/-1;
  margin: 0;
  align-items: center;
}
.sentence-heading h3 {
  font-size: 14px;
}
.sentence-heading time {
  font-size: 12px;
  padding: 4px 7px;
}
.sentence-dialogue {
  margin: 0;
  display: grid;
  gap: 5px;
  min-width: 0;
}
.sentence-dialogue p {
  font-size: 15px;
  line-height: 1.45;
  gap: 7px;
  margin: 0;
  justify-content: flex-start;
  text-align: left;
}
.sentence-dialogue p span {
  width: 17px;
  height: 17px;
  font-size: 12px;
  flex: none;
}
.sentence-actions {
  margin: 0;
  display: flex;
  gap: 5px;
  align-self: center;
}
.sentence-actions button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
}
.sentence-actions button > span {
  display: none;
}
.sentence-actions svg {
  width: 17px;
  height: 17px;
}
.primary-chips {
  gap: 5px;
}
.primary-chips .chip {
  flex: 1;
  min-width: 0;
  padding: 8px 2px;
  font-size: 12px;
  text-align: center;
}
.stage-reminder {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 5px;
  color: var(--stage-ink);
  opacity: 0.85;
}
[data-edition='primary'] .stage-1 {
  --stage-start: #d4eafa;
  --stage-end: #b4d6ef;
  --stage-ink: #376b93;
}
[data-edition='primary'] .stage-2 {
  --stage-start: #a8cfea;
  --stage-end: #7eb2d9;
  --stage-ink: #245878;
}
[data-edition='primary'] .stage-3 {
  --stage-start: #77acd2;
  --stage-end: #508bb9;
  --stage-ink: #f4faff;
}
[data-edition='primary'] .stage-4 {
  --stage-start: #3e729f;
  --stage-end: #285580;
  --stage-ink: #f6fbff;
}
.route-step {
  display: block;
  padding: 15px;
  border-radius: 13px;
  margin: 12px 0;
}
.route-step h3 {
  font-size: 15px;
}
.route-step p {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 5px;
}
.route-step small {
  display: block;
  font-size: 12px;
  margin-top: 6px;
}
@media (max-width: 370px) {
  .daily-sentence {
    padding: 11px 12px;
    gap: 7px 8px;
  }
  .sentence-dialogue p {
    font-size: 13px;
  }
  .sentence-actions {
    flex-direction: column;
    gap: 4px;
  }
  .sentence-actions button {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  .primary-chips {
    gap: 4px;
  }
  .primary-chips .chip {
    font-size: 12px;
  }
}
.sentence-dialogue .sentence-answer {
  padding-left: 0;
}
.sentence-dialogue p > span {
  min-width: 17px;
  margin-top: 2px;
}
.sentence-actions button {
  min-height: 34px;
}
[data-edition='primary'] .stage-band .stage-sub {
  color: var(--stage-ink);
  opacity: 0.9;
}
@media (max-width: 370px) {
  .sentence-actions button {
    min-height: 30px;
  }
}

/* Parent-only entry, using the original uppercase Chinese multiplication keypad. */
#sheet[data-kind='parent-gate'] {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: min(360px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  right: calc(50% - 390px);
  border-radius: 24px;
}
#sheet[data-kind='parent-gate'] #sheet-content {
  padding: 24px 22px 16px;
}
#sheet[data-kind='parent-gate'] .handle {
  display: none;
}
#sheet[data-kind='parent-gate'] .sheet-head {
  margin-bottom: 6px;
}
#sheet[data-kind='parent-gate'] .sheet-head h2 {
  outline: none;
  font-size: 20px;
}
.gate-caption {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.gate-equation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 13px;
  margin: 24px 0 10px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 2px;
}
.gate-equation output {
  min-width: 64px;
  min-height: 50px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--soft);
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.gate-error {
  height: 26px;
  font-size: 12px;
  text-align: center;
  color: #a7462e;
  line-height: 1.8;
}
.gate-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.gate-keypad button {
  min-height: 52px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 23px;
  font-weight: 600;
  touch-action: manipulation;
}
.gate-keypad button:active {
  background: var(--soft);
}
.gate-keypad .gate-key-action {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.gate-cancel {
  display: block;
  min-height: 44px;
  margin: 11px auto 0;
  font-size: 12px;
  color: var(--muted);
}
#edition-choice {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
}
@media (max-width: 800px) {
  #sheet[data-kind='parent-gate'] {
    left: 0;
    right: 0;
    margin: 0 auto;
  }
}
@media (max-height: 600px) {
  #sheet[data-kind='parent-gate'] #sheet-content {
    padding: 16px;
  }
  .gate-equation {
    margin: 12px 0 6px;
  }
  .gate-keypad button {
    min-height: 42px;
  }
  .gate-keypad {
    gap: 6px;
  }
}

.family-consent {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
  margin: 20px 0;
}
.family-consent input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--accent, #ac613b);
}
.family-auth-links {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  font-size: 13px;
}
.family-auth-links button {
  padding: 10px 4px;
}
.recovery-code {
  font-size: 20px;
  word-break: break-all;
  padding: 20px;
  border-radius: 14px;
  background: #f6e2c8;
  user-select: all;
}
.birth-reminder {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1d6;
  border: 1px solid #e9b75c;
  color: #7a4a10;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}
.recovery-copy {
  font-size: 14px;
  font-weight: 600;
  margin: 4px 0 12px;
}
#family-login-form .field-hint {
  display: block;
  margin-top: 7px;
}
#family-login-form .field-error {
  display: block;
  color: #a8472b;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 6px;
}
#family-login-form .field-error:empty {
  display: none;
}
#family-login-form input[aria-invalid='true'] {
  border-color: #b45235;
}
#family-login-error:not(:empty) {
  padding: 10px 12px;
  background: #f9dfc9;
  border-radius: 10px;
  margin: 12px 0;
}
#family-login-form .primary {
  margin-top: 12px;
}
#family-login-form [disabled],
.family-auth-links button:disabled {
  opacity: 0.65;
}
#family-login-form .family-consent {
  margin-bottom: 6px;
}
#family-login-form .password-wrap {
  display: block;
  position: relative;
  margin-bottom: 0;
}
#family-login-form .password-wrap input {
  padding-right: 52px;
}
#family-login-form .password-visibility {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--muted);
  border-radius: 10px;
}
#family-login-form .password-visibility svg {
  width: 23px;
  height: 23px;
}
#family-username-status:empty {
  display: none;
}
#family-username-status[data-state='available'] {
  color: var(--green);
}
.family-create-prompt {
  padding: 15px;
  background: var(--soft);
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
  margin-top: 16px;
}
.family-create-prompt[hidden] {
  display: none;
}
.family-create-prompt > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.family-create-prompt button {
  flex: 1;
  min-width: 110px;
  padding: 12px 8px;
  font-size: 13px;
  margin-top: 12px;
}
.family-create-prompt .secondary {
  border: 1px solid var(--line);
  border-radius: 12px;
}
#family-login-form .username-feedback {
  display: grid;
  margin-bottom: 0;
}
#family-login-form[data-mode='register'] .username-feedback {
  min-height: 42px;
}
#family-login-form .username-feedback > small {
  grid-area: 1/1;
}
.chips.toddler-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 7px;
}
.chips.toddler-chips .chip {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 12px;
}

.practice-recording {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 14px 0 10px;
}
.record-mic {
  flex: 1;
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.record-mic svg {
  width: 24px;
  height: 24px;
  flex: none;
}
.record-mic.is-recording {
  background: #b45151;
  box-shadow: 0 0 0 4px #b4515118;
}
.record-replay {
  flex: none;
  width: 57px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--green);
  background: var(--soft);
  font-size: 12px;
}
.record-replay svg {
  width: 23px;
  height: 23px;
}
.practice-recording button:disabled {
  opacity: 0.45;
}
.record-error {
  font-size: 12px;
  line-height: 1.7;
  color: #a34639;
  margin: 10px 0 0;
}

.qa-session-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.qa-session-actions .secondary {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 18px;
}
.qa-session-actions svg {
  width: 17px;
  height: 17px;
}
.qa-start {
  background: var(--green);
  color: #fff;
}
.book-listening-progress {
  margin: 12px 0;
}
.practice-tabs small {
  line-height: 1.45;
}

.qa-session-actions .secondary {
  width: auto;
  flex: none;
}
/* Practice voices: a compact, distinct home for model audio and the child's recording. */
.reading-dialogue .qa-main,
.reading-dialogue .qa-reference {
  min-width: 0;
}
.reading-dialogue .qa-main > small,
.reading-dialogue .qa-reference > small {
  display: block;
  font: 11px/1.6 inherit;
  color: var(--muted);
  margin-bottom: 7px;
}
.reading-dialogue .qa-reference {
  padding: 14px;
  border-radius: 12px;
  background: var(--soft);
}
.reading-dialogue p {
  overflow-wrap: anywhere;
}
.reference-listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--green);
  font: 12px/1.4 inherit;
}
.reference-listen svg {
  width: 18px;
  height: 18px;
}
.reference-listen:disabled {
  opacity: 0.45;
}
.voice-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin: 8px 0;
}
.voice-status .text-link {
  font-size: 12px;
}
.record-replay {
  width: 72px;
  padding: 7px 3px;
}
.voice-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}
.voice-book {
  margin: 20px 0;
  border-top: 1px solid var(--line);
}
.voice-book h3 {
  font-size: 15px;
}
.voice-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.voice-item > strong {
  font-size: 14px;
  line-height: 1.65;
  display: block;
  overflow-wrap: anywhere;
}
.voice-item > small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 5px 0;
}
.voice-item > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.voice-item .text-link {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.voice-item svg {
  width: 18px;
  height: 18px;
}
.voice-item .secondary {
  padding: 9px 12px;
  font-size: 12px;
}
.danger {
  color: #9f4a3b;
}
.voice-manager-actions .danger {
  margin-top: 5px;
}
.lesson-lines {
  display: grid;
  gap: 1rem;
}
.lesson-lines > div + div {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.lesson-lines .lesson-prose {
  display: block;
  white-space: pre-line;
}
.lesson-next {
  margin-top: 1rem;
}

.reading-title {
  margin-bottom: 1rem;
}

.qa-toggle button small {
  display: block;
  margin-top: 0.35em;
  font-size: 0.82em;
  font-weight: 500;
}
.remaining-turn {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
}
.remaining-turn svg {
  width: 1em;
  height: 1em;
}
.finish-book {
  width: 100%;
  margin-top: 1rem;
}
.book-celebration {
  display: grid;
  justify-items: center;
  gap: 1.3rem;
  text-align: center;
  padding: 0.3rem 0 1rem;
}
.celebration-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink);
}
.book-medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 7.5rem;
  height: 9.1rem;
  isolation: isolate;
}
.book-medal::before {
  content: '';
  position: absolute;
  top: 0;
  width: 7.2rem;
  height: 7.2rem;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff1af, #ffd16b 62%, #e9a83d);
  border: 3px solid #d69b3d;
  box-shadow:
    inset 0 0 0 4px #ffeb9d,
    0 3px 9px #78591d24;
}
.book-medal strong {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  height: 7.2rem;
  font-size: 1.4rem;
  color: #69400e;
}
.medal-ribbons::before,
.medal-ribbons::after {
  content: '';
  position: absolute;
  top: 57%;
  width: 2.4rem;
  height: 3.8rem;
  background: #5d9bc6;
  z-index: -1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.medal-ribbons::before {
  left: 20%;
  transform: rotate(15deg);
}
.medal-ribbons::after {
  right: 20%;
  transform: rotate(-15deg);
}
.book-celebration > .primary {
  width: 100%;
}

/* 2026-11-12: a real bookshelf photo behind the library heading replaces the cartoon book.
   The tint follows the edition so the white title stays readable over the busy shelves. */
:root {
  --hero-shade: #6b4a10e8;
  --hero-shade-mid: #6b4a1066;
  --hero-glow: #a9701226;
}
:root[data-edition='primary'] {
  --hero-shade: #1d4a70eb;
  --hero-shade-mid: #1d4a7066;
  --hero-glow: #337caf2e;
}
.library-head {
  position: relative;
  justify-content: flex-start;
  align-items: flex-end;
  min-height: 116px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--hero-shade) 0%, var(--hero-shade-mid) 52%, transparent 88%),
    linear-gradient(0deg, var(--hero-shade-mid), transparent 65%),
    url('library-shelf.webp?v=1') center 42% / cover,
    var(--soft);
  box-shadow: 0 10px 26px var(--hero-glow);
}
#view .library-head .eyebrow {
  color: #ffffffd0;
  letter-spacing: 1.6px;
}
.library-head h2 {
  margin: 4px 0 0;
  color: #fff;
  text-shadow: 0 1px 10px #0006;
}
@media (max-height: 700px) {
  .library-head {
    min-height: 92px;
    padding: 12px 18px;
  }
}
.reading-top-title {
  gap: 10px;
}
.reading-top-title .nest-logo {
  flex: none;
  border-radius: 8px;
}
.reading-top-title .back {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.reading-top-title .back svg,
.reading-top-title .pill {
  flex: none;
}

/* Shared primary lesson controls selected from v2, including recording and QA states. */
.dock-status {
  min-height: 16px;
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--muted);
}
.dock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dock-side {
  flex: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 56px;
  min-height: 46px;
  padding: 4px 2px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--green);
  font-size: 12px;
  line-height: 1.2;
}
.dock-side svg {
  width: 20px;
  height: 20px;
}
.dock-side[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px var(--green);
}
.dock-main {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  box-shadow: 0 4px 10px #00000014;
}
.dock-main svg {
  width: 18px;
  height: 18px;
}
.dock-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 46px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--green);
}
.dock-icon svg {
  width: 20px;
  height: 20px;
}
.dock-main span {
  font-size: inherit;
  opacity: 1;
}
.dock-main #reading-time {
  font-size: 13px;
  opacity: 0.8;
  font-weight: 500;
}
.dock-stop {
  flex: none;
  font-size: 13px;
}
.dock-row > .voice-status,
.dock-row > .practice-note,
.dock-row > .record-error {
  order: 5;
  flex-basis: 100%;
  justify-content: center;
  margin: 0;
  font-size: 12px;
  text-align: center;
}
.dock-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.dock-page {
  width: 40px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--green);
}
.dock-page:disabled {
  opacity: 0.4;
}
.dock-page svg {
  width: 18px;
  height: 18px;
}
.dock-next {
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  border-radius: 12px;
}
.dock-next svg {
  width: 16px;
  height: 16px;
}

/* OPS20: the persistent player is mounted into the current picture area. */
body > #audio {
  display: none;
}
.video-stage {
  margin: 16px 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.video-slot {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  background: var(--paper);
  display: grid;
  place-items: center;
}
.video-slot video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.video-slot video[hidden] {
  display: none;
}
.audio-only {
  padding: 32px 16px;
  text-align: center;
  background: #f4f1e9;
}
.media-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 4px;
}
.media-tools input[type='range'] {
  flex: 1;
  min-width: 120px;
  max-width: 100%;
}
.page-image-button {
  display: block;
  border: 0;
  padding: 0;
  margin: 12px auto;
  width: 100%;
  background: transparent;
}
.lesson-image {
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
  border-radius: 14px;
}
.studio-preview,
.ops-image {
  max-width: 100%;
}
.media-tools button {
  min-height: 40px;
  padding: 6px 8px;
  font-size: 14px;
}
html[data-edition='primary'] .page-image-button .lesson-image {
  max-height: min(26vh, 210px);
}
html[data-edition='primary'] .video-slot {
  max-height: min(30vh, 240px);
}

/* LR09: daily choice stays readable on narrow phones. */
.sentence-heading .sentence-choose {
  font-size: 14px;
  min-height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.sentence-selection {
  grid-column: 1 / -1;
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 12px;
}
.sentence-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.sentence-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
.sentence-option.selected {
  border-color: var(--green);
  background: var(--soft);
}
.sentence-number {
  flex: none;
  font-size: 14px;
}
.sentence-option-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
  overflow-wrap: anywhere;
}
.sentence-option-text strong,
.sentence-option-text > span {
  font-size: 16px;
  line-height: 1.45;
}
.sentence-option-text small {
  color: var(--muted);
  font-size: 12px;
}
.sentence-option > svg {
  flex: none;
  width: 20px;
  height: 20px;
}

/* LR11: two freely selectable learning modes. */
.simple-tabs button {
  width: calc((100% - 7px) / 2);
  text-align: center;
}

/* LR12: one reading surface, with yellow/blue editions and a separate audio player. */
:root[data-edition='toddler'] {
  --paper: #fffbed;
  --card: #fffef8;
  --ink: #554d33;
  --muted: #8b8060;
  --green: #a97012;
  --line: #eadfba;
  --gold: #e8bb47;
  --soft: #fff0bd;
  background: #f4e9c7;
}
[data-edition='toddler'] .app {
  background: linear-gradient(180deg, #fff9df, #fffdf4 70%, #fff8df);
}
.reader-heading {
  margin: 4px 0 10px;
  text-align: center;
}
.reader-heading h1 {
  font-size: 22px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.reader-heading p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.reader-counter {
  color: var(--muted);
  font-size: 14px;
}
/* UXP10: the book and its compact controls share one surface; page turns sit at its sides. */
#view.is-book-reader {
  overflow: hidden;
  padding: max(10px, env(safe-area-inset-top)) 10px 12px;
}
.reader-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.reader-layout > .top-title {
  flex: none;
  margin: 0 8px 4px;
  min-height: 34px;
}
.reader-layout .reader-heading {
  flex: none;
  margin: 2px 12px 8px;
}
.reader-layout .simple-tabs {
  flex: none;
  margin: 0 12px 8px;
}
.reader-spread {
  flex: 1;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  min-height: 0;
}
.reader-page {
  grid-area: 1 / 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px #43391e08;
}
.reader-art {
  position: relative;
  flex: 1 1 0;
  min-height: 100px;
}
.reader-image {
  position: absolute;
  inset: 0;
  padding: 8px;
}
.reader-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.reader-text {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 40%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 8px 14px;
  font-size: 21px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #34424a;
}
.reader-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 100px;
  color: var(--muted);
}
.reader-controls {
  flex: none;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.reader-main-controls,
.reader-record .practice-recording {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 8px;
  margin: 0;
}
.reader-controls .reader-play,
.reader-controls .record-mic,
.reader-controls .record-replay {
  flex: none;
  width: 52px;
  min-height: 52px;
  padding: 6px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1.2;
  background: var(--soft);
  color: var(--green);
}
.reader-controls .record-mic {
  color: #fff;
  background: var(--green);
}
.reader-controls .record-mic.is-recording {
  background: #cb4f49;
}
.reader-controls :is(.reader-play, .record-mic, .record-replay) svg {
  width: 23px;
  height: 23px;
}
.reader-record {
  text-align: center;
}
.reader-controls .voice-status {
  justify-content: center;
  font-size: 12px;
  margin: 4px 0 0;
}
.reader-controls
  .voice-status:is([data-state='none'], [data-state='synced'], [data-state='local']) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.reader-controls :is(.practice-note, .record-error, .helper) {
  font-size: 12px;
  line-height: 1.4;
  margin: 4px 0 0;
}
.reader-pager {
  display: contents;
}
.reader-pager button {
  grid-row: 1;
  align-self: center;
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 48px;
  color: var(--green);
  border-radius: 16px;
  background: var(--soft);
}
.reader-pager button:first-child {
  grid-column: 1;
}
.reader-pager button:last-child {
  grid-column: 3;
}
.reader-unlock {
  flex: none;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
  margin: 0 8px 8px;
}
.reader-art .video-stage {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.reader-art .video-slot {
  flex: 1;
  aspect-ratio: auto;
  min-height: 0;
}
.reader-art .video-stage .text-link {
  flex: none;
}
/* A video page follows the source ratio, capped by the space above its controls. */
.reader-spread:has(.video-stage) {
  flex: 0 1 auto;
}
.reader-page:has(.video-stage) {
  align-self: start;
  max-height: 100%;
}
.reader-art:has(.video-stage) {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  aspect-ratio: var(--reader-media-ratio, 16 / 9);
}
html[data-edition] .reader-art .video-slot {
  max-height: none;
}
@media (max-height: 700px), (max-width: 350px) {
  .reader-art {
    min-height: 64px;
  }
  .reader-layout .reader-heading {
    margin-bottom: 4px;
  }
  .reader-layout .reader-heading h1 {
    font-size: 18px;
  }
  .reader-layout .simple-tabs button {
    min-height: 36px;
    padding: 7px;
  }
  .reader-layout .repeat-progress {
    margin-top: 2px;
    min-height: 20px;
  }
  .reader-text {
    font-size: 18px;
    padding: 6px 10px;
  }
}
/* The teacher's editing cards follow the book and remain scrollable. */
body.studio-on:not(.studio-peek) #view.is-book-reader {
  overflow-y: auto;
}
body.studio-on:not(.studio-peek) .reader-text {
  max-height: none;
  overflow: visible;
}
body.studio-on:not(.studio-peek) .reader-layout {
  height: auto;
}
body.studio-on:not(.studio-peek) .reader-art {
  flex-basis: 32dvh;
}
body.studio-on:not(.studio-peek) .reader-art:has(.video-stage) {
  flex-basis: auto;
}

.audio-player {
  text-align: center;
  padding: 12px 0 18px;
}
.audio-player h1 {
  font-size: 23px;
  margin: 20px 0 5px;
  line-height: 1.4;
}
.audio-player > p {
  color: var(--muted);
  font-size: 14px;
}
.audio-cover {
  width: min(66vw, 260px);
  margin: 0 auto;
  position: relative;
}
.audio-cover .cover {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 14px 30px #314f6518;
}
.audio-cover .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.audio-cover-note {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #ffffffeb;
  padding: 5px 12px;
  color: #53675c;
  font-size: 12px;
  white-space: nowrap;
}
.audio-extras {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 18px;
}
.audio-track,
.stage-queue-book {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 13px 4px;
}
.audio-track img,
.stage-queue-book img {
  width: 48px;
  height: 54px;
  border-radius: 7px;
  object-fit: cover;
}
.audio-track strong,
.stage-queue-book strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.audio-track small,
.stage-queue-book small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.audio-track.current {
  color: var(--green);
  background: var(--soft);
  border-radius: 12px;
}
.stage-queue-book .check {
  flex-shrink: 0;
}
@media (max-width: 350px) {
  .audio-player .controls {
    gap: 8px;
  }
}

#sheet[data-kind='stage-queue'] .chips {
  flex-wrap: wrap;
  overflow: visible;
}

/* UXP11: audio selection is a complete library view, with no video shelf underneath. */
.library-media-tabs {
  margin: 4px 0 18px;
}
.library-audio .section-head {
  margin: 12px 0;
}
.library-audio .queue-stage-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
}
/* UXP14: one select-all toggle beside the count; groups are chosen with their own checkboxes. */
.library-audio .queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.library-audio .queue-summary .sheet-desc {
  min-width: 0;
}
.library-audio .queue-summary .text-link {
  flex: none;
  min-height: 44px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--green);
}
.library-audio .queue-list {
  max-height: none;
  overflow: visible;
  margin-bottom: 0;
}
.library-audio .sheet-desc {
  font-size: 13px;
  margin: 12px 0;
}
.library-audio .sheet-footer {
  bottom: -28px;
  padding: 12px 0 16px;
}
/* UXP12: one collection row opens its tracks; the separate checkbox selects the group. */
.audio-collection {
  border-bottom: 1px solid var(--line);
}
.audio-collection-header {
  display: flex;
  align-items: center;
  gap: 2px;
}
.audio-collection-expand {
  flex: 1;
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 10px 0;
}
.audio-collection-expand img {
  width: 40px;
  height: 46px;
  object-fit: cover;
  border-radius: 7px;
  flex: none;
}
.audio-collection-expand strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.audio-collection-expand small {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}
.collection-chevron {
  display: grid;
  place-items: center;
  width: 20px;
  flex: none;
}
.collection-chevron svg {
  width: 18px;
  height: 18px;
}
.audio-collection-expand[aria-expanded='true'] .collection-chevron {
  transform: rotate(90deg);
}
.audio-collection-select {
  width: 44px;
  min-height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.audio-collection-select .check {
  font-size: 18px;
  font-weight: 700;
}
.audio-collection-tracks {
  padding-left: 18px;
}
.audio-collection-tracks .stage-queue-book {
  gap: 8px;
}
.audio-collection-tracks .stage-queue-book:last-child {
  border-bottom: 0;
}
.audio-collection-tracks .stage-queue-book img {
  width: 36px;
  height: 42px;
}
.audio-collection-tracks .stage-queue-book strong {
  font-size: 14px;
}

.collection-parent-title {
  margin: 18px 0;
  overflow-wrap: anywhere;
}
body.studio-on:not(.studio-peek) .collection-parent-title,
body.studio-peek .collection-editor-only {
  display: none;
}

@media (max-height: 700px) {
  #view.is-audio-library {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .is-audio-library .library-head {
    min-height: 58px;
    margin-bottom: 4px;
    padding: 10px 16px;
    border-radius: 18px;
  }
  .is-audio-library .library-head .eyebrow {
    display: none;
  }
  .is-audio-library .library-head h2 {
    margin: 0;
  }
  .is-audio-library .library-media-tabs {
    margin: 8px 0;
  }
  .is-audio-library .library-media-tabs button {
    padding: 10px 6px;
  }
  .library-audio .section-head {
    margin: 8px 0;
  }
  .library-audio .sheet-desc {
    margin: 6px 0;
  }
  /* Keep collection rows reachable when child profiles fill a short screen. */
  .library-audio .sheet-footer {
    position: static;
  }
}

/* VD01: shared video library, independent from the audio queue. */
.vd-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin: 16px 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}
.vd-tabs button {
  flex: 1;
  border: 0;
  border-radius: 14px;
  padding: 12px 6px;
  color: var(--ink, #343b32);
  background: transparent;
  font: inherit;
}
.vd-tabs .selected,
.vd-filters .selected,
.vd-seasons .selected {
  background: #ead68c;
  color: #332e1f;
  font-weight: 700;
}
[data-edition='primary'] .vd-tabs .selected,
[data-edition='primary'] .vd-filters .selected,
[data-edition='primary'] .vd-seasons .selected {
  background: #b8daf3;
  color: #244965;
}
.vd-lead {
  font-size: 15px;
  margin: 16px 0;
}
.vd-note {
  color: #70756c;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.vd-search {
  display: flex;
  gap: 6px;
}
.vd-search input {
  min-width: 0;
  flex: 1;
  padding: 13px;
  border: 1px solid #ddd9ce;
  border-radius: 12px;
  font: inherit;
  background: #fffdfa;
}
.vd-search button,
.vd-filters button,
.vd-seasons button,
.vd-title button,
.vd-watch button,
.vd-bottom button {
  border: 1px solid #dedbce;
  border-radius: 12px;
  background: #fffdf6;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: #394335;
}
.vd-filters,
.vd-seasons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
}
.vd-filters button,
.vd-seasons button {
  flex-shrink: 0;
}
.vd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  margin: 14px 0 28px;
}
.vd-card {
  text-align: left;
  border: 0;
  padding: 0 0 12px;
  background: #fffdf7;
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  min-width: 0;
  box-shadow: 0 4px 12px #30260908;
}
.vd-card strong,
.vd-card small {
  display: block;
  padding: 0 10px;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.vd-card strong {
  font-size: 15px;
  line-height: 1.4;
}
.vd-card small {
  font-size: 12px;
  color: #74796d;
  line-height: 1.5;
}
.vd-art {
  position: relative;
  aspect-ratio: 16/9;
  background: #e9e4d5;
}
.vd-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vd-art span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: #ffffffed;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
}
.vd-hero {
  margin: 16px 0;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #eee9da;
}
.vd-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.vd-title {
  display: flex;
  align-items: start;
  gap: 12px;
}
.vd-title h2 {
  flex: 1;
  margin: 4px 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}
.vd-title button {
  flex-shrink: 0;
}
.vd-description {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.vd-episodes {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}
.vd-episodes button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: #fffdf7;
  padding: 16px 12px;
  border-radius: 16px;
  text-align: left;
  color: inherit;
}
.vd-episodes button > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.vd-episodes strong {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.vd-episodes small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #777b70;
}
.vd-number {
  font-size: 19px;
  color: #929b82;
}
.vd-watch {
  background: #fffdf7;
  padding: 18px;
  border-radius: 20px;
  margin-top: 18px;
  line-height: 1.6;
}
.vd-open {
  display: block;
  text-align: center;
  text-decoration: none;
  background: #57704c;
  color: white;
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  margin: 16px 0 12px;
}
.vd-watch > button {
  width: 100%;
}
.vd-watch textarea {
  box-sizing: border-box;
  width: 100%;
  height: 130px;
  font: inherit;
}
.vd-bottom {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.vd-recent {
  display: block;
  width: 100%;
  text-align: left;
  background: #f0e5b9;
  border: 0;
  border-radius: 16px;
  padding: 14px;
  font: inherit;
  color: #454b3b;
}
.vd-recent small {
  display: block;
  margin-top: 6px;
}
.vd-card:focus-visible,
.vd-open:focus-visible {
  outline: 3px solid #4e8054;
  outline-offset: 3px;
}

/* VD03: three peer destinations; the mini-player owns audio controls. */
nav.video-bottom-nav {
  padding-top: 12px;
}
nav.video-bottom-nav > button {
  min-height: 44px;
  gap: 6px;
  font-size: 12px;
}
nav.video-bottom-nav > button svg {
  width: 24px;
  height: 24px;
}

/* LR13: persistent per-book achievement and repeat-friendly controls. */
.repeat-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 14px;
  color: #536979;
}
.repeat-complete,
.reading-book-row .repeat-complete {
  color: #176849;
  font-weight: 700;
}
.repeat-page-done {
  color: #176849;
  text-align: center;
  font-size: 14px;
  margin: 8px 0;
}
.repeat-badge-actions {
  display: grid;
  gap: 10px;
  width: 100%;
}
.repeat-celebration .book-medal strong {
  font-size: 24px;
}
.repeat-celebration p {
  margin: 8px 0;
}

/* VD04: level labels stay readable and scroll as one row. */
.vd-levels {
  flex-wrap: nowrap;
}
.vd-levels button {
  white-space: nowrap;
}
.vd-level-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

/* VD05: visible prerequisites and per-episode audio. */
.vd-gate,
.vd-audio {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #ddd9ce;
  border-radius: 16px;
  background: #fffdf5;
}
.vd-gate h3,
.vd-audio h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
/* VD07: purchase notice — buying never skips the prerequisites. */
.vd-purchase-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1d6;
  color: #6b4500;
  font-size: 14px;
  line-height: 1.5;
}
.vd-requirement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
}
.vd-requirement small {
  display: block;
  margin-top: 4px;
}
.vd-gate button,
.vd-audio button {
  border: 1px solid #ddd9ce;
  border-radius: 10px;
  padding: 10px;
  margin: 4px;
  background: #fff;
  color: var(--ink);
}
.vd-requirement button {
  flex-shrink: 0;
}
.vd-audio input {
  width: 100%;
  margin-top: 14px;
}
.vd-open:disabled {
  opacity: 0.5;
}

/* LR14: every edition keeps configurable names in one scrollable row. */
.chips.level-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.chips.level-chips .chip {
  padding: 9px 14px;
  font-size: 13px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.stage-band h3,
.stage-option strong,
.pill {
  overflow-wrap: anywhere;
}
/* Reader when access to the open book was revoked or has expired. */
.reader-locked {
  margin: 24px 0;
  padding: 24px 20px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
}
.reader-locked h1 {
  font-size: 22px;
  margin: 0 0 12px;
}
.reader-locked p {
  margin: 0 0 16px;
  color: var(--muted, #6b6457);
  line-height: 1.6;
}
/* UXP04: mini player before the first listen. */
.mini.mini-empty {
  gap: 12px;
  padding-left: 16px;
}
.mini-empty-icon {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
}
.mini-empty-icon svg {
  width: 26px;
  height: 26px;
  opacity: 0.7;
}
/* UXP05: one line on the repeat-listening idea under the album's start button. */
.album-repeat-note {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.album-repeat-note .text-link {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
/* UXP06: page turning as a visible on/off switch; a way back from 正在听 to the book. */
.turn-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  padding: 6px 0;
}
.turn-switch .switch-track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: #d9d2c4;
  transition: background 0.2s;
}
.turn-switch .switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.2s;
}
.turn-switch[aria-checked='true'] .switch-track {
  background: var(--green, #6aa56f);
}
[data-edition='primary'] .turn-switch[aria-checked='true'] .switch-track {
  background: #3a7fb5;
}
.turn-switch[aria-checked='true'] .switch-thumb {
  transform: translateX(16px);
}
.listen-back {
  margin-bottom: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .turn-switch .switch-track,
  .turn-switch .switch-thumb {
    transition: none;
  }
}
/* UXP01: one-time welcome. */
.welcome-lead {
  font-size: 16px;
  line-height: 1.7;
  margin: 4px 0 12px;
}
.welcome-steps {
  margin: 0 0 16px;
  padding-left: 22px;
  line-height: 1.9;
  color: var(--muted);
}
.welcome-question {
  font-weight: 650;
  margin: 0 0 10px;
}
.welcome-choices {
  display: grid;
  gap: 10px;
}
.welcome-choice {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #e8c48e;
  background: #fff6e6;
  color: var(--ink);
}
.welcome-choice strong {
  font-size: 17px;
}
.welcome-choice small {
  color: var(--muted);
}
.welcome-choice.primary-choice {
  border-color: #9cc3e2;
  background: #eef6fd;
}
.welcome-skip {
  display: block;
  margin: 14px auto 0;
}
.welcome-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.welcome-start {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  gap: 8px;
}
/* A page without text should not leave an empty white block under its picture. */
.reader-page:not(:has(.reader-text)) {
  min-height: 0;
}
/* VD06: new-unlock dot on the 视频 tab and one static line in the library. */
nav > button {
  position: relative;
}
.nav-dot {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e5484d;
  box-shadow: 0 0 0 2px #fff;
}
.unlock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #f1c27d;
  border-radius: 14px;
  background: #fff4dc;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.unlock-banner strong {
  flex: none;
  color: #b4560f;
}
[data-edition='primary'] .unlock-banner {
  border-color: #9cc3e2;
  background: #eaf4fc;
}
[data-edition='primary'] .unlock-banner strong {
  color: #2f6fa3;
}
.vd-why {
  display: block;
  margin: 0 0 10px;
}

/* Familiar corner control and a landscape viewer independent of device rotation lock. */
.video-stage {
  position: relative;
}
.video-stage .media-expand {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: white;
  background: #101616b8;
  box-shadow: 0 1px 8px #0003;
}
.media-expand svg {
  width: 24px;
  height: 24px;
}
dialog.story-fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  outline: none;
}
.story-fullscreen::backdrop {
  background: var(--paper);
}
.story-fullscreen-frame {
  width: 100%;
  height: 100%;
  background: var(--paper);
}
.story-fullscreen-surface {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
}
.story-fullscreen-surface.is-rotated {
  transform: translate(-50%, -50%) rotate(90deg);
  padding: 12px max(24px, env(safe-area-inset-bottom)) 12px max(24px, env(safe-area-inset-top));
}
.story-fullscreen header,
.story-fullscreen footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-height: 48px;
}
.story-fullscreen header strong {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}
.story-fullscreen-picture {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.story-fullscreen-picture video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.story-fullscreen button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}
.story-fullscreen button:active {
  background: var(--soft);
}
.story-fullscreen button:focus-visible,
.story-fullscreen input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.story-fullscreen button svg {
  width: 24px;
  height: 24px;
}
.story-fullscreen input[type='range'] {
  flex: 1;
  min-width: 30px;
  width: auto;
  /* Keep the native track and thumb together so Safari centers them at every orientation. */
  accent-color: var(--green);
  height: 32px;
}
.story-fullscreen [data-screen-time] {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.studio-story-card {
  display: contents;
}

#sheet[data-kind='stage-queue'] #sheet-content {
  display: flex;
  flex-direction: column;
  max-height: 85dvh;
  box-sizing: border-box;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
#sheet [data-queue-surface='sheet'] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#sheet [data-queue-surface='sheet'] > :not(.queue-list) {
  flex-shrink: 0;
}
#sheet [data-queue-surface='sheet'] .queue-list {
  min-height: 0;
  margin-bottom: 0;
}
#sheet .queue-destinations {
  position: static;
  margin: 0;
}
.queue-destinations > div {
  display: flex;
  gap: 8px;
}
.queue-destinations button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
}
.queue-speaker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}
.queue-speaker:disabled {
  opacity: 0.45;
}
.queue-speaker svg {
  width: 18px;
  height: 18px;
}

.speaker-playlist {
  padding-inline-start: 2rem;
  margin-block: 1rem;
}
.speaker-playlist li {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e7dfcd;
  overflow-wrap: anywhere;
}
.speaker-playlist [aria-current='true'] {
  background: #fff0ba;
  color: #503c1c;
  border-radius: 0.6rem;
  font-weight: 700;
}
.speaker-playlist small {
  white-space: nowrap;
}

/* HW11 「我的音箱」 */
.speaker-page {
  display: grid;
  gap: 14px;
}
.speaker-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 4px 14px 10px;
  min-width: 0;
}
.speaker-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 4px;
}
.speaker-card-head h3 {
  font-size: 15px;
  margin: 0;
  overflow-wrap: anywhere;
}
.speaker-online {
  flex: none;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #eadccd;
  color: var(--muted);
}
.speaker-online.is-online {
  background: #dcebd2;
  color: #4f7340;
}
.speaker-meta {
  margin: 2px 0 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.speaker-block {
  border-top: 1px solid var(--line);
  padding: 10px 0 4px;
}
.speaker-block h4 {
  margin: 0 0 4px;
  font-size: 13px;
}
.speaker-phase,
.speaker-storage,
.speaker-empty {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.speaker-card .speaker-playlist {
  font-size: 12px;
  margin-block: 6px;
  padding-inline-start: 1.6rem;
}
.speaker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 0;
}
.speaker-row + .speaker-row {
  border-top: 1px dashed var(--line);
}
.speaker-row-stack {
  flex-wrap: wrap;
}
.speaker-row strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.speaker-row small {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.5;
  color: var(--muted);
}
.speaker-row .grow {
  flex: 1;
  min-width: 0;
}
.speaker-row select,
.speaker-hours input,
.speaker-pair select {
  min-height: 40px;
  max-width: 46%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}
.speaker-pair select {
  width: 100%;
  max-width: none;
}
.speaker-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.speaker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.speaker-chips button {
  font-size: 12px;
  padding: 8px 10px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.speaker-chips button.is-on {
  background: var(--soft);
  border-color: var(--gold);
  font-weight: 600;
}
.speaker-hours {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 12px;
}
.speaker-hours input {
  flex: 1;
  max-width: none;
  min-width: 0;
}
.speaker-note {
  margin: 4px 0 6px;
}
.speaker-alert {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fbe5d4;
  font-size: 12px;
}
.speaker-history {
  margin: 8px 0 4px;
}
.speaker-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.speaker-actions .text-link,
.speaker-clear {
  min-height: 36px;
}
.speaker-add svg {
  width: 18px;
  height: 18px;
}
.speaker-intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 16px;
}
.speaker-intro h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.speaker-intro p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}
.speaker-steps {
  margin: 4px 0 0;
  padding-inline-start: 1.4rem;
  font-size: 13px;
  line-height: 1.8;
}
.speaker-pair-status {
  font-size: 12px;
  color: #b0482c;
  min-height: 1em;
}
.speaker-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.speaker-choice:has(input:checked) {
  border-color: var(--gold);
  background: var(--soft);
}
.speaker-choice strong {
  display: block;
  font-size: 13px;
}
.speaker-choice small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.speaker-choose .primary {
  margin-top: 10px;
}
.speaker-chat-log {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  display: grid;
  gap: 8px;
}
.speaker-chat-log li {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  max-width: 88%;
}
.speaker-chat-log li.is-child {
  justify-self: end;
  background: var(--soft);
}
.speaker-chat-log small {
  font-size: 12px;
  color: var(--muted);
}
.speaker-chat-log p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.speaker-hours input {
  padding: 6px 4px;
}
.speaker-hours input::-webkit-calendar-picker-indicator {
  display: none;
}
/* HW11 1.9.1: everyday controls first, the rest folded under 「更多设置」. */
.speaker-more {
  border-top: 1px solid var(--line);
}
.speaker-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.speaker-more > summary::-webkit-details-marker {
  display: none;
}
.speaker-more > summary::after {
  content: '展开';
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.speaker-more[open] > summary::after {
  content: '收起';
}
.speaker-handoff,
.speaker-scan-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.speaker-handoff .text-link {
  min-height: 40px;
}
.speaker-scan-choice > button {
  flex: 1 1 140px;
}
/* Video speed (teacher feedback 2026-11-24): its own control, separate from the audio speed. */
.media-speed {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.video-stage .media-speed-overlay {
  position: absolute;
  left: 10px;
  bottom: 10px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: white;
  background: #101616b8;
  box-shadow: 0 1px 8px #0003;
}
