/* =========================================================
   say. — scene-based English
   A mobile-first, dependency-free PWA interface
   ========================================================= */

:root {
  --paper: #f5efe3;
  --paper-deep: #eae1d2;
  --card: #fffaf2;
  --card-soft: #fbf5ea;
  --ink: #18271f;
  --forest: #163c30;
  --forest-2: #245543;
  --forest-3: #dbe8df;
  --orange: #e66c3e;
  --orange-dark: #c9532a;
  --orange-soft: #f5d3c2;
  --gold: #e8bb66;
  --muted: #70786f;
  --muted-2: #92988f;
  --line: rgba(24, 39, 31, 0.12);
  --line-strong: rgba(24, 39, 31, 0.2);
  --white: #fffdf8;
  --danger: #b64d35;
  --app-w: 460px;
  --nav-h: 72px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-soft: 0 12px 30px rgba(28, 47, 38, 0.09);
  --shadow-card: 0 18px 44px rgba(28, 47, 38, 0.14);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype",
    "Book Antiqua", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: #0e261e;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(232, 187, 102, 0.14), transparent 30%),
    radial-gradient(circle at 82% 88%, rgba(230, 108, 62, 0.12), transparent 34%),
    #102a21;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body::before {
  content: "speak.";
  position: fixed;
  left: -0.04em;
  bottom: -0.23em;
  z-index: 0;
  color: rgba(245, 239, 227, 0.035);
  font-family: var(--serif);
  font-size: clamp(160px, 22vw, 360px);
  font-style: italic;
  line-height: 0.78;
  letter-spacing: -0.07em;
  pointer-events: none;
  user-select: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

p,
h1,
h2,
h3,
h4 {
  margin: 0;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-xs {
  width: 13px;
  height: 13px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

::selection {
  color: var(--white);
  background: var(--orange);
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: 0.45;
}

.ambient-one {
  top: -18vw;
  left: -8vw;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(232, 187, 102, 0.13), transparent 70%);
}

.ambient-two {
  right: 2vw;
  bottom: 8vh;
  width: 26vw;
  height: 26vw;
  background: radial-gradient(circle, rgba(230, 108, 62, 0.12), transparent 70%);
}

.desktop-note {
  position: fixed;
  z-index: 1;
  display: none;
  color: rgba(245, 239, 227, 0.34);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.32em;
  pointer-events: none;
}

.desktop-note-top {
  top: 28px;
  left: 34px;
}

.desktop-note-side {
  top: 50%;
  right: 22px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
}

/* App shell ------------------------------------------------- */

.app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--app-w);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 26px);
  overflow-x: clip;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 90px rgba(0, 0, 0, 0.34);
}

.app.has-playbar {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.app.no-nav {
  padding-bottom: 0;
}

@media (min-width: 720px) {
  body {
    padding: 0;
  }

  .app {
    min-height: 100vh;
  }

  .desktop-note {
    display: block;
  }
}

@media (min-width: 1100px) {
  .app {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.07),
      0 50px 120px rgba(0, 0, 0, 0.44);
  }
}

/* Shared bits ----------------------------------------------- */

.page {
  animation: page-in 0.42s var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--orange-dark);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.muted {
  color: var(--muted);
}

.round-icon-btn {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.72);
  transition: transform 0.18s var(--ease), background 0.18s;
}

.round-icon-btn:active {
  transform: scale(0.94);
}

.pill-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.primary-btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  color: var(--white);
  font-size: 14px;
  font-weight: 650;
  border: 0;
  border-radius: 16px;
  background: var(--forest);
  box-shadow: 0 10px 22px rgba(22, 60, 48, 0.2);
  transition: transform 0.18s var(--ease), background 0.18s;
}

.primary-btn:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn.orange {
  background: var(--orange);
  box-shadow: 0 10px 22px rgba(230, 108, 62, 0.24);
}

.primary-btn.cream {
  color: var(--forest);
  background: var(--card);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.ghost-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: transparent;
}

/* Top bar and brand ---------------------------------------- */

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(17px + env(safe-area-inset-top)) 20px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-word {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 31px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 1;
}

.brand-word b {
  color: var(--orange);
  font-weight: inherit;
}

.brand-caption {
  padding-left: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.45;
  border-left: 1px solid var(--line-strong);
}

.streak-pill {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(230, 108, 62, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.62);
}

.streak-pill .icon {
  width: 15px;
  height: 15px;
}

/* Home ------------------------------------------------------ */

.home-intro {
  padding: 18px 20px 15px;
}

.home-intro h1 {
  max-width: 370px;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(27px, 7.5vw, 34px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.18;
}

.home-intro h1 em {
  color: var(--orange-dark);
  font-family: var(--serif);
  font-size: 1.07em;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.home-intro .intro-sub {
  max-width: 330px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.today-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10.5px;
}

.today-line strong {
  color: var(--ink);
  font-size: 11px;
}

.today-track {
  display: block;
  width: 58px;
  height: 3px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(24, 39, 31, 0.1);
}

.today-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  transition: width 0.4s var(--ease);
}

.scene-hero {
  position: relative;
  height: clamp(310px, 82vw, 362px);
  margin: 0 16px;
  overflow: hidden;
  color: var(--white);
  border-radius: var(--radius-xl);
  background: var(--forest);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}

.scene-hero > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.scene-hero:hover > img {
  transform: scale(1.025);
}

.scene-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 23, 17, 0.1) 0%, rgba(8, 23, 17, 0.02) 35%, rgba(8, 23, 17, 0.82) 100%),
    linear-gradient(290deg, rgba(8, 23, 17, 0.22), transparent 55%);
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 15px 0;
}

.hero-labels {
  display: flex;
  align-items: center;
  gap: 7px;
}

.glass-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  color: var(--white);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(13, 35, 26, 0.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.glass-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 187, 102, 0.16);
}

.glass-icon-btn {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(13, 35, 26, 0.3);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.25s var(--ease);
}

.glass-icon-btn:active {
  transform: rotate(24deg) scale(0.94);
}

.hero-bottom {
  position: absolute;
  right: 20px;
  bottom: 19px;
  left: 20px;
}

.hero-overline {
  color: rgba(255, 253, 248, 0.78);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-shadow: 0 1px 10px rgba(8, 23, 17, 0.5);
}

.hero-title {
  max-width: 310px;
  margin-top: 4px;
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(33px, 9.4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

.hero-zh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: rgba(255, 253, 248, 0.9);
  font-size: 12px;
  text-shadow: 0 1px 8px rgba(8, 23, 17, 0.45);
}

.hero-zh::before {
  content: "";
  width: 13px;
  height: 1px;
  background: var(--gold);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: rgba(255, 253, 248, 0.76);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 8px rgba(8, 23, 17, 0.45);
}

.hero-meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.hero-start {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 7px 8px 7px 16px;
  color: var(--forest);
  text-align: left;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(7, 24, 17, 0.18);
}

.hero-start-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-start-copy strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-start-copy small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.hero-start-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  border-radius: 12px;
  background: var(--orange);
}

.hero-start-icon .icon {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}

/* Search section -------------------------------------------- */

.home-search-block {
  margin: 25px 20px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.section-heading h2 span {
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 0.82em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.section-heading .text-link {
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  border: 0;
  background: none;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 7px 7px 7px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: 0 8px 24px rgba(28, 47, 38, 0.06);
}

.search-form .search-leading {
  display: flex;
  flex: 0 0 auto;
  color: var(--orange);
}

.search-form input {
  width: 100%;
  min-width: 0;
  padding: 5px 0;
  color: var(--ink);
  font-size: 13px;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-form input::placeholder {
  color: var(--muted-2);
}

.search-submit {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 13px;
  background: var(--forest);
}

.search-submit .icon {
  width: 18px;
  height: 18px;
}

.quick-chips {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.5);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.chip:active {
  color: var(--orange-dark);
  border-color: rgba(230, 108, 62, 0.35);
  background: var(--orange-soft);
}

.chip.is-active {
  color: var(--white);
  border-color: var(--forest);
  background: var(--forest);
}

.search-scope-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.55;
}

.search-scope-note .icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-dark);
}

/* Resume / recommendation / how-to -------------------------- */

.resume-block {
  margin: 25px 20px 0;
}

.resume-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.resume-thumb {
  position: relative;
  width: 55px;
  height: 55px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 13px;
}

.resume-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resume-body {
  min-width: 0;
  flex: 1;
}

.resume-body .resume-overline {
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.resume-body h3 {
  margin-top: 2px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.resume-progress .bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.resume-progress .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
}

.resume-progress small {
  color: var(--muted-2);
  font-size: 8.5px;
}

.resume-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.recommend-block {
  margin-top: 27px;
}

.scene-rail {
  display: flex;
  gap: 11px;
  padding: 1px 20px 4px;
  overflow-x: auto;
  scroll snap-type: x mandatory;
  scrollbar-width: none;
}

.scene-rail::-webkit-scrollbar {
  display: none;
}

.rail-card {
  width: 214px;
  flex: 0 0 auto;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  scroll-snap-align: start;
  transition: transform 0.22s var(--ease);
}

.rail-card:active {
  transform: scale(0.985);
}

.rail-image {
  position: relative;
  height: 125px;
  overflow: hidden;
  background: var(--paper-deep);
}

.rail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-level {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 7px;
  color: var(--white);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: rgba(12, 35, 25, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.rail-done {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
  background: var(--forest);
}

.rail-done .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.rail-body {
  padding: 11px 12px 12px;
}

.rail-body .rail-zh {
  color: var(--muted);
  font-size: 9px;
}

.rail-body h3 {
  margin-top: 1px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-meta {
  display: flex;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.how-card {
  position: relative;
  margin: 30px 20px 4px;
  padding: 19px 18px;
  overflow: hidden;
  color: var(--white);
  border-radius: 22px;
  background: var(--forest);
}

.how-card::after {
  content: "Aa";
  position: absolute;
  right: 8px;
  bottom: -22px;
  color: rgba(255, 253, 248, 0.07);
  font-family: var(--serif);
  font-size: 130px;
  font-style: italic;
  line-height: 1;
  pointer-events: none;
}

.how-card h3 {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.how-card h3 span {
  margin-left: 7px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.how-steps {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 11px;
  margin-top: 14px;
}

.how-step {
  flex: 1;
  min-width: 0;
}

.how-step strong {
  display: grid;
  width: 22px;
  height: 22px;
  margin-bottom: 7px;
  place-items: center;
  color: var(--forest);
  font-size: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.how-step p {
  color: rgba(255, 253, 248, 0.67);
  font-size: 9.5px;
  line-height: 1.55;
}

.how-step p b {
  display: block;
  margin-bottom: 2px;
  color: var(--white);
  font-size: 10px;
  font-weight: 650;
}

/* Explore --------------------------------------------------- */

.page-heading {
  padding: 20px 20px 7px;
}

.page-heading h1 {
  margin-top: 8px;
  font-size: clamp(30px, 8.5vw, 38px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.page-heading h1 span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.page-heading p {
  max-width: 340px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.explore-search {
  padding: 13px 20px 0;
}

.filter-row {
  display: flex;
  gap: 7px;
  padding: 13px 20px 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.scene-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px 20px 8px;
}

.scene-row {
  display: flex;
  width: 100%;
  align-items: stretch;
  gap: 12px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.scene-row:active {
  transform: scale(0.99);
}

.scene-row-img {
  position: relative;
  width: 105px;
  min-height: 112px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: var(--paper-deep);
}

.scene-row-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-row-level {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 6px;
  color: var(--white);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 99px;
  background: rgba(12, 35, 25, 0.56);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.scene-row-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 4px 3px 4px 0;
}

.scene-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.scene-row-top .done-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--forest-2);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.scene-row-body h3 {
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-row-zh {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.scene-row-summary {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.scene-row-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.scene-row-meta .icon {
  width: 11px;
  height: 11px;
}

.empty-inline {
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* AI conversation coach ------------------------------------ */

.app.no-nav.has-composer {
  padding-bottom: calc(118px + env(safe-area-inset-bottom));
}

.coach-entry {
  position: relative;
  margin: 18px 20px 0;
  padding: 16px;
  overflow: hidden;
  color: var(--white);
  border-radius: 23px;
  background:
    radial-gradient(circle at 92% 4%, rgba(232, 187, 102, 0.22), transparent 30%),
    linear-gradient(145deg, #1d4939, #123126);
  box-shadow: 0 16px 34px rgba(22, 60, 48, 0.18);
}

.coach-entry::after {
  content: "say";
  position: absolute;
  right: -6px;
  bottom: -30px;
  color: rgba(255, 253, 248, 0.035);
  font-family: var(--serif);
  font-size: 126px;
  font-style: italic;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.coach-entry-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coach-entry .kicker {
  color: var(--gold);
  font-size: 7.5px;
  letter-spacing: 0.14em;
}

.coach-entry .kicker::before {
  display: none;
}

.coach-voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 7.5px;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.coach-voice-pill .icon {
  width: 10px;
  height: 10px;
}

.coach-entry h2 {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.coach-entry > p {
  position: relative;
  z-index: 1;
  max-width: 345px;
  margin-top: 7px;
  color: rgba(255, 253, 248, 0.58);
  font-size: 9.5px;
  line-height: 1.6;
}

.coach-entry-form {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-top: 12px;
  padding: 7px 7px 7px 11px;
  border: 1px solid rgba(255, 253, 248, 0.12);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.075);
}

.coach-entry-form textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  max-height: 110px;
  flex: 1;
  padding: 4px 0;
  resize: none;
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  border: 0;
  outline: 0;
  background: transparent;
}

.coach-entry-form textarea::placeholder {
  color: rgba(255, 253, 248, 0.38);
  font-size: 11px;
}

.coach-entry-form button {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--forest);
  border: 0;
  border-radius: 11px;
  background: var(--gold);
}

.coach-entry-form button .icon {
  width: 16px;
  height: 16px;
}

.coach-entry-chips {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 5px;
  margin-top: 9px;
  padding-bottom: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.coach-entry-chips::-webkit-scrollbar {
  display: none;
}

.coach-entry-chips button {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 8px;
  border: 1px solid rgba(255, 253, 248, 0.13);
  border-radius: 999px;
  background: transparent;
}

.coach-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(11px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(24, 39, 31, 0.06);
  background: rgba(245, 239, 227, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.coach-topbar .round-icon-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 250, 242, 0.8);
}

.coach-topbar .round-icon-btn .icon {
  width: 17px;
  height: 17px;
}

.coach-top-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.coach-top-copy strong {
  font-size: 11.5px;
  font-weight: 700;
}

.coach-top-copy span {
  color: var(--muted);
  font-size: 8px;
}

.coach-top-voice {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  color: var(--forest);
  font-size: 8px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--forest-3);
}

.coach-finish {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--orange-dark);
  font-size: 8.5px;
  font-weight: 650;
  border: 1px solid rgba(230, 108, 62, 0.2);
  border-radius: 999px;
  background: rgba(245, 211, 194, 0.32);
}

.coach-page {
  padding: 21px 20px calc(28px + env(safe-area-inset-bottom));
}

.coach-setup-intro .kicker {
  color: var(--orange-dark);
}

.coach-setup-intro h1 {
  margin-top: 9px;
  font-size: clamp(31px, 8.4vw, 38px);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 1.12;
}

.coach-setup-intro h1 em {
  color: var(--orange-dark);
  font-family: var(--serif);
  font-size: 1.08em;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.coach-setup-intro p {
  max-width: 355px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.coach-topic-card {
  margin-top: 19px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.coach-topic-card label {
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.coach-topic-card textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  max-height: 160px;
  margin-top: 6px;
  padding: 0;
  resize: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  border: 0;
  outline: 0;
  background: transparent;
}

.coach-topic-card textarea::placeholder {
  color: var(--muted-2);
  font-size: 12px;
}

.coach-topic-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.coach-topic-examples button {
  padding: 5px 8px;
  color: var(--muted);
  font-size: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.coach-options {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 16px;
}

.coach-option-group > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.coach-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 14px;
  background: var(--paper-deep);
}

.coach-seg.compact {
  grid-template-columns: repeat(3, 1fr);
  max-width: 200px;
}

.coach-seg button {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.coach-seg button.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 3px 9px rgba(24, 39, 31, 0.08);
}

.coach-start-btn {
  display: flex;
  width: 100%;
  min-height: 51px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  border-radius: 15px;
  background: var(--forest);
  box-shadow: 0 11px 24px rgba(22, 60, 48, 0.18);
}

.coach-start-btn .icon {
  width: 15px;
  height: 15px;
}

.coach-setup-note {
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.coach-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 10px;
  color: var(--danger);
  font-size: 9px;
  line-height: 1.55;
  border: 1px solid rgba(182, 77, 53, 0.16);
  border-radius: 12px;
  background: rgba(245, 211, 194, 0.35);
}

.coach-error .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.coach-loading-page {
  display: flex;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}

.coach-loading-orb {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  color: var(--forest);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 10px rgba(232, 187, 102, 0.12);
  animation: coach-breathe 2.2s ease-in-out infinite;
}

.coach-loading-orb::after {
  content: "";
  position: absolute;
  inset: -17px;
  border: 1px solid rgba(232, 187, 102, 0.22);
  border-radius: 50%;
}

@keyframes coach-breathe {
  50% {
    transform: scale(1.04);
  }
}

.coach-loading-page h1 {
  max-width: 300px;
  margin-top: 24px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.coach-loading-page p {
  max-width: 300px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.coach-loading-dots {
  display: flex;
  gap: 4px;
  margin-top: 20px;
}

.coach-loading-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  animation: coach-dot 1s ease-in-out infinite;
}

.coach-loading-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.coach-loading-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes coach-dot {
  50% {
    opacity: 0.3;
    transform: translateY(-3px);
  }
}

.coach-loading-page small {
  margin-top: 17px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.coach-chat {
  padding-top: 15px;
  padding-bottom: 22px;
}

.coach-brief {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
}

.coach-brief summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--orange-dark);
  font-size: 8.5px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.coach-brief summary::-webkit-details-marker {
  display: none;
}

.coach-brief summary > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.coach-brief summary small {
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 500;
}

.coach-brief h2 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.coach-brief-en {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}

.coach-brief > p:nth-of-type(2) {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.coach-brief-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.coach-brief-roles span {
  padding: 4px 7px;
  color: var(--muted);
  font-size: 8px;
  border-radius: 999px;
  background: var(--paper);
}

.coach-brief-roles b {
  margin-right: 3px;
  color: var(--ink);
}

.coach-brief-goal {
  margin-top: 8px;
  padding: 7px 8px;
  color: var(--forest);
  font-size: 8.5px;
  line-height: 1.55;
  border-radius: 8px;
  background: var(--forest-3);
}

.coach-brief-targets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
}

.coach-brief-targets > span {
  width: 100%;
  color: var(--muted-2);
  font-size: 7.5px;
}

.coach-brief-targets button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}

.coach-brief-targets button .icon {
  width: 9px;
  height: 9px;
}

.coach-messages {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 17px;
}

.coach-msg {
  max-width: 92%;
}

.coach-msg.is-user {
  align-self: flex-end;
}

.coach-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.coach-msg.is-user .coach-msg-head {
  justify-content: flex-end;
  color: var(--orange-dark);
}

.coach-msg-head button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.coach-bubble {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  background: var(--card);
}

.coach-msg.is-user .coach-bubble {
  color: var(--white);
  border-color: var(--forest);
  border-radius: 16px 4px 16px 16px;
  background: var(--forest);
}

.coach-en {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.45;
}

.coach-msg.is-user .coach-bubble p {
  color: var(--white);
  font-size: 12.5px;
  line-height: 1.55;
}

.coach-zh {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.coach-card {
  margin-top: 7px;
  padding: 12px;
  border: 1px solid rgba(230, 108, 62, 0.14);
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(245, 211, 194, 0.35), rgba(255, 250, 242, 0.8));
}

.coach-card-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--orange-dark);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.coach-wanted {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.coach-expression {
  margin-top: 8px;
}

.coach-expression > span {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.coach-expression > div {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 3px;
}

.coach-expression p {
  flex: 1;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.4;
}

.coach-expression.advanced p {
  color: var(--muted);
  font-size: 13px;
}

.coach-expression button {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--forest);
  border: 1px solid rgba(22, 60, 48, 0.12);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.76);
}

.coach-chunks {
  margin-top: 9px;
  border-top: 1px solid rgba(230, 108, 62, 0.12);
}

.coach-chunk-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(230, 108, 62, 0.1);
}

.coach-chunk-row > div:first-child {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.coach-chunk-row b {
  font-family: var(--serif);
  font-size: 11.5px;
  font-weight: 500;
}

.coach-chunk-row span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.coach-chunk-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.coach-chunk-actions button {
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.coach-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.coach-correction {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(230, 108, 62, 0.12);
}

.coach-correction > span,
.coach-vocab > span {
  color: var(--orange-dark);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.coach-correction p {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.5;
}

.coach-correction del {
  color: var(--muted-2);
}

.coach-correction b {
  color: var(--ink);
  font-weight: 650;
}

.coach-correction small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.coach-vocab {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(230, 108, 62, 0.12);
}

.coach-vocab > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.coach-vocab button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  color: var(--forest);
  font-size: 8px;
  border: 1px solid rgba(22, 60, 48, 0.12);
  border-radius: 999px;
  background: var(--forest-3);
}

.coach-next-hint {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
}

.coach-composer {
  position: fixed;
  z-index: 47;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--app-w));
  padding: 8px 12px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(24, 39, 31, 0.09);
  background: rgba(246, 241, 232, 0.94);
  box-shadow: 0 -12px 30px rgba(24, 39, 31, 0.07);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.coach-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
}

.coach-help-chip {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 650;
  border: 1px solid rgba(230, 108, 62, 0.18);
  border-radius: 10px;
  background: rgba(245, 211, 194, 0.35);
}

.coach-composer textarea {
  display: block;
  width: 100%;
  min-height: 34px;
  max-height: 110px;
  flex: 1;
  padding: 7px 2px;
  resize: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  border: 0;
  outline: 0;
  background: transparent;
}

.coach-composer textarea::placeholder {
  color: var(--muted-2);
  font-size: 10px;
}

.coach-mic-btn,
.coach-send-btn {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
}

.coach-mic-btn {
  color: var(--forest);
  background: var(--forest-3);
}

.coach-send-btn {
  color: var(--white);
  background: var(--orange);
}

.coach-send-btn:disabled,
.coach-mic-btn:disabled {
  opacity: 0.4;
}

.coach-mic-btn .icon,
.coach-send-btn .icon {
  width: 15px;
  height: 15px;
}

.coach-composer-note {
  padding-top: 4px;
  color: var(--muted-2);
  font-size: 7px;
  text-align: center;
}

.coach-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
}

.coach-typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
  animation: coach-dot 1s ease-in-out infinite;
}

.coach-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.coach-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

.coach-review-page .kicker {
  margin-top: 6px;
}

.coach-review-page h1 {
  margin-top: 8px;
  font-size: clamp(30px, 8vw, 37px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.coach-review-page h1 em {
  color: var(--orange-dark);
  font-family: var(--serif);
  font-weight: 500;
}

.coach-review-topic {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.coach-review-band {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 17px;
  padding: 13px 14px;
  color: var(--white);
  border-radius: 16px;
  background: var(--forest);
}

.coach-review-band span {
  color: var(--gold);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.coach-review-band strong {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.coach-review-band small {
  color: rgba(255, 253, 248, 0.42);
  font-size: 7.5px;
}

.coach-review-overall {
  margin-top: 10px;
  padding: 12px 13px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.7;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.coach-review-section {
  margin-top: 17px;
}

.coach-review-section h2 {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
}

.coach-review-line {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.coach-review-line .icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--forest-2);
}

.coach-review-correction {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}

.coach-review-correction + .coach-review-correction {
  margin-top: 5px;
}

.coach-review-correction p {
  font-size: 9.5px;
  line-height: 1.5;
}

.coach-review-correction del {
  color: var(--muted-2);
}

.coach-review-correction b {
  font-weight: 650;
}

.coach-review-correction small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.coach-review-phrases {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.coach-review-phrases button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}

.coach-review-phrases span {
  flex: 1;
  font-family: var(--serif);
  font-size: 13px;
}

.coach-review-phrases small {
  color: var(--muted);
  font-size: 8px;
}

.coach-review-phrases .icon {
  color: var(--forest);
}

.coach-review-wordchips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.coach-review-wordchips button {
  padding: 5px 7px;
  color: var(--forest);
  font-size: 8.5px;
  border: 1px solid rgba(22, 60, 48, 0.12);
  border-radius: 999px;
  background: var(--forest-3);
}

.coach-next-step {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 18px;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  border-radius: 12px;
  background: var(--paper-deep);
}

.coach-next-step .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-dark);
}

.coach-review-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}

.coach-review-actions .primary-btn,
.coach-review-actions .ghost-btn {
  width: 100%;
}

.coach-review-home {
  padding: 8px;
  color: var(--muted);
  font-size: 9px;
  border: 0;
  background: transparent;
}

/* Office listening ------------------------------------------ */

.office-pill {
  color: var(--forest);
  border-color: rgba(22, 60, 48, 0.14);
  background: var(--forest-3);
}

.office-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 20px 0;
  padding: 14px;
  overflow: hidden;
  color: var(--white);
  text-decoration: none;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 10%, rgba(232, 187, 102, 0.22), transparent 30%),
    linear-gradient(135deg, #214b3a, var(--forest));
  box-shadow: 0 12px 28px rgba(22, 60, 48, 0.14);
  transition: transform 0.2s var(--ease);
}

.office-card:active {
  transform: scale(0.988);
}

.office-card-icon {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--forest);
  border-radius: 14px;
  background: var(--gold);
}

.office-card-icon .icon {
  width: 22px;
  height: 22px;
}

.office-card-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.office-card-copy small {
  color: rgba(255, 253, 248, 0.5);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.office-card-copy strong {
  font-size: 12.5px;
  font-weight: 650;
}

.office-card-copy > span {
  color: rgba(255, 253, 248, 0.57);
  font-size: 8.5px;
}

.office-card-arrow {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.office-card-arrow .icon {
  width: 14px;
  height: 14px;
}

.listen-head {
  padding: 20px 20px 0;
}

.listen-head h1 {
  margin-top: 8px;
  font-size: clamp(31px, 8.8vw, 38px);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

.listen-head h1 em {
  color: var(--orange-dark);
  font-family: var(--serif);
  font-size: 1.06em;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.listen-head > p {
  max-width: 350px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.listen-today {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 13px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
}

.listen-today span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.listen-today .icon {
  width: 11px;
  height: 11px;
  color: var(--forest-2);
}

.listen-today b {
  color: var(--ink);
  font-size: 10px;
}

.office-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  border: 1px solid rgba(22, 60, 48, 0.08);
  border-radius: 13px;
  background: rgba(219, 232, 223, 0.55);
}

.office-note .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--forest-2);
}

.office-note b {
  color: var(--forest);
  font-weight: 700;
}

.listen-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 17px 20px 0;
  padding: 4px;
  border-radius: 16px;
  background: var(--paper-deep);
}

.listen-mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  min-height: 49px;
  padding: 6px 3px;
  color: var(--muted);
  border: 0;
  border-radius: 12px;
  background: transparent;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.listen-mode-tab span {
  font-size: 11px;
  font-weight: 700;
}

.listen-mode-tab small {
  color: var(--muted-2);
  font-size: 7.5px;
  letter-spacing: 0.01em;
}

.listen-mode-tab.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 3px 10px rgba(24, 39, 31, 0.08);
}

.listen-mode-tab.is-active small {
  color: var(--orange-dark);
}

.listen-material {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 20px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 250, 242, 0.72);
}

.listen-material-img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper-deep);
}

.listen-material-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listen-material-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.listen-material-main small {
  color: var(--orange-dark);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.listen-material-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-material-main > span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-change {
  display: inline-flex;
  min-height: 31px;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}

.listen-change .icon {
  width: 11px;
  height: 11px;
}

.listen-generate {
  margin: 10px 20px 0;
  padding: 10px;
  border: 1px dashed rgba(230, 108, 62, 0.26);
  border-radius: 14px;
  background: rgba(245, 211, 194, 0.2);
}

.listen-generate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.listen-generate-head > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--orange-dark);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.listen-generate-head .icon {
  width: 11px;
  height: 11px;
}

.listen-generate-head small {
  color: var(--muted-2);
  font-size: 7.5px;
}

.listen-generate-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.listen-generate-form input {
  width: 100%;
  min-width: 0;
  flex: 1;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--card);
}

.listen-generate-form input::placeholder {
  color: var(--muted-2);
  font-size: 11px;
}

.listen-generate-form button {
  display: inline-flex;
  min-width: 55px;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  color: var(--white);
  font-size: 9px;
  font-weight: 650;
  border: 0;
  border-radius: 10px;
  background: var(--forest);
}

.listen-generate-form button:disabled {
  opacity: 0.55;
}

.listen-generate-form button .spinner {
  width: 10px;
  height: 10px;
  margin-right: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
}

.listen-generate-note {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 7.5px;
  line-height: 1.45;
}

.listen-stage {
  position: relative;
  margin: 14px 16px 0;
  padding: 14px;
  overflow: hidden;
  color: var(--white);
  border-radius: 25px;
  background:
    radial-gradient(circle at 88% 7%, rgba(232, 187, 102, 0.17), transparent 27%),
    linear-gradient(150deg, #1d4939 0%, #14392c 58%, #102e23 100%);
  box-shadow: 0 16px 36px rgba(22, 60, 48, 0.18);
  isolation: isolate;
}

.listen-stage::after {
  content: "ear";
  position: absolute;
  right: -6px;
  bottom: -36px;
  z-index: -1;
  color: rgba(255, 253, 248, 0.035);
  font-family: var(--serif);
  font-size: 170px;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.listen-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.listen-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.listen-mode-label .icon {
  width: 12px;
  height: 12px;
}

.listen-position {
  color: rgba(255, 253, 248, 0.42);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.listen-viz {
  display: flex;
  min-height: 87px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 7px;
}

.listen-orb {
  display: grid;
  width: 57px;
  height: 57px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--forest);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(232, 187, 102, 0.08);
}

.listen-orb .icon {
  width: 24px;
  height: 24px;
}

.listen-wave {
  display: flex;
  height: 50px;
  align-items: center;
  gap: 3px;
}

.listen-wave i {
  display: block;
  width: 2.5px;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 253, 248, 0.22);
  transition: background 0.2s;
}

.listen-wave i:nth-child(2n) {
  height: 16px;
}

.listen-wave i:nth-child(3n) {
  height: 29px;
}

.listen-wave i:nth-child(4n) {
  height: 20px;
}

.listen-wave i:nth-child(5n) {
  height: 38px;
}

.listen-wave i:nth-child(7n) {
  height: 11px;
}

.listen-viz.is-playing .listen-wave i {
  background: var(--gold);
  animation: listen-wave 0.82s ease-in-out infinite alternate;
}

.listen-viz.is-playing .listen-wave i:nth-child(2n) {
  animation-delay: 0.11s;
}

.listen-viz.is-playing .listen-wave i:nth-child(3n) {
  animation-delay: 0.23s;
}

.listen-viz.is-playing .listen-wave i:nth-child(4n) {
  animation-delay: 0.06s;
}

@keyframes listen-wave {
  from {
    transform: scaleY(0.38);
  }
  to {
    transform: scaleY(1.12);
  }
}

.listen-quote {
  min-height: 80px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.065);
}

.listen-quote p {
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(18px, 5vw, 21px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.42;
}

.listen-quote span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 253, 248, 0.5);
  font-size: 9.5px;
  line-height: 1.55;
}

.listen-blind {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  text-align: center;
  border: 1px dashed rgba(255, 253, 248, 0.16);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.035);
}

.listen-blind strong {
  color: rgba(255, 253, 248, 0.9);
  font-size: 12px;
  font-weight: 600;
}

.listen-blind span {
  color: rgba(255, 253, 248, 0.42);
  font-size: 8.5px;
  line-height: 1.5;
}

.listen-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 15px;
}

.listen-side {
  display: grid;
  width: 37px;
  height: 37px;
  padding: 0;
  place-items: center;
  color: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(255, 253, 248, 0.14);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.05);
}

.listen-side .icon {
  width: 16px;
  height: 16px;
}

.listen-main {
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 9px 24px rgba(230, 108, 62, 0.3);
  transition: transform 0.16s;
}

.listen-main:active {
  transform: scale(0.93);
}

.listen-main .icon {
  width: 21px;
  height: 21px;
}

.listen-main .icon use {
  pointer-events: none;
}

.listen-main .icon:not(.is-playing) {
  margin-left: 2px;
}

.listen-main.is-playing {
  background: var(--gold);
  color: var(--forest);
}

.listen-main.is-playing .icon {
  margin-left: 0;
}

.listen-subcontrols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.listen-option {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 8px;
  font-weight: 600;
  border: 1px solid rgba(255, 253, 248, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.04);
}

.listen-option .icon {
  width: 11px;
  height: 11px;
}

.listen-option b {
  font-weight: 700;
}

.listen-option.is-on {
  color: var(--gold);
  border-color: rgba(232, 187, 102, 0.34);
  background: rgba(232, 187, 102, 0.1);
}

.listen-option.is-starred {
  color: var(--gold);
  border-color: rgba(232, 187, 102, 0.34);
  background: rgba(232, 187, 102, 0.1);
}

.listen-option.is-starred .icon {
  fill: currentColor;
}

.listen-play-wide {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
  border: 0;
  border-radius: 13px;
  background: var(--gold);
}

.listen-play-wide .icon {
  width: 16px;
  height: 16px;
}

.listen-play-wide.is-playing {
  background: var(--card);
}

.listen-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.listen-progress > span {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 253, 248, 0.12);
}

.listen-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}

.listen-progress small {
  color: rgba(255, 253, 248, 0.38);
  font-size: 7.5px;
}

.listen-full-text {
  max-height: 260px;
  margin-top: 12px;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.04);
}

.listen-full-line {
  display: flex;
  gap: 9px;
  padding: 7px 3px;
  border-bottom: 1px solid rgba(255, 253, 248, 0.07);
}

.listen-full-line:last-child {
  border-bottom: 0;
}

.listen-full-line > span {
  color: rgba(255, 253, 248, 0.32);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}

.listen-full-line p {
  color: rgba(255, 253, 248, 0.86);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.4;
}

.listen-full-line small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 253, 248, 0.38);
  font-size: 8px;
}

.listen-full-line.is-current p {
  color: var(--gold);
}

.dictation-card {
  margin-top: 14px;
  padding: 12px;
  color: var(--ink);
  border-radius: 17px;
  background: var(--card);
}

.dictation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dictation-head > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
}

.dictation-head .icon {
  width: 12px;
  height: 12px;
  color: var(--orange-dark);
}

.dictation-head small {
  color: var(--muted-2);
  font-size: 7.5px;
}

.dictation-card textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  margin-top: 9px;
  padding: 10px;
  resize: vertical;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--paper);
}

.dictation-card textarea::placeholder {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 11px;
}

.dictation-card textarea:focus {
  border-color: rgba(230, 108, 62, 0.5);
}

.dictation-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.dictation-actions .primary-btn {
  min-height: 42px;
  flex: 1;
  font-size: 11px;
  border-radius: 12px;
}

.dictation-actions .pill-btn {
  min-height: 42px;
  font-size: 9px;
}

.dictation-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.dictation-score {
  display: flex;
  align-items: baseline;
  color: var(--orange-dark);
}

.dictation-score strong {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1;
}

.dictation-score small {
  font-size: 10px;
  font-weight: 700;
}

.dictation-verdict {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dictation-verdict b {
  font-size: 11px;
  font-weight: 650;
}

.dictation-verdict span {
  color: var(--muted);
  font-size: 8.5px;
}

.dictation-missing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.dictation-missing > span {
  margin-right: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.dictation-missing b {
  padding: 2px 6px;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--orange-soft);
}

.dictation-answer {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--paper);
}

.dictation-answer > span {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.dictation-answer p {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
}

.dictation-answer small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.listen-sentence-block {
  margin: 14px 20px 0;
}

.listen-sentence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.listen-sentence-head small {
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 400;
}

.listen-sentence-strip {
  display: flex;
  gap: 6px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.listen-sentence-strip::-webkit-scrollbar {
  display: none;
}

.listen-sentence-dot {
  position: relative;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 250, 242, 0.56);
}

.listen-sentence-dot.is-current {
  color: var(--white);
  border-color: var(--forest);
  background: var(--forest);
}

.listen-sentence-dot.is-starred::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
}

.listen-sentence-dot.is-current.is-starred::after {
  background: var(--gold);
}

.listen-starred-block {
  margin: 20px 20px 0;
}

.listen-starred-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.listen-starred-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 250, 242, 0.6);
}

.listen-star-number {
  color: var(--orange-dark);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
}

.listen-star-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.listen-star-copy b {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-star-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-starred-row > .icon {
  color: var(--muted-2);
}

.listen-method {
  margin: 22px 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.55);
}

.listen-method > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.listen-method .kicker {
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.listen-method h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.listen-method-steps {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

.listen-method-steps > div {
  flex: 1;
}

.listen-method-steps b {
  display: block;
  margin-bottom: 5px;
  color: var(--orange);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

.listen-method-steps p {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.listen-method-steps strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 650;
}

.listen-source-note {
  display: flex;
  gap: 7px;
  margin: 18px 20px 0;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
  border-radius: 12px;
  background: var(--paper-deep);
}

.listen-source-note .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-dark);
}

.listen-source-panel {
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

.listen-source-title {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.listen-source-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.listen-source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 52vh;
  margin-top: 13px;
  overflow-y: auto;
}

.listen-source-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 7px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}

.listen-source-option.is-current {
  border-color: rgba(230, 108, 62, 0.32);
  background: #fff6eb;
}

.listen-source-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 9px;
  background: var(--paper-deep);
}

.listen-source-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listen-source-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.listen-source-main small {
  color: var(--muted-2);
  font-size: 7px;
}

.listen-source-main b {
  margin-top: 1px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-source-main > span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-source-arrow {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted-2);
}

.listen-source-option.is-current .listen-source-arrow {
  color: var(--forest);
}

/* Words ----------------------------------------------------- */

.words-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 20px 6px;
}

.words-count {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.85;
}

.words-count b {
  color: var(--orange);
  font-weight: inherit;
}

.words-summary-copy {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.words-summary-copy strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.words-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 20px 5px;
}

.words-toolbar .chip {
  padding: 6px 10px;
}

.word-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px 8px;
}

.word-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.word-row:active {
  border-color: rgba(230, 108, 62, 0.28);
  background: #fff6eb;
}

.word-row-main {
  min-width: 0;
  flex: 1;
}

.word-row-word {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.word-row-word h3 {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-row-word span {
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
}

.word-row-zh {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-row-source {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.word-row-source i {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 5px 2px;
  border-radius: 50%;
  background: currentColor;
}

.speak-btn {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--forest);
  border: 1px solid rgba(22, 60, 48, 0.12);
  border-radius: 50%;
  background: var(--forest-3);
  transition: transform 0.15s;
}

.speak-btn:active {
  transform: scale(0.9);
}

.speak-btn .icon {
  width: 16px;
  height: 16px;
}

.empty-state {
  margin: 22px 20px;
  padding: 38px 25px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.45);
}

.empty-illustration {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 15px;
  place-items: center;
  color: var(--forest);
  border-radius: 24px;
  background: var(--forest-3);
  transform: rotate(-5deg);
}

.empty-illustration .icon {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 7px auto 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.words-tip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 17px 20px 0;
  padding: 12px 13px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
  border-radius: 15px;
  background: var(--paper-deep);
}

.words-tip .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-dark);
}

/* Profile / progress --------------------------------------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 20px 4px;
}

.profile-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--card);
  font-family: var(--serif);
  font-size: 29px;
  font-style: italic;
  border-radius: 50%;
  background:
    radial-gradient(circle at 68% 24%, rgba(232, 187, 102, 0.8), transparent 22%),
    var(--forest);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.12);
}

.profile-copy {
  min-width: 0;
}

.profile-copy h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.profile-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.profile-badge .icon {
  width: 10px;
  height: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  padding: 16px 20px 0;
}

.stat-card {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.stat-card.dark {
  color: var(--card);
  border-color: var(--forest);
  background: var(--forest);
}

.stat-card.orange {
  color: var(--forest);
  border-color: rgba(230, 108, 62, 0.18);
  background: var(--orange-soft);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.stat-card.dark .stat-label {
  color: rgba(255, 250, 242, 0.62);
}

.stat-card.orange .stat-label {
  color: rgba(22, 60, 48, 0.66);
}

.stat-label .icon {
  width: 12px;
  height: 12px;
}

.stat-value {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.stat-value small {
  margin-left: 3px;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.stat-note {
  position: absolute;
  right: 11px;
  bottom: 10px;
  color: var(--muted-2);
  font-size: 8px;
}

.stat-card.dark .stat-note {
  color: rgba(255, 250, 242, 0.45);
}

.stat-card.orange .stat-note {
  color: rgba(22, 60, 48, 0.45);
}

.chart-block {
  margin: 23px 20px 0;
}

.chart-card {
  padding: 15px 15px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chart-head h2 {
  font-size: 13px;
  font-weight: 680;
}

.chart-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.chart-total {
  color: var(--muted);
  font-size: 8.5px;
  text-align: right;
}

.chart-total strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 98px;
  margin-top: 15px;
  padding-top: 8px;
}

.bar-col {
  display: flex;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.bar-col .bar {
  width: 100%;
  max-width: 22px;
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: var(--paper-deep);
  transition: height 0.5s var(--ease);
}

.bar-col.has-data .bar {
  background: linear-gradient(180deg, var(--orange), #ef9a6e);
}

.bar-col.today .bar {
  background: var(--forest);
}

.bar-col small {
  color: var(--muted-2);
  font-size: 7.5px;
}

.bar-col.today small {
  color: var(--ink);
  font-weight: 700;
}

.history-block {
  margin: 23px 20px 0;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.history-head h2 {
  font-size: 14px;
  font-weight: 680;
}

.history-head span {
  color: var(--muted-2);
  font-size: 9px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.62);
}

.history-thumb {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-main {
  min-width: 0;
  flex: 1;
}

.history-main h3 {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main p {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
}

.history-time {
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
}

.history-done {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
  background: var(--forest-2);
}

.history-done .icon {
  width: 9px;
  height: 9px;
  stroke-width: 2.5;
}

.history-listen {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--forest);
  border-radius: 50%;
  background: var(--forest-3);
}

.history-listen .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2;
}

.history-ai-row {
  cursor: default;
}

.history-ai-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--forest);
  border-radius: 10px;
  background: var(--gold);
}

.history-ai-icon .icon {
  width: 16px;
  height: 16px;
}

.history-ai-row .history-time {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-block {
  margin: 24px 20px 0;
}

.settings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.setting-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--forest);
  border-radius: 9px;
  background: var(--paper-deep);
}

.setting-icon .icon {
  width: 14px;
  height: 14px;
}

.setting-label h3 {
  font-size: 10.5px;
  font-weight: 650;
}

.setting-label p {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
}

.setting-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.mini-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--paper);
}

.mini-seg button {
  padding: 5px 8px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  border: 0;
  border-radius: 7px;
  background: transparent;
}

.mini-seg button.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 7px rgba(24, 39, 31, 0.08);
}

.install-card {
  position: relative;
  margin: 22px 20px 0;
  padding: 16px;
  overflow: hidden;
  color: var(--white);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--forest-2), var(--forest));
}

.install-card::after {
  content: "";
  position: absolute;
  top: -35px;
  right: -35px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.install-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.install-icon {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--forest);
  border-radius: 11px;
  background: var(--gold);
}

.install-icon .icon {
  width: 19px;
  height: 19px;
}

.install-head h3 {
  font-size: 12px;
  font-weight: 680;
}

.install-head p {
  margin-top: 2px;
  color: rgba(255, 253, 248, 0.58);
  font-size: 8.5px;
}

.install-steps {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  padding: 0;
  color: rgba(255, 253, 248, 0.68);
  font-size: 9px;
  line-height: 1.7;
  list-style: none;
}

.install-steps li {
  display: flex;
  gap: 7px;
}

.install-steps b {
  color: var(--gold);
  font-weight: 700;
}

.danger-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  border: 0;
  background: transparent;
}

.app-footnote {
  padding: 25px 20px 4px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Bottom nav ------------------------------------------------ */

.bottom-nav {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, var(--app-w));
  grid-template-columns: repeat(5, 1fr);
  padding: 7px 5px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(24, 39, 31, 0.08);
  background: rgba(247, 242, 233, 0.91);
  box-shadow: 0 -12px 30px rgba(28, 47, 38, 0.055);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
}

.nav-item {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 5px 2px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  background: transparent;
  transition: color 0.18s, background 0.18s;
}

.nav-icon-wrap {
  display: grid;
  width: 44px;
  height: 27px;
  place-items: center;
  border-radius: 99px;
  transition: background 0.18s, color 0.18s;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

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

.nav-item.is-active .nav-icon-wrap {
  color: var(--white);
  background: var(--forest);
}

.nav-item.is-active .icon {
  stroke-width: 2;
}

/* Study ----------------------------------------------------- */

.study-page {
  min-height: 100vh;
  padding-bottom: 25px;
  background:
    radial-gradient(circle at 88% 6%, rgba(232, 187, 102, 0.14), transparent 24%),
    var(--paper);
}

.study-nav {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(11px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(24, 39, 31, 0.06);
  background: rgba(245, 239, 227, 0.87);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.study-nav .round-icon-btn {
  width: 38px;
  height: 38px;
  background: rgba(255, 250, 242, 0.82);
}

.study-nav .round-icon-btn .icon {
  width: 18px;
  height: 18px;
}

.study-progress-wrap {
  min-width: 0;
  flex: 1;
}

.study-progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.study-progress-labels b {
  color: var(--ink);
  font-weight: 650;
}

.study-progress-track {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(24, 39, 31, 0.1);
}

.study-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  transition: width 0.35s var(--ease);
}

.study-nav-tag {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.study-nav-tag .icon {
  width: 11px;
  height: 11px;
}

.study-cover {
  position: relative;
  height: 218px;
  margin: 8px 16px 0;
  overflow: hidden;
  color: var(--white);
  border-radius: 24px;
  background: var(--forest);
  isolation: isolate;
}

.study-cover > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.study-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(9, 27, 19, 0.04) 10%, rgba(9, 27, 19, 0.78) 100%);
}

.study-cover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 13px 0;
}

.cover-badge {
  padding: 4px 8px;
  color: var(--white);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(12, 35, 25, 0.32);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.cover-level {
  padding: 4px 8px;
  color: var(--forest);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: var(--gold);
}

.study-cover-bottom {
  position: absolute;
  right: 17px;
  bottom: 15px;
  left: 17px;
}

.study-cover-bottom .cover-kicker {
  color: rgba(255, 253, 248, 0.74);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 8px rgba(8, 23, 17, 0.48);
}

.study-cover-bottom h1 {
  max-width: 360px;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.study-cover-bottom p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: rgba(255, 253, 248, 0.78);
  font-size: 10.5px;
}

.study-cover-bottom p::before {
  content: "";
  width: 11px;
  height: 1px;
  background: var(--gold);
}

.study-toolbar {
  padding: 14px 16px 0;
}

.subtitle-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 14px;
  background: var(--paper-deep);
}

.subtitle-switch button {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: transparent;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.subtitle-switch button.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 3px 10px rgba(24, 39, 31, 0.08);
}

.study-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

.study-option-btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.52);
}

.study-option-btn .icon {
  width: 13px;
  height: 13px;
}

.follow-switch {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 7px 5px 10px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.52);
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.follow-switch .icon {
  width: 13px;
  height: 13px;
}

.follow-switch.is-on {
  color: var(--forest);
  border-color: rgba(22, 60, 48, 0.12);
  background: var(--forest-3);
}

.switch-track {
  position: relative;
  width: 27px;
  height: 16px;
  border-radius: 999px;
  background: rgba(24, 39, 31, 0.16);
  transition: background 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s var(--ease);
}

.follow-switch.is-on .switch-track {
  background: var(--forest);
}

.follow-switch.is-on .switch-track::after {
  transform: translateX(11px);
}

.immersion-note {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  border-radius: 12px;
  background: var(--paper-deep);
}

.immersion-note .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--orange-dark);
}

.study.mode-none .immersion-note {
  display: flex;
}

.study.mode-none .pointer-hint {
  display: none;
}

.pointer-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 13px 16px 0;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  border-radius: 12px;
  background: rgba(245, 211, 194, 0.45);
}

.pointer-hint .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-dark);
}

.pointer-hint b {
  color: var(--orange-dark);
  font-weight: 650;
}

.dialogue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 18px 2px;
}

.dialogue-head h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dialogue-head h2 span {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 500;
}

.dialogue-head button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  border: 0;
  background: transparent;
}

.dialogue-head button .icon {
  width: 11px;
  height: 11px;
}

.dialogue {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 9px 16px 0;
}

.line {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 12px 11px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.55);
  scroll-margin-top: 90px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.line.active {
  border-color: rgba(230, 108, 62, 0.28);
  background: var(--card);
  box-shadow: 0 13px 28px rgba(28, 47, 38, 0.08);
}

.line.active::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: -1px;
  width: 2px;
  border-radius: 99px;
  background: var(--orange);
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  border-radius: 50%;
}

.avatar.a {
  color: var(--forest-2);
  background: var(--forest-3);
}

.avatar.b {
  color: #8d3f22;
  background: var(--orange-soft);
}

.line-main {
  min-width: 0;
  flex: 1;
}

.speaker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.speaker {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.now-dot {
  display: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(230, 108, 62, 0.14);
}

.line.active .now-dot {
  display: block;
}

.line-play {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  margin: -5px -4px -2px 0;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.line.active .line-play {
  color: var(--orange-dark);
  background: rgba(230, 108, 62, 0.1);
}

.line-play .icon {
  width: 12px;
  height: 12px;
}

.line .en {
  margin-top: 3px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.45;
}

.line .zh {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.line .en .word {
  display: inline;
  margin: 0;
  padding: 0 0 1px;
  color: inherit;
  font: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  border: 0;
  border-bottom: 1px dotted rgba(24, 39, 31, 0.22);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.line .en .word:active,
.line .en .word:focus-visible {
  color: var(--orange-dark);
  border-bottom-color: var(--orange);
  background: rgba(245, 211, 194, 0.46);
}

.line .en .word.saved {
  border-bottom-color: rgba(230, 108, 62, 0.75);
  background: linear-gradient(180deg, transparent 64%, rgba(245, 211, 194, 0.7) 64%);
}

.study.mode-none .line .en,
.study.mode-none .line .zh {
  display: none;
}

.study.mode-en .line .zh {
  display: none;
}

.wave-bars {
  display: none;
  height: 31px;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
}

.study.mode-none .wave-bars {
  display: flex;
}

.wave-bars i {
  display: block;
  width: 2.5px;
  height: 8px;
  border-radius: 99px;
  background: rgba(24, 39, 31, 0.18);
}

.wave-bars i:nth-child(2n) {
  height: 15px;
}

.wave-bars i:nth-child(3n) {
  height: 21px;
}

.wave-bars i:nth-child(4n) {
  height: 11px;
}

.wave-bars i:nth-child(5n) {
  height: 25px;
}

.line.active .wave-bars i {
  background: rgba(230, 108, 62, 0.58);
  animation: wave 0.85s ease-in-out infinite alternate;
}

.line.active .wave-bars i:nth-child(2n) {
  animation-delay: 0.12s;
}

.line.active .wave-bars i:nth-child(3n) {
  animation-delay: 0.24s;
}

.line.active .wave-bars i:nth-child(4n) {
  animation-delay: 0.06s;
}

@keyframes wave {
  from {
    transform: scaleY(0.48);
  }
  to {
    transform: scaleY(1.1);
  }
}

.line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.line-mini-btn {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}

.line-mini-btn .icon {
  width: 10px;
  height: 10px;
}

.line-mini-btn.follow {
  color: var(--forest);
  border-color: rgba(22, 60, 48, 0.12);
  background: rgba(219, 232, 223, 0.6);
}

.line-mini-btn.followed {
  color: var(--white);
  border-color: var(--forest);
  background: var(--forest);
}

.follow-count {
  color: var(--muted-2);
  font-size: 8px;
}

.finish-card {
  margin: 20px 16px 0;
  padding: 17px;
  color: var(--white);
  border-radius: 21px;
  background:
    radial-gradient(circle at 88% 10%, rgba(232, 187, 102, 0.2), transparent 30%),
    var(--forest);
}

.finish-card .finish-overline {
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.finish-card h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.finish-card p {
  margin-top: 5px;
  color: rgba(255, 253, 248, 0.62);
  font-size: 9.5px;
  line-height: 1.6;
}

.finish-card button {
  width: 100%;
  margin-top: 12px;
}

/* Play bar -------------------------------------------------- */

.playbar {
  position: fixed;
  z-index: 46;
  bottom: 0;
  left: 50%;
  display: flex;
  width: min(100%, var(--app-w));
  align-items: center;
  gap: 11px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  color: var(--white);
  border-radius: 23px 23px 0 0;
  background: rgba(21, 52, 41, 0.97);
  box-shadow: 0 -12px 32px rgba(10, 28, 20, 0.22);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.play-main {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 7px 18px rgba(230, 108, 62, 0.25);
  transition: transform 0.15s;
}

.play-main:active {
  transform: scale(0.93);
}

.play-main .icon {
  width: 18px;
  height: 18px;
}

.play-main.is-playing .icon {
  width: 15px;
  height: 15px;
}

.play-main .play-triangle {
  margin-left: 2px;
}

.play-info {
  min-width: 0;
  flex: 1;
}

.play-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.play-overline {
  color: rgba(255, 253, 248, 0.45);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.play-count {
  color: rgba(255, 253, 248, 0.45);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.play-label {
  margin-top: 1px;
  overflow: hidden;
  color: rgba(255, 253, 248, 0.92);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-track {
  height: 2px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
}

.play-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.25s var(--ease);
}

.playbar-extra {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: transparent;
}

.playbar-extra .icon {
  width: 14px;
  height: 14px;
}

.playbar-extra span {
  color: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Word sheet & overlays ------------------------------------- */

.sheet-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(8, 24, 17, 0.56);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet-panel {
  width: min(100%, var(--app-w));
  max-height: 92vh;
  overflow-y: auto;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 27px 27px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 60px rgba(8, 24, 17, 0.25);
  animation: sheet-up 0.32s var(--ease) both;
}

@keyframes sheet-up {
  from {
    opacity: 0.4;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sheet-grab {
  width: 36px;
  height: 4px;
  margin: 0 auto 15px;
  border-radius: 99px;
  background: rgba(24, 39, 31, 0.16);
}

.sheet-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-kicker {
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.sheet-close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.sheet-close .icon {
  width: 13px;
  height: 13px;
}

.word-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

.word-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(38px, 12vw, 50px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

.word-title .saved-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0 7px 6px;
  border-radius: 50%;
  background: var(--orange);
}

.big-speak {
  display: grid;
  width: 51px;
  height: 51px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(22, 60, 48, 0.2);
  transition: transform 0.16s;
}

.big-speak:active {
  transform: scale(0.92);
}

.big-speak .icon {
  width: 21px;
  height: 21px;
}

.word-ipa {
  margin-top: 6px;
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

.word-meaning {
  margin-top: 14px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
  border-left: 2px solid var(--orange);
  border-radius: 0 12px 12px 0;
  background: rgba(245, 211, 194, 0.4);
}

.word-context {
  margin-top: 13px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.word-context-label {
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.word-context p {
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
}

.word-context span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.word-origin {
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.word-origin b {
  color: var(--muted);
  font-weight: 600;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.sheet-actions .primary-btn {
  flex: 1;
  min-height: 49px;
}

.sheet-actions .ghost-btn {
  flex: 0 0 auto;
  min-height: 49px;
  color: var(--muted);
  font-size: 11px;
}

.sheet-note {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.lookup-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Follow sheet ---------------------------------------------- */

.follow-panel {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.follow-target {
  margin-top: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
}

.follow-target .speaker-row {
  margin-bottom: 5px;
}

.follow-target p {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.42;
}

.follow-target span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
}

.follow-listen-row {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.follow-listen-row .pill-btn {
  flex: 1;
  font-size: 10px;
}

.follow-stage {
  margin-top: 17px;
  text-align: center;
}

.mic-orb {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 12px 30px rgba(230, 108, 62, 0.24);
}

.mic-orb::before,
.mic-orb::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(230, 108, 62, 0.28);
  border-radius: 50%;
  animation: mic-ring 2.4s ease-out infinite;
}

.mic-orb::after {
  animation-delay: 0.9s;
}

.mic-orb .icon {
  width: 31px;
  height: 31px;
}

.mic-orb.recording {
  background: var(--danger);
}

@keyframes mic-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.85);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

.follow-stage-title {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 650;
}

.follow-stage-note {
  max-width: 310px;
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.follow-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.follow-primary {
  width: 100%;
  min-height: 50px;
}

.follow-secondary {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.follow-result {
  margin-top: 16px;
  text-align: center;
}

.score-ring {
  display: grid;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orange) var(--score), var(--paper-deep) 0);
}

.score-inner {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
}

.score-inner strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.score-inner small {
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.follow-result h3 {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 680;
}

.follow-result p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.missed-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}

.missed-words span {
  padding: 3px 7px;
  color: var(--orange-dark);
  font-size: 8px;
  border-radius: 999px;
  background: var(--orange-soft);
}

.audio-review {
  margin-top: 13px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.audio-review audio {
  display: block;
  width: 100%;
  height: 36px;
}

.recording-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.follow-tip {
  display: flex;
  gap: 7px;
  margin-top: 15px;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
  border-radius: 12px;
  background: var(--paper-deep);
}

.follow-tip .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-dark);
}

/* Search modal ---------------------------------------------- */

.modal-screen {
  position: fixed;
  z-index: 90;
  inset: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 82% 4%, rgba(232, 187, 102, 0.18), transparent 25%),
    var(--paper);
  animation: modal-up 0.34s var(--ease) both;
}

@keyframes modal-up {
  from {
    opacity: 0.5;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-inner {
  width: 100%;
  max-width: var(--app-w);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(13px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-top h1 {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.modal-close {
  display: grid;
  width: 37px;
  height: 37px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.68);
}

.modal-close .icon {
  width: 16px;
  height: 16px;
}

.search-modal-head {
  padding-top: 28px;
}

.search-modal-head .kicker {
  color: var(--orange-dark);
}

.search-modal-head h2 {
  max-width: 360px;
  margin-top: 8px;
  font-size: 29px;
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.2;
  text-wrap: balance;
}

.search-modal-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.big-search-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 10px 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.big-search-form .field {
  flex: 1;
  min-width: 0;
}

.big-search-form label {
  display: block;
  color: var(--muted-2);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.big-search-form textarea {
  display: block;
  width: 100%;
  min-height: 25px;
  max-height: 90px;
  margin-top: 3px;
  padding: 0;
  resize: none;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.45;
  border: 0;
  outline: 0;
  background: transparent;
}

.big-search-form textarea::placeholder {
  color: var(--muted-2);
}

.big-search-submit {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 12px;
  background: var(--forest);
}

.big-search-submit .icon {
  width: 16px;
  height: 16px;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.suggestion-chip {
  padding: 6px 9px;
  color: var(--muted);
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.48);
}

.search-results {
  padding-top: 23px;
}

.results-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.results-label b {
  color: var(--orange-dark);
  font-weight: 700;
}

.best-match {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: var(--forest);
  box-shadow: var(--shadow-card);
}

.best-match-image {
  position: relative;
  height: 190px;
  overflow: hidden;
}

.best-match-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.best-match-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(14, 39, 28, 0.78));
}

.match-badge {
  position: absolute;
  z-index: 1;
  top: 11px;
  right: 11px;
  padding: 5px 9px;
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: var(--gold);
}

.match-reason {
  position: absolute;
  z-index: 1;
  bottom: 10px;
  left: 13px;
  color: rgba(255, 253, 248, 0.7);
  font-size: 8px;
}

.best-match-body {
  padding: 14px 15px 15px;
  color: var(--white);
}

.best-match-body h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.best-match-body p {
  margin-top: 4px;
  color: rgba(255, 253, 248, 0.65);
  font-size: 10px;
}

.best-match-meta {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  color: rgba(255, 253, 248, 0.5);
  font-size: 8px;
}

.best-match-body .primary-btn {
  width: 100%;
  min-height: 45px;
  margin-top: 12px;
  color: var(--forest);
  background: var(--card);
  box-shadow: none;
}

.alt-results {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}

.alt-result {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.alt-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
}

.alt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alt-main {
  min-width: 0;
  flex: 1;
}

.alt-main h4 {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alt-main p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
}

.alt-score {
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}

.search-empty {
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.4);
}

.search-empty .icon {
  width: 27px;
  height: 27px;
  margin: 0 auto 10px;
  color: var(--orange-dark);
}

.search-empty h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.search-empty p {
  max-width: 290px;
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.browse-link {
  margin-top: 11px;
  padding: 8px 12px;
  color: var(--forest);
  font-size: 10px;
  font-weight: 650;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
}

/* Completion ------------------------------------------------ */

.complete-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  color: var(--white);
  background: var(--forest);
  isolation: isolate;
}

.complete-bg {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.17;
  filter: saturate(0.7);
}

.complete-page::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 80% 12%, rgba(232, 187, 102, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(17, 49, 37, 0.25), var(--forest) 68%);
}

.complete-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.complete-brand {
  color: var(--white);
  font-family: var(--serif);
  font-size: 27px;
  font-style: italic;
  letter-spacing: -0.06em;
}

.complete-brand b {
  color: var(--gold);
  font-weight: inherit;
}

.complete-close {
  display: grid;
  width: 37px;
  height: 37px;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.complete-close .icon {
  width: 15px;
  height: 15px;
}

.complete-main {
  padding-top: 38px;
}

.complete-check {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  color: var(--forest);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 9px rgba(232, 187, 102, 0.1);
  animation: pop-in 0.6s var(--ease) both;
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.complete-check .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.complete-main .complete-kicker {
  margin-top: 22px;
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.complete-title {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: clamp(48px, 14vw, 67px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

.complete-sub {
  max-width: 330px;
  margin-top: 10px;
  color: rgba(255, 253, 248, 0.63);
  font-size: 11px;
  line-height: 1.65;
}

.complete-sub b {
  color: var(--white);
  font-weight: 650;
}

.complete-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.11);
}

.complete-stat {
  padding: 13px 12px;
  background: rgba(17, 46, 35, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.complete-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.complete-stat strong small {
  margin-left: 3px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.complete-stat span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 253, 248, 0.42);
  font-size: 7.5px;
  letter-spacing: 0.03em;
}

.challenge-card {
  margin-top: 15px;
  padding: 16px;
  color: var(--ink);
  border-radius: 20px;
  background: var(--card);
}

.challenge-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--orange-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.challenge-label .icon {
  width: 11px;
  height: 11px;
}

.challenge-card h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.challenge-card > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.sample-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--paper);
}

.sample-line p {
  flex: 1;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
}

.sample-line button {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-radius: 50%;
  background: var(--forest);
}

.sample-line button .icon {
  width: 12px;
  height: 12px;
}

.complete-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.complete-actions .primary-btn {
  width: 100%;
}

.complete-secondary {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: transparent;
}

.complete-foot {
  margin-top: 23px;
  color: rgba(255, 253, 248, 0.28);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-align: center;
}

.complete-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.complete-words span {
  padding: 3px 7px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Toast ----------------------------------------------------- */

.toast-root {
  position: fixed;
  z-index: 200;
  top: calc(15px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(calc(100% - 32px), 370px);
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  color: var(--white);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(20, 48, 37, 0.95);
  box-shadow: 0 9px 26px rgba(8, 24, 17, 0.26);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.22s, transform 0.22s var(--ease);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast .icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

/* Small screen tweaks --------------------------------------- */

@media (max-width: 600px) {
  /* iOS will zoom the whole page when a form control under 16px receives focus.
     Keep the control at 16px, but let placeholders stay visually light. */
  .search-form input,
  .big-search-form textarea {
    font-size: 16px;
  }

  .search-form input::placeholder,
  .big-search-form textarea::placeholder {
    font-size: 14px;
  }

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

@media (max-width: 370px) {
  .home-intro {
    padding-right: 17px;
    padding-left: 17px;
  }

  .scene-hero {
    margin-right: 13px;
    margin-left: 13px;
  }

  .hero-title {
    font-size: 32px;
  }

  .scene-hero {
    height: 310px;
  }

  .home-search-block,
  .resume-block,
  .chart-block,
  .history-block,
  .settings-block,
  .install-card {
    margin-right: 17px;
    margin-left: 17px;
  }

  .scene-rail {
    padding-right: 17px;
    padding-left: 17px;
  }

  .how-card {
    margin-right: 17px;
    margin-left: 17px;
  }

  .line {
    padding-right: 10px;
    padding-left: 10px;
  }

  .line .en {
    font-size: 16px;
  }
}

@media (min-width: 720px) {
  .app {
    border-radius: 0;
  }

  .bottom-nav {
    border-radius: 0;
  }
}

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