:root {
  --ink: #161616;
  --muted: #6f695f;
  --paper: #eee9df;
  --card: #fffdf8;
  --line: rgba(33, 28, 22, 0.1);
  --orange: #d88a0b;
  --orange-dark: #b46f00;
  --green: #75aa88;
  --green-dark: #2d6c56;
  --blue: #2848b8;
  --cream: #f6eedc;
  --shadow: 0 20px 48px rgba(48, 38, 25, 0.13);
  --radius: 26px;
}

/* Theme switcher shared by auth, desktop nav, and profile. */
.auth-brand {
  justify-content: space-between;
  gap: 14px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.theme-switch button {
  min-width: 54px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #615d55;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

body[data-skin="prism"] .theme-switch button.active,
body[data-skin="prism"][data-view] .web-nav .theme-switch button.active {
  color: #fff;
  background: #111;
}

body[data-skin="studio"] .theme-switch {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

body[data-skin="studio"] .theme-switch button {
  color: #d7d0c5;
}

body[data-skin="studio"] .theme-switch button.active,
body[data-skin="studio"][data-view] .web-nav .theme-switch button.active {
  color: #111;
  background: #dbff4a;
}

.web-nav .theme-switch {
  flex: 0 0 auto;
}

.web-nav .theme-switch button {
  min-height: 34px;
  padding: 0 12px;
}

.profile-theme-row {
  align-items: center;
}

.profile-theme-row .theme-switch {
  box-shadow: none;
}

@media (max-width: 520px) {
  .theme-switch-auth {
    transform: scale(0.92);
    transform-origin: right center;
  }

  .profile-theme-row {
    gap: 14px;
  }
}

body[data-skin="studio"] .course-mastery-card { border-color: #3b423e; background: #171b19; color: #f7f6f1; }
body[data-skin="studio"] .course-mastery-card p { color: #aeb5b0; }
body[data-skin="studio"] .course-mastery-card li { background: #242a27; }
body[data-skin="studio"] .course-mastery-card li.is-done { background: #173d2c; }

/* Production legal, consent and account lifecycle surfaces. */
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  padding: 20px 16px;
  color: var(--muted, #6e6a64);
  font-size: 13px;
}

.legal-footer button,
.legal-footer a {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.legal-footer button:hover,
.legal-footer a:hover {
  color: var(--ink, #111);
  text-decoration: underline;
}

.support-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(110px, calc(env(safe-area-inset-bottom) + 100px));
  z-index: 90;
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  color: #111;
  background: #dbff4a;
  box-shadow: 0 14px 34px rgba(22, 22, 22, 0.18);
  font-size: 14px;
  font-weight: 900;
}

.support-fab:hover {
  transform: translateY(-1px);
}

.support-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: end center;
  padding: 20px;
  background: rgba(10, 10, 12, 0.42);
  backdrop-filter: blur(12px);
}

.support-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 26px;
  color: #161616;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.2);
}

.support-dialog h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.support-dialog p {
  margin: 14px 0 0;
  color: #676057;
  line-height: 1.7;
}

.support-contact {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #2c2a25;
  background: rgba(17, 17, 17, 0.06);
  font-weight: 900;
  line-height: 1.55;
}

.support-wechat-card {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 22px;
  background: rgba(17, 17, 17, 0.04);
}

.support-qr-frame {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.08);
}

.support-qr-frame img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.support-wechat-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.support-wechat-info span,
.support-wechat-info small {
  color: #676057;
  font-size: 13px;
  font-weight: 800;
}

.support-wechat-info b {
  overflow-wrap: anywhere;
  color: #111;
  font-size: 24px;
  line-height: 1.15;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.support-actions .green-btn,
.support-actions .dark-btn {
  width: auto;
  min-width: 132px;
}

.support-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #111;
  background: rgba(17, 17, 17, 0.08);
  font-size: 22px;
  font-weight: 900;
}

body[data-skin="studio"] .support-fab {
  border-color: rgba(255, 255, 255, 0.12);
  color: #111;
  background: #dbff4a;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}

body[data-skin="studio"] .support-dialog {
  border-color: rgba(255, 255, 255, 0.12);
  color: #f7f2e8;
  background: rgba(23, 24, 29, 0.96);
}

body[data-skin="studio"] .support-dialog p {
  color: rgba(247, 242, 232, 0.72);
}

body[data-skin="studio"] .support-contact {
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.1);
}

body[data-skin="studio"] .support-wechat-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

body[data-skin="studio"] .support-wechat-info span,
body[data-skin="studio"] .support-wechat-info small {
  color: rgba(247, 242, 232, 0.68);
}

body[data-skin="studio"] .support-wechat-info b {
  color: #f7f2e8;
}

body[data-skin="studio"] .support-close {
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.1);
}

@media (min-width: 900px) {
  .support-fab {
    right: 28px;
    bottom: 28px;
  }

  .support-overlay {
    place-items: end end;
    padding: 28px;
  }
}

@media (max-width: 520px) {
  body[data-view="home"] .support-fab,
  body[data-view="paths"] .support-fab,
  body[data-view="path"] .support-fab,
  body[data-view="profile"] .support-fab {
    display: none;
  }

  .support-fab {
    right: 14px;
    bottom: 98px;
    bottom: calc(98px + env(safe-area-inset-bottom));
    min-width: 54px;
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  .support-dialog {
    padding: 24px 20px 20px;
    border-radius: 22px;
  }

  .support-dialog h2 {
    font-size: 26px;
  }

  .support-actions {
    display: grid;
  }

  .support-actions .green-btn,
  .support-actions .dark-btn {
    width: 100%;
  }

  .support-wechat-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .support-qr-frame {
    width: 178px;
    height: 178px;
  }
}

.legal-page {
  min-height: 100vh;
  padding: 24px;
  background: var(--page, #f4efe6);
}

.legal-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 980px;
  margin: 0 auto 18px;
}

.legal-document {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background: var(--surface, #fffdf8);
  color: var(--ink, #111);
}

.legal-document h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.legal-document h2 {
  margin: 28px 0 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.legal-document p {
  margin: 0;
  color: var(--muted, #5f5b55);
  line-height: 1.8;
}

.legal-document .legal-version {
  color: var(--muted, #77716a);
  font-size: 13px;
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted, #5f5b55);
  font-size: 14px;
  line-height: 1.6;
}

.legal-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.legal-consent button {
  appearance: none;
  border: 0;
  padding: 0;
  color: #075ed8;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.danger-zone {
  margin: 18px 0;
  padding: 22px;
  border: 1px solid #efb8b8;
  border-radius: 8px;
  background: #fff7f7;
}

.danger-zone h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0;
}

.danger-zone p {
  margin: 0;
  color: #735858;
  line-height: 1.6;
}

.danger-zone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.danger-zone-row input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #d8baba;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
}

.danger-btn {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: #a31212;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 620px) {
  .legal-page {
    padding: 12px;
  }

  .legal-document {
    padding: 22px 18px;
  }

  .danger-zone-row {
    grid-template-columns: 1fr;
  }
}

.ai-quota-line {
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  color: #5f5b55;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  padding: 12px 16px;
}

.ai-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.bubble.pending {
  opacity: 0.72;
}

body[data-skin="studio"] .ai-quota-line {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 720px) {
  .ai-thread {
    max-height: 36vh;
  }

  .ai-quota-line {
    border-radius: 18px;
    font-size: 13px;
  }
}

* {
  box-sizing: border-box;
}

body {
  overscroll-behavior: none;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(216, 138, 11, 0.14), transparent 32%),
    radial-gradient(circle at 90% 16%, rgba(117, 170, 136, 0.16), transparent 34%),
    linear-gradient(180deg, #f6f3ec 0%, var(--paper) 100%);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.auth-page {
  width: min(1180px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 52px;
}

.auth-brand {
  display: flex;
  align-items: center;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.brand img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 16px;
}

.brand.small img {
  width: 46px;
  height: 46px;
}

.brand b,
.brand small {
  display: block;
}

.brand b {
  font-size: 22px;
  line-height: 1;
}

.brand small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: start;
  padding-top: 34px;
}

.welcome-card,
.login-card,
.feature-card,
.video-card,
.filter-panel,
.sentence-card,
.tool-card,
.ai-chat,
.profile-list,
.empty-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.welcome-card,
.login-card {
  padding: clamp(26px, 5vw, 48px);
}

.welcome-card.compact {
  min-height: 420px;
}

.welcome-card h1,
.login-card h2,
.feature-body h1,
.feature-body h2,
.simple-top h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-weight: 500;
  letter-spacing: 0;
}

.welcome-card h1,
.login-card h2 {
  font-size: clamp(34px, 5vw, 48px);
}

.welcome-card p,
.login-card p,
.feature-body p,
.simple-top p,
.tool-card p {
  color: var(--muted);
  line-height: 1.85;
}

.soft-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.soft-card b,
.login-card label span {
  font-weight: 900;
}

.soft-card span {
  color: var(--muted);
  line-height: 1.7;
}

.login-card {
  display: grid;
  gap: 18px;
}

.login-card label {
  display: grid;
  gap: 9px;
}

.login-card input,
.ai-chat textarea {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

.password-wrap {
  position: relative;
}

.password-wrap button {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
  border-radius: 50%;
  color: var(--muted);
  background: #f3f0ea;
}

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

.dark-btn,
.gold-btn,
.blue-btn,
.green-btn,
.logout-btn {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 28px;
  color: #fff;
  font-weight: 900;
}

.dark-btn {
  min-width: 132px;
  background: #1b1b1a;
}

.gold-btn {
  width: 100%;
  background: var(--orange);
}

.blue-btn {
  width: 100%;
  background: var(--blue);
}

.green-btn {
  width: 100%;
  background: #17be6b;
}

.link-btn {
  color: #1646b6;
  background: transparent;
  font-weight: 900;
}

.register-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.pill-btn {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--blue);
  background: #e9efff;
  font-weight: 900;
}

.mobile-shell {
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 16px 92px;
}

.home-top,
.library-top,
.study-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 14px;
}

.round-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(48, 38, 25, 0.08);
  font-weight: 900;
}

.feature-card {
  overflow: hidden;
  margin-bottom: 18px;
}

.mock-video,
.chat-mock {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  color: #fff;
  background: #1f160d;
}

.mock-video img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  opacity: 0.62;
}

.mock-video span,
.chat-mock span {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mock-video b {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}

.chat-mock {
  min-height: 180px;
  padding: 70px 18px 18px;
  background: linear-gradient(135deg, #12244c, #1c3372);
}

.chat-mock p,
.chat-mock b {
  display: block;
  max-width: 280px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-mock p {
  background: rgba(255, 255, 255, 0.14);
}

.chat-mock b {
  margin-left: auto;
  background: rgba(70, 105, 255, 0.9);
}

.feature-body {
  padding: 22px 18px 18px;
}

.feature-body h1,
.feature-body h2 {
  font-size: 34px;
}

.tags,
.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tags span,
.meta-tags span,
.meta-tags b {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #f2eee5;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.meta-tags b {
  color: var(--orange-dark);
  background: #fff1d8;
}

.meta-tags .locked-tag {
  color: #8a4d12;
  background: #fff0d7;
}

.meta-tags .open-tag {
  color: #236b4c;
  background: #e7f5ec;
}

.feature-body .sub {
  margin-top: 10px;
}

.ai-feature {
  background: #fff;
}

.bottom-nav,
.study-toolbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(430px, 100vw);
  min-height: 66px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.bottom-nav button,
.study-toolbar button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #8a8377;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.bottom-nav i,
.study-toolbar i {
  font-style: normal;
  font-size: 19px;
}

.bottom-nav button.active,
.study-toolbar button.active {
  color: var(--ink);
}

.library-top {
  margin-bottom: 12px;
}

.library-top > div {
  min-width: 0;
  flex: 1;
}

.library-top h1 {
  margin: 0;
  font-size: 22px;
}

.library-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.quick-tabs button,
.filter-row button {
  min-height: 38px;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-weight: 900;
}

.quick-tabs button.active,
.filter-row button.active {
  color: #fff;
  background: var(--ink);
}

.filter-panel {
  display: none;
  margin-bottom: 14px;
  padding: 14px;
  box-shadow: none;
}

.filter-panel.open {
  display: grid;
  gap: 12px;
}

.filter-panel label {
  display: grid;
  gap: 6px;
}

.filter-panel label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.filter-panel input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-row.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-row.scroll button {
  white-space: nowrap;
}

.course-list {
  display: grid;
  gap: 16px;
}

.video-card {
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(48, 38, 25, 0.1);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ddd;
}

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

.duration-pill {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-weight: 900;
}

.membership-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #1f372b;
  background: rgba(255, 246, 221, 0.92);
  font-size: 12px;
  font-weight: 900;
}

.membership-pill.locked {
  color: #fff;
  background: rgba(24, 24, 24, 0.76);
}

.video-card.locked .thumb img {
  filter: saturate(0.82) brightness(0.72);
}

.heart {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  font-size: 21px;
}

.heart.on {
  color: #ff5e7a;
  background: rgba(255, 255, 255, 0.86);
}

.video-info {
  padding: 15px 16px 17px;
}

.video-info h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.video-info p {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: #34312e;
  line-height: 1.65;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-progress {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.course-progress i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #67b889, #f0b35f);
}

.course-progress::before {
  content: "";
  display: block;
  height: 7px;
  margin-bottom: -14px;
  border-radius: 999px;
  background: #eee5d6;
}

.course-progress span {
  color: #5b5144;
  font-size: 12px;
  font-weight: 900;
}

.study-shell {
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 78px;
  background: #f6f5f2;
}

.study-primary {
  min-width: 0;
}

.course-mastery-card {
  margin: 10px 12px 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  border: 1px solid #d9d6ce;
  border-radius: 18px;
  background: #fffdf8;
}

.course-mastery-card > div > span { color: #178c5b; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.course-mastery-card h2 { margin: 5px 0; font-size: 19px; }
.course-mastery-card p { max-width: 590px; margin: 0; color: #6f6b63; font-size: 12px; line-height: 1.55; }
.course-mastery-card ul { margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; list-style: none; }
.course-mastery-card li { min-width: 72px; padding: 9px 10px; border-radius: 12px; background: #efede7; text-align: center; }
.course-mastery-card li b, .course-mastery-card li span { display: block; }
.course-mastery-card li b { font-size: 17px; }
.course-mastery-card li span { margin-top: 2px; color: #77736b; font-size: 9px; }
.course-mastery-card li.is-done { background: #dcf5e8; color: #08784a; }
.course-mastery-card > button { grid-column: 1 / -1; min-height: 42px; border: 0; border-radius: 999px; background: #111; color: #fff; font-weight: 900; cursor: pointer; }
.course-mastery-card > button:disabled { background: #d9d6ce; color: #8b877f; cursor: not-allowed; }
.course-mastery-card.is-ready { border-color: #178c5b; box-shadow: 4px 4px 0 #dfff22; }
.course-mastery-card.is-complete { background: #e8f7ef; }

@media (max-width: 520px) {
  .course-mastery-card { grid-template-columns: 1fr; }
  .course-mastery-card ul { justify-content: stretch; }
  .course-mastery-card li { flex: 1; }
}

.study-top {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.study-top h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.study-video {
  position: relative;
  background: #111;
}

.study-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.study-video img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.preview-placeholder img {
  filter: saturate(0.88) brightness(0.66);
}

.study-video span {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.64);
  font-weight: 900;
}

.preview-banner {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #2e261a;
  background: rgba(255, 244, 213, 0.94);
  font-size: 12px;
  line-height: 1.4;
}

.locked-hero {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1e1e1e;
}

.locked-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) brightness(0.55);
}

.locked-hero span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-weight: 900;
}

.sentence-area {
  display: grid;
  gap: 10px;
  padding: 10px 8px 16px;
}

.sentence-card {
  padding: 14px;
  box-shadow: none;
}

.sentence-card.active {
  border-color: rgba(117, 170, 136, 0.78);
  background: #f4fff8;
}

.sentence-card b {
  display: block;
  font-size: 17px;
  line-height: 1.5;
}

.sentence-card p {
  margin: 8px 0 0;
  color: #38332d;
  line-height: 1.65;
}

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

.sentence-actions span {
  min-width: 24px;
  color: var(--muted);
  font-weight: 900;
}

.sentence-actions button {
  width: 24px;
  height: 24px;
  color: var(--ink);
  background: transparent;
}

.study-toolbar {
  grid-template-columns: 1fr 72px 1fr 1fr;
}

.play-main {
  place-self: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff !important;
  background: #19bf6f !important;
  font-size: 20px !important;
}

.tool-card,
.ai-chat,
.profile-list,
.continue-card,
.empty-card {
  padding: 18px;
  box-shadow: none;
}

.tool-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.upgrade-note {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 14px;
  background: #fff9ec;
  line-height: 1.6;
}

.upgrade-note span {
  color: var(--muted);
}

.upgrade-actions {
  display: grid;
  gap: 10px;
}

.lookup-source {
  padding: 10px 12px;
  border-radius: 14px;
  color: #4f4639;
  background: #fffaf1;
  font-size: 13px;
  line-height: 1.55;
}

.word-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.word-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f5f0e8;
  text-align: left;
}

.word-card span {
  display: grid;
  gap: 2px;
}

.word-card b {
  font-size: 15px;
}

.word-card small {
  color: var(--muted);
  font-size: 11px;
}

.word-card em {
  max-width: 150px;
  color: #276f51;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.word-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: #f6f4ef;
}

.word-empty b {
  font-size: 15px;
}

.word-empty small {
  color: var(--muted);
  line-height: 1.45;
}

.course-word-card {
  grid-template-columns: minmax(0, 1fr);
}

.course-word-card em,
.course-word-card small {
  max-width: none;
  text-align: left;
}

.course-word-sentence {
  font-weight: 800;
}

.course-word-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.course-word-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #151515;
  background: #fff;
  font-weight: 900;
}

.plan-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.continue-card {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.continue-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.continue-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.continue-card p {
  margin: 0;
  color: #4a4238;
  font-weight: 900;
}

.plan-list button {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fffaf1;
  text-align: left;
}

.plan-list button.active {
  border-color: rgba(117, 170, 136, 0.82);
  background: #eefaf2;
}

.plan-list span {
  color: var(--muted);
  line-height: 1.45;
}

.practice-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.practice-steps span {
  padding: 12px;
  border-radius: 14px;
  background: #f5f0e8;
  font-weight: 900;
}

.simple-top {
  padding: 18px 2px 12px;
}

.simple-top h1 {
  font-size: 36px;
}

.ai-chat {
  display: grid;
  gap: 12px;
}

.bubble {
  width: fit-content;
  max-width: 88%;
  padding: 13px 15px;
  border-radius: 18px;
  line-height: 1.6;
}

.bubble.user {
  margin-left: auto;
  color: #fff;
  background: var(--blue);
}

.bubble.bot {
  background: #f3eee5;
}

.ai-chat textarea {
  min-height: 118px;
  padding: 14px;
  resize: vertical;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-head img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.profile-list article {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.profile-list article:last-child {
  border-bottom: 0;
}

.logout-btn {
  width: 100%;
  margin-top: 16px;
  background: var(--ink);
}

/* Profile playlist */
.profile-playlist {
  display: grid;
  gap: 0;
  margin: 14px 0 18px;
  padding: 0 20px 12px;
  border: 1px solid rgba(33, 28, 22, 0.1);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(48, 38, 25, 0.07);
}

.profile-playlist.collapsed {
  padding-bottom: 0;
}

.profile-playlist.collapsed .profile-section-head {
  border-bottom-color: transparent;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
}

.profile-playlist-toggle {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--green-dark);
  background: rgba(117, 170, 136, 0.12);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.profile-playlist-items[hidden],
.playlist-panel .pl-list[hidden] {
  display: none !important;
}

.profile-section-head b {
  flex: 1 1 auto;
  font-size: 15px;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-mode-btn,
.pl-clear-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.pl-mode-btn {
  color: #514b43;
  background: #f2eee5;
}

.pl-clear-btn {
  color: #b33;
  background: rgba(187, 51, 51, 0.08);
  margin-left: 6px;
}

.profile-playlist-items {
  display: grid;
  gap: 0;
}

.profile-playlist-item {
  display: grid;
  grid-template-columns: 28px 56px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pl-drag-handle {
  width: 28px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #8f8a80;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pl-drag-handle:hover,
.pl-drag-handle:focus-visible {
  color: var(--green-dark);
  background: rgba(117, 170, 136, 0.14);
}

.pl-drag-handle:active,
.playlist-is-dragging .pl-drag-handle {
  cursor: grabbing;
}

.pl-order-controls {
  display: inline-grid;
  grid-template-columns: repeat(2, 28px);
  gap: 3px;
  flex: 0 0 auto;
}

.pl-order-controls button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--green-dark);
  background: rgba(117, 170, 136, 0.13);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.pl-order-controls button:disabled {
  opacity: 0.28;
  cursor: default;
}

[data-playlist-item] {
  position: relative;
  transition: opacity 140ms ease, transform 140ms ease, background-color 140ms ease;
}

[data-playlist-item].dragging {
  opacity: 0.42;
}

[data-playlist-item].drop-before::before,
[data-playlist-item].drop-after::after {
  position: absolute;
  right: 8px;
  left: 8px;
  z-index: 3;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  content: "";
  pointer-events: none;
}

[data-playlist-item].drop-before::before { top: -2px; }
[data-playlist-item].drop-after::after { bottom: -2px; }

.profile-playlist-item:last-child {
  border-bottom: 0;
}

.profile-playlist-item.current {
  background: rgba(216, 255, 47, 0.06);
  border-radius: 8px;
}

.pl-thumb {
  width: 56px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--frost);
  cursor: pointer;
  padding: 0;
}

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

.pl-no-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 9px;
  color: #999;
}

.pl-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pl-title-btn {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-info span {
  font-size: 11px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-remove-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: #999;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pl-remove-btn:hover,
.pl-remove-btn:active {
  color: #b33;
  background: rgba(187, 51, 51, 0.08);
}

.pl-empty-hint {
  margin: 0;
  padding: 20px 0;
  color: #999;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.pl-empty-hint b {
  color: #666;
  font-weight: 900;
}

@media (min-width: 760px) {
  .mobile-shell,
  .study-shell,
  .bottom-nav,
  .study-toolbar {
    width: 430px;
  }

  .mobile-shell,
  .study-shell {
    box-shadow: 0 0 0 1px var(--line), var(--shadow);
  }
}

@media (max-width: 720px) {
  .auth-page {
    width: min(100vw - 20px, 430px);
    padding-top: 16px;
  }

  .auth-brand {
    display: none;
  }

  .auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 0 34px;
  }

  .welcome-card,
  .login-card {
    padding: 23px 22px;
  }

  .welcome-card h1,
  .login-card h2 {
    font-size: 32px;
  }

  .register-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 2026-06-20 plain learning-site pass: closer to the purchased system layout. */
:root {
  --ink: #111318;
  --muted: #6b7280;
  --paper: #f5f6f8;
  --card: #ffffff;
  --line: rgba(17, 24, 39, 0.1);
  --green: #1fc070;
  --green-dark: #097a48;
  --blue: #2f5be7;
  --orange: #d98b12;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

.auth-page,
.mobile-shell,
.study-shell {
  width: min(430px, 100vw);
  margin: 0 auto;
  background: #f5f6f8;
  box-shadow: none;
}

.auth-page {
  min-height: 100vh;
  padding: 16px 14px 28px;
}

.auth-brand {
  height: auto;
  padding: 8px 0 18px;
}

.brand img,
.brand.small img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand b {
  font-size: 19px;
}

.brand small {
  margin-top: 3px;
  font-size: 11px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 0;
}

.welcome-card,
.login-card,
.feature-card,
.video-card,
.filter-panel,
.sentence-card,
.tool-card,
.ai-chat,
.profile-list,
.continue-card,
.empty-card,
.home-entry,
.home-continue,
.home-note {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.welcome-card,
.login-card {
  padding: 20px;
}

.welcome-card h1,
.login-card h2,
.feature-body h1,
.feature-body h2,
.simple-top h1,
.plain-home-top h1 {
  font-family: inherit;
  font-weight: 900;
}

.welcome-card h1,
.login-card h2 {
  font-size: 26px;
}

.welcome-card p,
.login-card p,
.feature-body p,
.simple-top p,
.tool-card p {
  line-height: 1.65;
}

.soft-card {
  border-radius: 12px;
  padding: 13px;
  background: #f8fafc;
}

.login-card {
  gap: 14px;
}

.login-card input,
.ai-chat textarea,
.filter-panel input {
  min-height: 44px;
  border-radius: 10px;
}

.dark-btn,
.gold-btn,
.blue-btn,
.green-btn,
.logout-btn,
.pill-btn {
  min-height: 44px;
  border-radius: 10px;
}

.mobile-shell {
  min-height: 100vh;
  padding: 12px 12px 78px;
}

.plain-home-top,
.home-top,
.library-top,
.simple-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 0 14px;
}

.plain-home-top h1,
.library-top h1,
.simple-top h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.plain-home-top p,
.library-top p,
.simple-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.menu-dot,
.round-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #111827;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.home-entry-list {
  display: grid;
  gap: 12px;
}

.home-entry,
.home-continue,
.home-note {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  position: relative;
  background-size: cover;
  background-position: center;
}

.home-continue::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0,0,0,0.55), rgba(0,0,0,0.3));
  z-index: 0;
}

.home-continue > * {
  position: relative;
  z-index: 1;
}

.home-entry span,
.home-continue span,
.home-note b {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-continue span {
  color: #d8ff2f;
}

.home-continue h2 {
  color: #fff;
}

.home-continue p {
  color: rgba(255,255,255,0.78);
}

.home-entry b,
.home-continue h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.home-entry em,
.home-continue p,
.home-note span {
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
}

.home-entry.muted span {
  color: #4056bb;
}

.home-note {
  margin-top: 12px;
  padding: 14px 16px;
}

.quick-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 10px;
}

.quick-tabs button {
  min-height: 38px;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-weight: 900;
}

.quick-tabs button.active {
  color: #fff;
  background: #111827;
}

.filter-panel {
  display: none;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
}

.filter-panel.open {
  display: grid;
}

.filter-row {
  gap: 7px;
}

.filter-row button {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  background: #f2f4f7;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.filter-row button.active {
  color: #fff;
  background: #111827;
}

.course-list {
  gap: 12px;
}

.video-card {
  overflow: hidden;
  border-radius: 14px;
  box-shadow: none;
}

.thumb {
  aspect-ratio: 16 / 9;
}

.heart {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.duration-pill,
.membership-pill {
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 12px;
}

.video-info {
  padding: 13px 14px 14px;
}

.video-info h2 {
  font-size: 16px;
  line-height: 1.35;
}

.video-info p {
  margin-top: 8px;
  color: #374151;
  line-height: 1.55;
}

.tags,
.meta-tags {
  gap: 7px;
  margin: 12px 0 0;
}

.tags span,
.meta-tags span,
.meta-tags b {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f2f4f7;
  font-size: 12px;
}

.course-progress {
  margin-top: 10px;
}

.study-shell {
  min-height: 100vh;
  padding-bottom: 74px;
}

.study-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 7px 10px;
  background: #fff;
}

.study-top h1 {
  font-size: 17px;
  font-weight: 900;
}

.study-video {
  background: #111;
}

.study-video span {
  top: 9px;
  right: 9px;
  border-radius: 8px;
  font-size: 13px;
}

.sentence-area {
  gap: 9px;
  padding: 9px 8px 18px;
}

.sentence-card {
  padding: 13px;
  border-radius: 12px;
}

.sentence-card.active {
  border-color: #20b96c;
  background: #f3fff8;
}

.sentence-card b {
  font-size: 16px;
  line-height: 1.45;
}

.sentence-card p {
  margin-top: 7px;
  line-height: 1.55;
}

.sentence-actions {
  margin-top: 9px;
  gap: 13px;
}

.bottom-nav,
.study-toolbar {
  height: 66px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: none;
}

.study-toolbar {
  grid-template-columns: 1fr 1fr 64px 1fr 1fr;
}

.play-main {
  width: 52px;
  height: 52px;
  background: #20c675 !important;
}

.bottom-nav button,
.study-toolbar button {
  color: #4b5563;
  font-size: 12px;
}

.bottom-nav button.active,
.study-toolbar button.active {
  color: #111827;
}

.tool-card,
.ai-chat,
.profile-list,
.continue-card,
.empty-card {
  padding: 15px;
}

.tool-card h2 {
  font-size: 20px;
}

.word-list button,
.plan-list button {
  border-radius: 12px;
  background: #f8fafc;
}

.profile-head {
  grid-template-columns: auto 1fr;
}

.profile-head img {
  width: 48px;
  height: 48px;
}

@media (min-width: 700px) {
  .auth-page {
    width: min(900px, calc(100vw - 40px));
  }

  .auth-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* 2026-06-20 launch reset: simple user-facing site, aligned with the reference flow. */
:root {
  --ink: #151515;
  --muted: #6b6862;
  --paper: #eeeae2;
  --card: #ffffff;
  --line: rgba(20, 20, 20, 0.1);
  --orange: #d48906;
  --blue: #2547ba;
  --green: #138a55;
  --shadow: 0 12px 30px rgba(35, 31, 25, 0.08);
  --radius: 20px;
}

body {
  background: linear-gradient(180deg, #f3efe7 0%, #ece8df 100%);
  color: var(--ink);
}

.auth-page,
.mobile-shell,
.study-shell {
  width: min(100vw, 430px);
  margin: 0 auto;
  background: transparent;
}

.auth-page {
  min-height: 100vh;
  padding: 16px 10px 34px;
}

.auth-brand {
  padding: 0 8px 14px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 0;
}

.welcome-card,
.login-card,
.entry-card,
.video-card,
.ai-chat,
.profile-list,
.continue-card,
.empty-card,
.search-card,
.study-meta,
.tool-card,
.sentence-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: none;
}

.welcome-card,
.login-card {
  padding: 22px;
}

.welcome-card h1,
.login-card h2 {
  margin: 0;
  color: #171717;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 31px;
  font-weight: 500;
  line-height: 1.18;
}

.welcome-card p,
.login-card p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.soft-card {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
}

.soft-card span {
  color: #333;
}

.login-card {
  gap: 15px;
}

.login-card input,
.search-card input,
.ai-chat textarea {
  min-height: 50px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 12px;
  background: #fff;
}

.code-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sms-code-btn {
  min-width: 132px;
  padding: 0 18px;
  white-space: nowrap;
}

.sms-code-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.dark-btn,
.gold-btn,
.blue-btn,
.green-btn,
.logout-btn,
.pill-btn {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 900;
}

.dark-btn {
  background: #171717;
}

.gold-btn {
  color: #fff;
  background: var(--orange);
}

.blue-btn {
  color: #fff;
  background: var(--blue);
}

.green-btn {
  color: #fff;
  background: var(--green);
}

.link-btn {
  color: #184fc6;
  font-weight: 900;
  background: transparent;
}

.mobile-shell {
  min-height: 100vh;
  padding: 16px 16px 86px;
}

.plain-home-top,
.library-top,
.simple-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 0 16px;
}

.library-top {
  grid-template-columns: auto minmax(0, 1fr);
}

.plain-home-top h1,
.library-top h1,
.simple-top h1 {
  margin: 0;
  color: #111;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.18;
}

.plain-home-top p,
.library-top p,
.simple-top p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.menu-dot,
.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 900;
}

.home-continue {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-bottom: 16px;
  padding: 16px 18px;
  text-align: left;
}

.home-continue span,
.continue-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-continue h2,
.continue-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.home-continue p,
.continue-card p {
  margin: 0;
  color: var(--muted);
}

.home-card-list {
  display: grid;
  gap: 18px;
}

.entry-card {
  overflow: hidden;
}

.entry-cover {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 180px;
  padding: 18px;
  color: #fff;
  background: #1d120b;
}

.entry-cover span {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.entry-cover b {
  align-self: end;
  font-size: 24px;
}

.video-cover {
  background:
    linear-gradient(135deg, rgba(31, 18, 7, 0.96), rgba(70, 38, 17, 0.85)),
    url("assets/brand/suzy-english-academy-logo.png") center / 120px no-repeat;
}

.ai-cover {
  background: linear-gradient(135deg, #0b1d4f, #263eb2);
}

.entry-body {
  padding: 20px 18px 18px;
}

.entry-body h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 29px;
  font-weight: 500;
}

.entry-body p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.entry-tags,
.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.entry-tags span,
.meta-tags span,
.meta-tags b {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  color: #55514b;
  background: #f3f0ea;
  font-size: 13px;
  font-weight: 800;
}

.search-card {
  margin-bottom: 12px;
  padding: 10px;
}

.search-card input {
  width: 100%;
  padding: 0 14px;
}

.topic-tabs {
  display: flex;
  gap: 8px;
  margin: 0 -16px 14px;
  padding: 0 16px 2px;
  overflow-x: auto;
}

.topic-tabs button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 999px;
  color: #4f4a43;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.topic-tabs button.active {
  color: #fff;
  background: #171717;
}

.category-menu {
  position: relative;
  z-index: 25;
  display: flex;
  gap: 10px;
  margin: 0 -16px 16px;
  padding: 0 16px 4px;
  overflow-x: auto;
  overflow-y: visible;
}

.category-menu > button,
.category-item > button {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 15px;
  color: #4f4a43;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(50, 42, 32, 0.06);
}

.category-menu > button small,
.category-item > button small {
  color: #8a8174;
  font-size: 11px;
}

.category-menu > button.active,
.category-item > button.active,
.category-item:hover > button,
.category-item:focus-within > button {
  color: #fff;
  background: #171717;
}

.category-menu > button.active small,
.category-item > button.active small,
.category-item:hover > button small,
.category-item:focus-within > button small {
  color: rgba(255, 255, 255, 0.75);
}

.category-item {
  position: relative;
  flex: 0 0 auto;
}

.category-item:hover,
.category-item:focus-within,
.category-item.menu-open {
  z-index: 80;
}

.category-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 90;
  display: none;
  width: min(460px, calc(100vw - 32px));
  height: min(560px, 62vh);
  border: 1px solid rgba(45, 38, 29, 0.12);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  color: #211d19;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(37, 31, 24, 0.18);
}

.category-item:hover .category-panel,
.category-item:focus-within .category-panel,
.category-item.menu-open .category-panel {
  display: block;
}

.category-drill {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.category-drill-track {
  display: flex;
  height: 100%;
  transform: translateX(calc(var(--drill-index, 0) * -100%));
  transition: transform 220ms ease;
  will-change: transform;
}

.category-drill-page {
  display: flex;
  min-width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 12px;
}

.category-panel-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid #eee7dc;
}

.category-panel-head b {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-panel-head span {
  color: #7a7166;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.category-back {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #211d19;
  background: #f3eee6;
  font-size: 20px;
  font-weight: 900;
}

.category-drill-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-row {
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  color: #28231e;
  background: transparent;
  text-align: left;
}

.menu-row.has-children {
  grid-template-columns: minmax(0, 1fr) auto 16px;
}

.menu-row:hover,
.menu-row:focus,
.menu-row.active {
  background: #f4efe7;
}

.menu-row > span,
.menu-row b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-row > span {
  min-width: 0;
  font-size: 15px;
  font-weight: 850;
}

.menu-row b {
  font-size: 13px;
  line-height: 1.35;
}

.menu-row small {
  color: #7a7166;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.menu-row.has-children::after {
  content: ">";
  color: #7a7166;
  font-size: 15px;
  font-weight: 900;
}

.course-row {
  grid-template-columns: 1fr;
}

.course-list {
  display: grid;
  gap: 14px;
}

.video-card {
  overflow: hidden;
  text-align: left;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1d1d1d;
}

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

.poster-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  align-content: end;
  gap: 8px;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(35, 107, 76, 0.92), rgba(28, 37, 51, 0.94)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255, 255, 255, 0.08) 14px 16px);
}

.poster-fallback b {
  font-size: 18px;
  line-height: 1.15;
}

.poster-fallback span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.duration-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.queue-add {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  padding: 0;
  color: #fff;
  background: rgba(117, 170, 136, 0.85);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transition: opacity 140ms ease;
}
.video-card:hover .queue-add,
.video-card:focus-within .queue-add { opacity: 1; }
.queue-add:hover { background: var(--green); }

.video-info {
  padding: 15px 16px 16px;
}

.video-info h2 {
  margin: 0;
  color: #151515;
  font-size: 17px;
  line-height: 1.42;
}

.video-info p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.course-progress {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: #eee;
  overflow: hidden;
}

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

.study-shell {
  min-height: 100vh;
  padding-bottom: 18px;
  background: #f5f3ef;
}

.study-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
}

.study-top h1 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-video {
  position: relative;
  background: #0f0f0f;
}

.study-video video {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  display: block;
  background: #111;
}

.study-video video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

.video-subtitle {
  position: absolute;
  left: 50%;
  bottom: 58px;
  z-index: 10;
  display: grid;
  width: min(88%, 980px);
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
}

.video-subtitle.off {
  display: none;
}

.video-subtitle-error {
  position: absolute;
  left: 50%;
  bottom: 50%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  transform: translateX(-50%);
  white-space: nowrap;
}
.video-subtitle-error button {
  padding: 8px 20px;
  border-radius: 999px;
  background: #d8ff2f;
  color: #111;
  font-weight: 900;
}

.subtitle-line {
  justify-self: center;
  max-width: 100%;
  margin: 0;
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--subtitle-color, #fff);
  background: var(--subtitle-bg, rgba(0, 0, 0, 0.44));
  font-family: var(--subtitle-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: var(--subtitle-size, 20px);
  font-weight: 900;
  line-height: 1.35;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.72);
  overflow-wrap: anywhere;
}

.subtitle-line.zh {
  font-size: calc(var(--subtitle-size, 20px) * 0.92);
}

.cue-progress {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  font-size: 12px;
  font-weight: 900;
}

.player-fullscreen {
  position: absolute;
  right: 12px;
  bottom: 84px;
  z-index: 10;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  font-size: 0;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.player-fullscreen::before,
.player-fullscreen::after {
  content: "";
  position: absolute;
  inset: 12px;
  background:
    linear-gradient(currentColor, currentColor) left top / 9px 3px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 9px 3px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 9px 3px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 9px 3px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 3px 9px no-repeat;
}

.player-fullscreen::after {
  display: none;
}

.study-video.is-fullscreen .player-fullscreen::before,
.study-video:fullscreen .player-fullscreen::before,
.study-video:-webkit-full-screen .player-fullscreen::before {
  inset: 13px;
  transform: rotate(180deg);
}

.player-fullscreen:hover {
  background: rgba(0, 0, 0, 0.74);
}

.player-subtitle-control {
  position: absolute;
  right: 122px;
  bottom: 84px;
  z-index: 10;
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: #d8ff2f;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease;
}

.player-read-control {
  position: absolute;
  right: 290px;
  bottom: 84px;
  z-index: 10;
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: #d8ff2f;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease;
}

.study-video:hover .player-subtitle-control,
.study-video:focus-within .player-subtitle-control,
.player-subtitle-control:focus-visible,
.study-video.settings-open .player-subtitle-control,
.study-video:hover .player-read-control,
.study-video:focus-within .player-read-control,
.player-read-control:focus-visible,
.study-video.settings-open .player-read-control,
.study-video:hover .player-queue-add,
.study-video:focus-within .player-queue-add,
.player-queue-add:focus-visible,
.study-video.settings-open .player-queue-add {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-subtitle-control:hover,
.player-read-control:hover,
.player-queue-add:hover,
.study-video.settings-open .player-subtitle-control {
  color: #111;
  background: #d8ff2f;
}

.player-queue-add {
  position: absolute;
  right: 202px;
  bottom: 84px;
  z-index: 10;
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: #ffd866;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease;
}

.player-download {
  position: absolute;
  right: 62px;
  bottom: 84px;
  z-index: 10;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.player-download::before {
  content: "";
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
}

.study-video:hover .player-download,
.study-video:focus-within .player-download,
.player-download:focus-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-download:hover {
  background: rgba(0, 0, 0, 0.76);
}

.study-meta {
  display: grid;
  gap: 4px;
  width: calc(100% - 20px);
  margin: 10px;
  padding: 12px 14px;
}

.video-ended-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  border-radius: inherit;
}
.video-ended-overlay[hidden] { display: none; }
.video-ended-overlay b { font-size: 22px; font-weight: 900; }
.video-ended-actions { display: flex; gap: 12px; }

.study-meta b {
  font-size: 15px;
}

.study-meta span {
  color: var(--muted);
  font-size: 13px;
}

.study-summary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 20, 20, 0.08);
}

.study-summary strong {
  color: #151515;
  font-size: 13px;
  font-weight: 900;
}

.study-summary p {
  margin: 0;
  color: #5f5a52;
  font-size: 13px;
  line-height: 1.7;
}

.sentence-area {
  display: grid;
  gap: 10px;
  padding: 0 10px 16px;
}

.subtitle-settings {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(22, 22, 22, 0.08);
  border-radius: 18px;
  background: #fff;
}

.subtitle-settings-head,
.subtitle-setting-row {
  display: grid;
  gap: 10px;
}

.subtitle-settings-head {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.subtitle-settings-head b {
  font-size: 16px;
}

.subtitle-settings-head button {
  width: auto;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: #5d574f;
  background: #f2eee5;
  font-size: 12px;
  font-weight: 900;
}

.subtitle-setting-row > span {
  color: #676057;
  font-size: 12px;
  font-weight: 900;
}

.segmented,
.font-options,
.size-options,
.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented button,
.font-options button,
.size-options button,
.color-options button {
  width: auto;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  color: #514b43;
  background: #f4f0e8;
  font-size: 12px;
  font-weight: 900;
}

.segmented button.active,
.font-options button.active,
.size-options button.active,
.color-options button.active {
  color: #fff;
  background: #171717;
}

.color-options button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.color-options i {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.sentence-card {
  padding: 14px;
}

.sentence-card.active {
  border-color: rgba(19, 138, 85, 0.45);
  background: #f2fff8;
}

.sentence-card b {
  display: block;
  color: #111;
  font-size: 16px;
  line-height: 1.55;
}

.sentence-card p {
  margin: 8px 0 0;
  color: #4d4a45;
  line-height: 1.65;
}

.sentence-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.sentence-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sentence-actions button {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: #171717;
  font-size: 12px;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  border-top: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.study-toolbar {
  position: relative;
  z-index: 12;
  width: calc(100% - 20px);
  margin: 10px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 66px;
}

.study-toolbar {
  display: grid;
  grid-template-columns: 1fr 68px 1fr 1fr 1fr;
  align-items: center;
  height: 70px;
}

.bottom-nav button,
.study-toolbar button {
  color: #9b968e;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.bottom-nav button.active,
.study-toolbar button.active {
  color: #151515;
}

.play-main {
  width: 62px;
  height: 48px;
  border-radius: 999px;
  color: #fff !important;
  background: var(--green) !important;
}

.speed-picker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #7f786f;
  font-size: 11px;
  font-weight: 900;
}

.speed-current {
  width: 52px;
  min-height: 32px;
  border-radius: 999px;
  color: #171717;
  background: #f7f3ec;
  font-size: 12px;
  font-weight: 900;
}

.speed-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 45;
  display: none;
  width: 112px;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(30, 25, 20, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 32px rgba(28, 24, 18, 0.16);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.speed-picker:hover .speed-menu,
.speed-picker:focus-within .speed-menu {
  display: grid;
}

.speed-menu button {
  min-height: 30px;
  border-radius: 10px;
  color: #514b43;
  background: rgba(244, 240, 232, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.speed-menu button.active,
.speed-menu button:hover,
.speed-menu button:focus {
  color: #fff;
  background: rgba(23, 23, 23, 0.92);
}

.tool-card,
.ai-chat,
.profile-list,
.continue-card,
.empty-card {
  padding: 16px;
}

.word-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.word-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  color: #151515;
  background: #f6f4ef;
  text-align: left;
}

.word-card b,
.word-card small,
.word-card em {
  display: block;
}

.word-card small,
.word-card em {
  color: var(--muted);
  font-style: normal;
}

.ai-chat {
  display: grid;
  gap: 12px;
}

.bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.6;
}

.bubble.user {
  justify-self: end;
  color: #fff;
  background: var(--blue);
}

.bubble.bot {
  justify-self: start;
  background: #f3f0ea;
}

.ai-chat textarea {
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
}

.profile-head {
  grid-template-columns: auto minmax(0, 1fr);
}

.profile-head img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.profile-list {
  display: grid;
  gap: 0;
  margin-bottom: 14px;
  padding: 0 16px;
}

.profile-list article {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
}

.profile-list article:last-child {
  border-bottom: 0;
}

.continue-card {
  margin-bottom: 14px;
}

.logout-btn {
  width: 100%;
  color: #fff;
  background: #171717;
}

.form-error {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(190, 24, 24, 0.18);
  border-radius: 12px;
  color: #991b1b;
  background: #fff1f2;
  font-size: 13px;
  line-height: 1.45;
}

.form-notice {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 12px;
  color: #047857;
  background: #ecfdf5;
  font-size: 13px;
  line-height: 1.45;
}

.trial-banner {
  width: min(1180px, calc(100% - 28px));
  margin: 14px auto 0;
  padding: 12px 16px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.trial-banner div {
  display: grid;
  gap: 3px;
}

.trial-banner b {
  font-size: 15px;
}

.trial-banner span {
  color: #5f5a50;
  font-size: 13px;
}

.trial-banner.expired {
  border-color: rgba(185, 28, 28, 0.2);
  background: rgba(254, 242, 242, 0.9);
}

.upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 15, 18, 0.48);
  backdrop-filter: blur(10px);
}

.upgrade-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.upgrade-dialog h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 34px);
}

.upgrade-dialog p {
  margin: 0;
  color: #555047;
  line-height: 1.7;
}

.upgrade-contact {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f4f1e9;
  color: #171717;
  font-weight: 800;
}

.upgrade-dialog-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upgrade-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.trial-locked h2 {
  margin-top: 0;
}

.trial-locked p {
  color: #5f5a50;
  line-height: 1.7;
}

body[data-skin="studio"] .trial-banner {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(24, 25, 31, 0.82);
  color: #fff;
}

body[data-skin="studio"] .trial-banner span {
  color: rgba(255, 255, 255, 0.68);
}

body[data-skin="studio"] .trial-banner.expired {
  background: rgba(70, 20, 26, 0.88);
}

body[data-skin="studio"] .upgrade-dialog {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(24, 25, 31, 0.96);
  color: #fff;
}

body[data-skin="studio"] .upgrade-dialog p,
body[data-skin="studio"] .trial-locked p {
  color: rgba(255, 255, 255, 0.72);
}

body[data-skin="studio"] .upgrade-contact {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f1d8;
}

@media (max-width: 640px) {
  .trial-banner {
    align-items: flex-start;
    border-radius: 18px;
    padding: 11px 12px;
  }

  .trial-banner .pill-btn {
    padding: 9px 12px;
    white-space: nowrap;
  }

  .upgrade-dialog {
    padding: 24px 20px;
    border-radius: 24px;
  }
}

.playback-error {
  display: block;
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(190, 24, 24, 0.18);
  border-radius: 8px;
  color: #991b1b;
  background: #fff1f2;
  font-size: 14px;
  line-height: 1.5;
}

.playback-error[hidden] {
  display: none;
}

.playback-error[data-kind="status"] {
  color: #315647;
  border-color: #bad8c9;
  background: #edf8f2;
}

.login-sms-code-btn {
  min-width: 132px;
}

.web-nav {
  display: none;
}

@media (min-width: 760px) {
  .auth-page {
    width: min(900px, calc(100vw - 48px));
    padding-top: 26px;
  }

  .auth-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 900px) {
  body {
    background: #f3f0e8;
  }

  .mobile-shell {
    width: min(1160px, calc(100vw - 48px));
    min-height: 100vh;
    padding: 24px 0 48px;
  }

  .web-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
  }

  .web-nav > div {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .web-nav button:not(.brand) {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    color: #5d5850;
    background: transparent;
    font-weight: 900;
  }

  .web-nav button.active {
    color: #fff;
    background: #171717;
  }

  .bottom-nav {
    display: none;
  }

  .plain-home-top,
  .library-top,
  .simple-top {
    padding-bottom: 24px;
  }

  .plain-home-top h1,
  .library-top h1,
  .simple-top h1 {
    font-size: 40px;
  }

  .plain-home-top p,
  .library-top p,
  .simple-top p {
    font-size: 16px;
  }

  .home-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .entry-card {
    display: grid;
    grid-template-rows: 220px 1fr;
    min-height: 560px;
  }

  .entry-cover {
    min-height: 220px;
  }

  .entry-body {
    display: grid;
    align-content: start;
    padding: 28px;
  }

  .entry-body h2 {
    font-size: 36px;
  }

  .entry-body p {
    font-size: 16px;
  }

  .entry-body .gold-btn,
  .entry-body .blue-btn {
    align-self: end;
    width: 100%;
    margin-top: 18px;
  }

  .search-card {
    width: min(620px, 100%);
    margin-bottom: 16px;
  }

  .topic-tabs {
    margin: 0 0 18px;
    padding: 0;
    overflow: visible;
    flex-wrap: wrap;
  }

  .category-menu {
    margin: 0 0 20px;
    padding: 0 0 4px;
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .course-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .video-card {
    display: grid;
    grid-template-rows: auto 1fr;
  }

  .video-info {
    display: grid;
    align-content: start;
  }

  .study-shell {
    width: min(1180px, calc(100vw - 48px));
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    grid-template-rows: auto auto;
    column-gap: 20px;
    align-items: start;
    min-height: 100vh;
    padding: 24px 0 40px;
    background: transparent;
  }

  .study-primary {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-self: start;
  }

  .study-top {
    position: static;
    grid-column: 1 / -1;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
  }

  .study-top h1 {
    font-size: 18px;
  }

  .study-video {
    grid-column: 1;
    overflow: hidden;
    border-radius: 18px;
  }

  .study-meta {
    grid-column: 1;
    width: 100%;
    margin: 14px 0 14px;
  }

  .sentence-area {
    grid-column: 2;
    grid-row: 2;
    max-height: calc(100vh - 128px);
    padding: 0 2px 8px;
    overflow: auto;
  }

  .sentence-card {
    border-radius: 18px;
  }

  .study-toolbar {
    position: static;
    grid-column: 1;
    width: 100%;
    margin: 0;
    height: 70px;
    transform: none;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
  }

  .ai-chat,
  .profile-list,
  .continue-card {
    width: min(760px, 100%);
  }
}

/* 2026-06-26 mobile H5 fit pass. Desktop rules above 900px stay unchanged. */
@media (max-width: 899px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-width: 0;
    background: #eeeae2;
  }

  input,
  textarea,
  select,
  button {
    font-size: 16px;
  }

  .auth-page,
  .mobile-shell,
  .study-shell {
    width: 100%;
    max-width: 430px;
  }

  .auth-page {
    padding: max(10px, env(safe-area-inset-top)) 10px 28px;
  }

  .auth-brand {
    display: none;
  }

  .auth-grid {
    gap: 14px;
  }

  .login-card {
    order: 1;
  }

  .welcome-card {
    order: 2;
  }

  .welcome-card,
  .login-card {
    border-radius: 20px;
    padding: 20px 22px;
  }

  .welcome-card h1,
  .login-card h2 {
    font-size: clamp(28px, 8vw, 34px);
  }

  .welcome-card p,
  .login-card p {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.75;
  }

  .soft-card {
    margin-top: 12px;
    padding: 14px 16px;
  }

  .login-card label {
    min-width: 0;
  }

  .login-card input {
    min-width: 0;
    min-height: 48px;
  }

  .auth-actions {
    display: grid;
    grid-template-columns: minmax(132px, 0.7fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .auth-actions .dark-btn {
    width: 100%;
    min-width: 0;
  }

  .auth-actions .link-btn {
    min-height: 44px;
    text-align: left;
  }

  .register-line {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .register-line .pill-btn {
    justify-self: start;
  }

  .code-wrap {
    grid-template-columns: 1fr;
  }

  .mobile-shell {
    padding: max(12px, env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom));
  }

  .plain-home-top,
  .library-top,
  .simple-top {
    gap: 10px;
    padding-bottom: 12px;
  }

  .plain-home-top h1,
  .library-top h1,
  .simple-top h1 {
    font-size: clamp(26px, 8vw, 32px);
  }

  .plain-home-top p,
  .library-top p,
  .simple-top p {
    font-size: 13px;
    line-height: 1.45;
  }

  .home-card-list {
    gap: 14px;
  }

  .entry-card {
    border-radius: 18px;
  }

  .entry-cover {
    min-height: 142px;
    padding: 16px;
  }

  .entry-cover b {
    font-size: 24px;
  }

  .entry-body {
    padding: 18px 16px 16px;
  }

  .entry-body h2 {
    font-size: 27px;
  }

  .entry-body p {
    line-height: 1.68;
  }

  .search-card {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 16px;
  }

  .topic-tabs {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;
  }

  .topic-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-menu {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;
  }

  .category-menu::-webkit-scrollbar {
    display: none;
  }

  .category-panel,
  .category-item:hover .category-panel,
  .category-item:focus-within .category-panel,
  .category-item.menu-open .category-panel {
    display: none;
  }

  .course-list {
    gap: 10px;
  }

  .video-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 92px;
    border-radius: 16px;
  }

  .video-card .thumb {
    height: 100%;
    min-height: 92px;
    aspect-ratio: auto;
  }

  .video-info {
    min-width: 0;
    padding: 11px 12px;
  }

  .video-info h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .video-info p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 6px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .meta-tags {
    gap: 5px;
    margin: 9px 0 0;
  }

  .meta-tags span,
  .meta-tags b {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .course-progress {
    margin-top: 8px;
  }

  .duration-pill {
    right: 6px;
    bottom: 6px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .study-shell {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .study-top {
    min-height: 54px;
    padding: 7px 10px;
  }

  .study-video video {
    max-height: 42vh;
    object-fit: contain;
  }

  .video-subtitle {
    bottom: 52px;
    width: 92%;
    gap: 4px;
  }

  .subtitle-line {
    padding: 3px 8px;
    font-size: var(--subtitle-size, 20px);
    line-height: 1.32;
  }

  .subtitle-line.zh {
    font-size: calc(var(--subtitle-size, 20px) * 0.92);
  }

  .study-meta {
    width: calc(100% - 20px);
    margin: 10px 10px 8px;
    border-radius: 16px;
  }

  .sentence-area {
    padding: 0 10px calc(18px + env(safe-area-inset-bottom));
  }

  .sentence-card {
    border-radius: 16px;
  }

  .subtitle-settings {
    border-radius: 16px;
    padding: 12px;
    right: 4px;
    bottom: 132px;
    width: calc(100% - 12px);
    max-width: 340px;
  }

  .segmented,
  .font-options,
  .size-options,
  .color-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar,
  .font-options::-webkit-scrollbar,
  .size-options::-webkit-scrollbar,
  .color-options::-webkit-scrollbar {
    display: none;
  }

  .sentence-actions {
    gap: 10px;
  }

  .sentence-actions button {
    min-width: 78px;
  }

  .bottom-nav {
    width: 100%;
    max-width: 430px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav {
    height: calc(66px + env(safe-area-inset-bottom));
  }

  .study-toolbar {
    width: calc(100% - 20px);
    max-width: none;
    height: 70px;
    padding-bottom: 0;
  }

  .bottom-nav button,
  .study-toolbar button {
    min-width: 0;
    white-space: nowrap;
  }

  .profile-list article {
    gap: 14px;
  }

  .profile-list article span,
  .profile-list article b {
    min-width: 0;
  }

  .profile-list article b {
    text-align: right;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 360px) {
  .auth-page,
  .mobile-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .welcome-card,
  .login-card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .auth-actions .link-btn {
    text-align: center;
  }

  .video-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .video-card .thumb {
    min-height: 88px;
  }

  .study-toolbar {
    grid-template-columns: 0.95fr 0.8fr 60px 0.95fr 0.95fr;
  }

  .play-main {
    width: 56px;
  }
}

/* Admin first pass */
.admin-app {
  min-height: 100vh;
  color: #111827;
  background: #eef0f3;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 14px;
  background: #fff;
}

.admin-login-card img {
  width: 56px;
  height: 56px;
}

.admin-login-card h1,
.admin-login-card p {
  margin: 0;
}

.admin-login-card p {
  color: #6b7280;
  line-height: 1.6;
}

.admin-login-card label,
.admin-form label,
.admin-wide {
  display: grid;
  gap: 7px;
}

.admin-login-card span,
.admin-form span,
.admin-wide span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
}

.admin-login-card input,
.admin-form input,
.admin-form select,
.admin-wide input,
.admin-wide textarea,
.admin-panel-head input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  color: #111827;
  background: #fff;
  outline: 0;
}

.admin-password-wrap {
  position: relative;
}

.admin-password-wrap input {
  padding-right: 58px;
}

.admin-password-wrap button {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 38px;
  height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  color: #374151;
  background: #eef0f3;
  font-weight: 900;
  cursor: pointer;
}

.admin-password-wrap button:hover {
  color: #111827;
  background: #e0e4ea;
}

.admin-wide textarea {
  padding: 10px 12px;
  resize: vertical;
}

.admin-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-side {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid rgba(17, 24, 39, 0.1);
  background: #111827;
  color: #fff;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.admin-brand b,
.admin-brand span {
  display: block;
}

.admin-brand span {
  margin-top: 2px;
  color: #a7b0c0;
  font-size: 12px;
  font-weight: 800;
}

.admin-side nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-side nav button,
.admin-logout {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  color: #d1d5db;
  background: transparent;
  text-align: left;
  font-weight: 900;
}

.admin-side nav button.active,
.admin-side nav button:hover {
  color: #111827;
  background: #fff;
}

.admin-logout {
  color: #fecaca;
  background: rgba(255, 255, 255, 0.08);
}

.admin-main {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
}

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

.admin-top h1,
.admin-top p,
.admin-panel h2 {
  margin: 0;
}

.admin-top p {
  margin-top: 5px;
  color: #6b7280;
}

.admin-top a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: #111827;
  text-decoration: none;
  font-weight: 900;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stats article,
.admin-panel {
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 10px;
  background: #fff;
}

.admin-stats article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.admin-stats span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
}

.admin-stats b {
  font-size: 26px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-panel h2 {
  font-size: 18px;
}

.admin-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 14px;
  align-items: center;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-form.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(10px);
}

.admin-modal {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.admin-modal h2 {
  margin: 0;
  font-size: 24px;
}

.admin-modal p {
  margin: 0;
  display: grid;
  gap: 4px;
}

.admin-modal small {
  color: #6b7280;
}

.admin-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.admin-note,
.admin-help {
  border-radius: 8px;
  padding: 12px;
  color: #4b5563;
  background: #f8fafc;
  line-height: 1.6;
}

.admin-note {
  display: grid;
  gap: 4px;
}

.admin-note b {
  color: #111827;
}

.admin-note.ok {
  color: #065f46;
  background: #d1fae5;
}

.admin-note.bad {
  color: #991b1b;
  background: #fee2e2;
}

.admin-help {
  margin: 0;
  font-size: 13px;
}

.category-admin-tree {
  display: grid;
  gap: 12px;
}

.category-admin-tree article {
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 10px;
  overflow: hidden;
}

.category-admin-tree header {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
}

.category-admin-tree header span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.category-admin-tree header button,
.category-admin-tree div button {
  min-height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  color: #111827;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 900;
}

.category-admin-tree div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 12px;
}

.category-admin-tree div button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.1);
}

.category-admin-tree div button span {
  color: #6b7280;
  font-size: 12px;
}

.admin-table {
  overflow: auto;
}

.admin-table table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.admin-table th {
  color: #4b5563;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.admin-table td b,
.admin-table td small {
  display: block;
}

.admin-table td small {
  margin-top: 4px;
  color: #6b7280;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-table td button {
  min-height: 30px;
  margin: 0 6px 6px 0;
  border-radius: 7px;
  padding: 0 10px;
  color: #111827;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 900;
}

.admin-user-search-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-user-search-heading .admin-help {
  margin-top: 7px;
  padding: 0;
  background: transparent;
}

.admin-user-search {
  display: grid;
  gap: 7px;
  width: min(380px, 100%);
}

.admin-user-search span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
}

.admin-user-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 9px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}

.admin-empty-result {
  padding: 28px 12px !important;
  color: #6b7280;
  text-align: center !important;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.admin-badge.ok {
  color: #065f46;
  background: #d1fae5;
}

.admin-badge.off {
  color: #991b1b;
  background: #fee2e2;
}

.course-picker {
  gap: 16px;
}

.course-picker-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.course-picker-row label {
  display: grid;
  gap: 7px;
}

.course-picker-row span,
.cover-upload span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
}

.course-picker-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  color: #111827;
  background: #fff;
  outline: 0;
}

.course-path-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.course-path-bar span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #111827;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 900;
}

.course-visual-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.course-visual-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.course-card-main {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 0;
  color: #111827;
  background: transparent;
  text-align: left;
}

.course-visual-cover,
.cover-preview {
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: #f3f4f6;
}

.course-visual-cover {
  width: 104px;
  aspect-ratio: 16 / 9;
}

.course-visual-cover img,
.cover-preview img,
.asset-library img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.course-visual-cover div,
.cover-preview div {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
  color: #6b7280;
  text-align: center;
  font-size: 12px;
}

.course-visual-cover b,
.course-visual-cover span,
.cover-preview b,
.cover-preview span {
  display: block;
}

.course-visual-info {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.course-visual-info b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.course-visual-info small {
  color: #6b7280;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.course-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-card-actions button,
.asset-library button {
  min-height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  color: #111827;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 900;
}

.course-editor-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.cover-manager,
.cover-manager-v2,
.course-meta-form {
  display: grid;
  gap: 12px;
}

.cover-manager-v2 + .cover-manager {
  display: none;
}

.cover-preview {
  aspect-ratio: 16 / 9;
}

.cover-spec {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #365314;
  background: #ecfccb;
  font-size: 12px;
  line-height: 1.45;
}

.cover-spec b {
  color: #1f2937;
}

.cover-upload {
  display: grid;
  gap: 7px;
}

.cover-upload input {
  width: 100%;
  min-height: 42px;
  border: 1px dashed rgba(17, 24, 39, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  background: #f8fafc;
}

.asset-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.cover-library-panel {
  display: grid;
  gap: 8px;
}

.cover-library-panel h3 {
  margin: 0;
  font-size: 15px;
}

.asset-card {
  display: grid;
  gap: 5px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 8px;
}

.asset-card.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.asset-card-main {
  display: grid;
  gap: 5px;
  padding: 0;
  color: #111827;
  background: transparent;
  text-align: left;
}

.asset-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.asset-card-actions button {
  min-height: 30px;
  border-radius: 7px;
  padding: 0 8px;
  color: #111827;
  background: #e5e7eb;
  font-size: 12px;
  font-weight: 900;
}

.asset-card-actions button:last-child {
  color: #991b1b;
  background: #fee2e2;
}

.asset-library img {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #f3f4f6;
}

.asset-library span,
.asset-library small {
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
    height: auto;
  }

  .admin-stats,
  .admin-form.grid-5,
  .admin-form.grid-3,
  .admin-form.grid-2,
  .admin-panel-head,
  .course-picker-row,
  .course-editor-layout {
    grid-template-columns: 1fr;
  }

  .admin-user-search-heading {
    display: grid;
    align-items: stretch;
  }

  .admin-user-search {
    width: 100%;
  }
}

/* 2026-07-07 visual direction trials for login and home only. */
body[data-skin="prism"][data-view="login"],
body[data-skin="prism"][data-view="register"],
body[data-skin="prism"][data-view="forgot"],
body[data-skin="prism"][data-view="home"] {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(135deg, #08090d 0%, #15110d 48%, #070b10 100%);
  color: #f7f2e7;
}

body[data-skin="prism"] .auth-page {
  width: min(1180px, calc(100vw - 48px));
  padding: 28px 0 44px;
}

body[data-skin="prism"] .auth-brand {
  display: flex;
  padding: 0 0 24px;
}

body[data-skin="prism"] .brand {
  color: #f7f2e7;
}

body[data-skin="prism"] .brand img {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

body[data-skin="prism"] .auth-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 22px;
  align-items: stretch;
}

body[data-skin="prism"] .welcome-card,
body[data-skin="prism"] .login-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

body[data-skin="prism"] .welcome-card {
  min-height: 580px;
  padding: 42px;
  color: #f9f4e8;
  background:
    linear-gradient(112deg, rgba(18, 232, 150, 0.2), transparent 36%),
    linear-gradient(150deg, #101012 0%, #1a1d18 52%, #0a1119 100%);
}

body[data-skin="prism"] .welcome-card::before {
  content: "";
  position: absolute;
  inset: auto -8% 10% 42%;
  height: 34%;
  border: 1px solid rgba(238, 255, 0, 0.34);
  background: repeating-linear-gradient(135deg, rgba(238, 255, 0, 0.18) 0 8px, transparent 8px 18px);
  transform: skewY(-9deg);
}

body[data-skin="prism"] .welcome-card h1 {
  max-width: 8em;
  color: #fffdf4;
  font-family: inherit;
  font-size: clamp(46px, 8vw, 102px);
  font-weight: 950;
  line-height: 0.92;
}

body[data-skin="prism"] .welcome-card p {
  position: relative;
  max-width: 620px;
  color: #cfd8d4;
  font-size: 18px;
  line-height: 1.8;
}

body[data-skin="prism"] .soft-card {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: #f9f4e8;
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

body[data-skin="prism"] .soft-card b {
  display: block;
  margin-bottom: 8px;
  color: #eaff4f;
}

body[data-skin="prism"] .soft-card span {
  color: #d7ded9;
}

body[data-skin="prism"] .login-card {
  align-self: center;
  padding: 34px;
  color: #111;
  background: #f7f2e7;
}

body[data-skin="prism"] .login-card h2 {
  color: #111;
  font-family: inherit;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 950;
}

body[data-skin="prism"] .login-card p {
  color: #52504a;
}

body[data-skin="prism"] .login-card input {
  border: 2px solid #111;
  border-radius: 4px;
  background: #fffdf6;
}

body[data-skin="prism"] .dark-btn,
body[data-skin="prism"] .pill-btn {
  border-radius: 4px;
}

body[data-skin="prism"] .dark-btn {
  color: #111;
  background: #eaff4f;
}

body[data-skin="prism"] .link-btn {
  color: #075aeb;
}

body[data-skin="prism"][data-view="home"] .mobile-shell {
  width: min(1180px, calc(100vw - 48px));
  padding: 28px 0 56px;
}

body[data-skin="prism"][data-view="home"] .web-nav,
body[data-skin="prism"][data-view="home"] .plain-home-top,
body[data-skin="prism"][data-view="home"] .home-continue,
body[data-skin="prism"][data-view="home"] .entry-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(12, 13, 17, 0.78);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

body[data-skin="prism"][data-view="home"] .web-nav {
  display: flex;
}

body[data-skin="prism"][data-view="home"] .web-nav button:not(.brand) {
  color: #e6e1d7;
}

body[data-skin="prism"][data-view="home"] .web-nav button.active {
  color: #111;
  background: #eaff4f;
}

body[data-skin="prism"][data-view="home"] .plain-home-top {
  min-height: 250px;
  margin-bottom: 18px;
  padding: 30px;
  align-items: end;
  background:
    linear-gradient(115deg, rgba(234, 255, 79, 0.2), transparent 42%),
    linear-gradient(145deg, rgba(21, 202, 255, 0.18), rgba(12, 13, 17, 0.86));
}

body[data-skin="prism"][data-view="home"] .plain-home-top h1 {
  color: #fffdf4;
  font-family: inherit;
  font-size: clamp(54px, 8vw, 108px);
  font-weight: 950;
  line-height: 0.9;
}

body[data-skin="prism"][data-view="home"] .plain-home-top p {
  color: #cfd8d4;
  font-size: 18px;
}

body[data-skin="prism"][data-view="home"] .menu-dot {
  width: auto;
  min-width: 86px;
  border-radius: 4px;
  color: #111;
  background: #eaff4f;
}

body[data-skin="prism"][data-view="home"] .home-card-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body[data-skin="prism"][data-view="home"] .entry-card {
  display: grid;
  grid-template-rows: 260px 1fr;
  min-height: 560px;
}

body[data-skin="prism"][data-view="home"] .entry-cover {
  min-height: 260px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

body[data-skin="prism"][data-view="home"] .video-cover {
  background:
    linear-gradient(135deg, rgba(6, 11, 18, 0.34), rgba(0, 0, 0, 0.86)),
    repeating-linear-gradient(135deg, rgba(234, 255, 79, 0.2) 0 12px, transparent 12px 28px),
    url("assets/brand/suzy-english-academy-logo.png") center / 150px no-repeat,
    #111;
}

body[data-skin="prism"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(6, 11, 18, 0.24), rgba(0, 0, 0, 0.86)),
    repeating-linear-gradient(90deg, rgba(21, 202, 255, 0.22) 0 10px, transparent 10px 26px),
    #0a1020;
}

body[data-skin="prism"][data-view="home"] .entry-cover span {
  border-radius: 4px;
  color: #111;
  background: #eaff4f;
}

body[data-skin="prism"][data-view="home"] .entry-cover b {
  color: #fffdf4;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1;
}

body[data-skin="prism"][data-view="home"] .entry-body {
  padding: 28px;
  color: #f7f2e7;
}

body[data-skin="prism"][data-view="home"] .entry-body h2 {
  color: #fffdf4;
  font-family: inherit;
  font-size: 42px;
  font-weight: 950;
}

body[data-skin="prism"][data-view="home"] .entry-body p {
  color: #cfd8d4;
}

body[data-skin="prism"][data-view="home"] .entry-tags span {
  border-radius: 4px;
  color: #e7efe9;
  background: rgba(255, 255, 255, 0.1);
}

body[data-skin="prism"][data-view="home"] .gold-btn,
body[data-skin="prism"][data-view="home"] .blue-btn {
  border-radius: 4px;
  color: #111;
  background: #eaff4f;
}

body[data-skin="studio"][data-view="login"],
body[data-skin="studio"][data-view="register"],
body[data-skin="studio"][data-view="forgot"],
body[data-skin="studio"][data-view="home"] {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px) 0 0 / 64px 64px,
    #f6f1e6;
  color: #111;
}

body[data-skin="studio"] .auth-page {
  width: min(1120px, calc(100vw - 48px));
  padding: 30px 0 46px;
}

body[data-skin="studio"] .auth-brand {
  display: flex;
  padding: 0 0 22px;
}

body[data-skin="studio"] .auth-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

body[data-skin="studio"] .welcome-card,
body[data-skin="studio"] .login-card {
  border: 2px solid #111;
  border-radius: 0;
  box-shadow: 10px 10px 0 #111;
}

body[data-skin="studio"] .welcome-card {
  min-height: 560px;
  padding: 38px;
  color: #111;
  background:
    linear-gradient(135deg, transparent 0 58%, #ff5b2e 58% 64%, transparent 64%),
    #fdf9ef;
}

body[data-skin="studio"] .welcome-card h1 {
  max-width: 8em;
  color: #111;
  font-family: inherit;
  font-size: clamp(44px, 7vw, 94px);
  font-weight: 950;
  line-height: 0.94;
}

body[data-skin="studio"] .welcome-card p {
  max-width: 610px;
  color: #2e2c28;
  font-size: 18px;
}

body[data-skin="studio"] .soft-card {
  border: 2px solid #111;
  border-radius: 0;
  background: #d8ff4f;
}

body[data-skin="studio"] .soft-card:nth-of-type(2) {
  background: #bfe5ff;
}

body[data-skin="studio"] .login-card {
  align-self: center;
  padding: 34px;
  background: #fffef8;
}

body[data-skin="studio"] .login-card h2 {
  font-family: inherit;
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 950;
}

body[data-skin="studio"] .login-card input {
  border: 2px solid #111;
  border-radius: 0;
  background: #fdf9ef;
}

body[data-skin="studio"] .dark-btn,
body[data-skin="studio"] .pill-btn {
  border: 2px solid #111;
  border-radius: 0;
  box-shadow: 5px 5px 0 #111;
}

body[data-skin="studio"] .dark-btn {
  color: #fff;
  background: #154cff;
}

body[data-skin="studio"] .pill-btn {
  color: #111;
  background: #d8ff4f;
}

body[data-skin="studio"][data-view="home"] .mobile-shell {
  width: min(1120px, calc(100vw - 48px));
  padding: 30px 0 56px;
}

body[data-skin="studio"][data-view="home"] .web-nav,
body[data-skin="studio"][data-view="home"] .plain-home-top,
body[data-skin="studio"][data-view="home"] .home-continue,
body[data-skin="studio"][data-view="home"] .entry-card {
  border: 2px solid #111;
  border-radius: 0;
  background: #fffef8;
  box-shadow: 8px 8px 0 #111;
}

body[data-skin="studio"][data-view="home"] .web-nav {
  display: flex;
}

body[data-skin="studio"][data-view="home"] .web-nav button:not(.brand) {
  color: #111;
}

body[data-skin="studio"][data-view="home"] .web-nav button.active {
  color: #fff;
  background: #154cff;
}

body[data-skin="studio"][data-view="home"] .plain-home-top {
  min-height: 230px;
  margin-bottom: 18px;
  padding: 30px;
  align-items: end;
  background:
    linear-gradient(120deg, #fffef8 0 54%, #d8ff4f 54% 72%, #ff5b2e 72% 100%);
}

body[data-skin="studio"][data-view="home"] .plain-home-top h1 {
  font-family: inherit;
  font-size: clamp(50px, 8vw, 102px);
  font-weight: 950;
  line-height: 0.92;
}

body[data-skin="studio"][data-view="home"] .plain-home-top p {
  color: #25231f;
  font-size: 18px;
}

body[data-skin="studio"][data-view="home"] .menu-dot {
  width: auto;
  min-width: 86px;
  border: 2px solid #111;
  border-radius: 0;
  background: #fffef8;
  box-shadow: 5px 5px 0 #111;
}

body[data-skin="studio"][data-view="home"] .home-card-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body[data-skin="studio"][data-view="home"] .entry-card {
  display: grid;
  grid-template-rows: 250px 1fr;
  min-height: 540px;
}

body[data-skin="studio"][data-view="home"] .entry-cover {
  min-height: 250px;
  border-bottom: 2px solid #111;
}

body[data-skin="studio"][data-view="home"] .video-cover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2)),
    url("assets/brand/suzy-english-academy-logo.png") center / 150px no-repeat,
    #154cff;
}

body[data-skin="studio"][data-view="home"] .ai-cover {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 12px, transparent 12px 28px),
    #111;
}

body[data-skin="studio"][data-view="home"] .entry-cover span {
  border: 2px solid #111;
  border-radius: 0;
  color: #111;
  background: #d8ff4f;
}

body[data-skin="studio"][data-view="home"] .entry-cover b {
  font-size: clamp(28px, 4vw, 48px);
}

body[data-skin="studio"][data-view="home"] .entry-body {
  padding: 28px;
}

body[data-skin="studio"][data-view="home"] .entry-body h2 {
  font-family: inherit;
  font-size: 40px;
  font-weight: 950;
}

body[data-skin="studio"][data-view="home"] .entry-tags span {
  border: 1px solid #111;
  border-radius: 0;
  color: #111;
  background: #f6f1e6;
}

body[data-skin="studio"][data-view="home"] .gold-btn,
body[data-skin="studio"][data-view="home"] .blue-btn {
  border: 2px solid #111;
  border-radius: 0;
  box-shadow: 5px 5px 0 #111;
}

body[data-skin="studio"][data-view="home"] .gold-btn {
  color: #111;
  background: #d8ff4f;
}

body[data-skin="studio"][data-view="home"] .blue-btn {
  color: #fff;
  background: #154cff;
}

@media (max-width: 899px) {
  body[data-skin="prism"] .auth-page,
  body[data-skin="studio"] .auth-page,
  body[data-skin="prism"][data-view="home"] .mobile-shell,
  body[data-skin="studio"][data-view="home"] .mobile-shell {
    width: 100%;
    max-width: 430px;
    padding-left: 12px;
    padding-right: 12px;
  }

  body[data-skin="prism"] .auth-brand,
  body[data-skin="studio"] .auth-brand {
    display: flex;
    padding: 0 0 12px;
  }

  body[data-skin="prism"] .auth-grid,
  body[data-skin="studio"] .auth-grid {
    grid-template-columns: 1fr;
  }

  body[data-skin="prism"] .welcome-card,
  body[data-skin="studio"] .welcome-card {
    min-height: auto;
  }

  body[data-skin="prism"] .welcome-card h1,
  body[data-skin="studio"] .welcome-card h1 {
    font-size: clamp(38px, 12vw, 52px);
    line-height: 0.98;
  }

  body[data-skin="prism"] .login-card h2,
  body[data-skin="studio"] .login-card h2 {
    font-size: clamp(34px, 11vw, 48px);
  }

  body[data-skin="prism"][data-view="home"] .web-nav,
  body[data-skin="studio"][data-view="home"] .web-nav {
    display: none;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top,
  body[data-skin="studio"][data-view="home"] .plain-home-top {
    min-height: 190px;
    padding: 20px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top h1,
  body[data-skin="studio"][data-view="home"] .plain-home-top h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  body[data-skin="prism"][data-view="home"] .home-card-list,
  body[data-skin="studio"][data-view="home"] .home-card-list {
    grid-template-columns: 1fr;
  }

  body[data-skin="prism"][data-view="home"] .entry-card,
  body[data-skin="studio"][data-view="home"] .entry-card {
    grid-template-rows: 170px 1fr;
    min-height: auto;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover,
  body[data-skin="studio"][data-view="home"] .entry-cover {
    min-height: 170px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body h2,
  body[data-skin="studio"][data-view="home"] .entry-body h2 {
    font-size: 30px;
  }
}

/* 2026-07-07 refined direction: quieter backgrounds, stronger readable type, better scale. */
body[data-skin="prism"][data-view="login"],
body[data-skin="prism"][data-view="register"],
body[data-skin="prism"][data-view="forgot"],
body[data-skin="prism"][data-view="home"] {
  background: #f7f2e8;
  color: #111;
}

body[data-skin="prism"] .auth-page {
  width: min(1080px, calc(100vw - 40px));
  padding: 22px 0 38px;
}

body[data-skin="prism"] .auth-brand {
  padding-bottom: 18px;
}

body[data-skin="prism"] .brand {
  color: #111;
}

body[data-skin="prism"] .auth-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 18px;
  align-items: stretch;
}

body[data-skin="prism"] .welcome-card,
body[data-skin="prism"] .login-card {
  border: 0;
  border-radius: 28px;
  box-shadow: none;
}

body[data-skin="prism"] .welcome-card {
  min-height: 520px;
  padding: 34px;
  color: #111;
  background:
    linear-gradient(135deg, transparent 0 58%, rgba(184, 210, 237, 0.72) 58% 82%, transparent 82%),
    linear-gradient(115deg, rgba(222, 255, 62, 0.72) 0 28%, transparent 28%),
    #fffaf0;
}

body[data-skin="prism"] .welcome-card::before {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 34px;
  width: 170px;
  height: 118px;
  border-radius: 26px;
  background: #f2b8d7;
  transform: rotate(-7deg);
}

body[data-skin="prism"] .welcome-card h1 {
  position: relative;
  max-width: 7.6em;
  color: #111;
  font-family: inherit;
  font-size: clamp(42px, 5.5vw, 72px);
  font-weight: 950;
  line-height: 0.98;
}

body[data-skin="prism"] .welcome-card p {
  position: relative;
  max-width: 600px;
  color: #24231f;
  font-size: 16px;
  line-height: 1.75;
}

body[data-skin="prism"] .soft-card {
  position: relative;
  width: min(420px, 100%);
  border: 0;
  border-radius: 22px;
  padding: 16px 18px;
  color: #111;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
}

body[data-skin="prism"] .soft-card b {
  color: #111;
}

body[data-skin="prism"] .soft-card span {
  color: #3f3d38;
}

body[data-skin="prism"] .login-card {
  align-self: center;
  padding: 32px;
  color: #111;
  background: #fffdf8;
}

body[data-skin="prism"] .login-card h2 {
  color: #111;
  font-family: inherit;
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 950;
  line-height: 1.02;
}

body[data-skin="prism"] .login-card p {
  color: #5a574f;
  font-size: 14px;
}

body[data-skin="prism"] .login-card input {
  min-height: 48px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 16px;
  background: #f8f4eb;
}

body[data-skin="prism"] .dark-btn,
body[data-skin="prism"] .pill-btn {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}

body[data-skin="prism"] .dark-btn {
  color: #fff;
  background: #111;
}

body[data-skin="prism"] .pill-btn {
  color: #111;
  background: #e8ff38;
}

body[data-skin="prism"][data-view="home"] .mobile-shell {
  width: min(1080px, calc(100vw - 40px));
  padding: 22px 0 46px;
}

body[data-skin="prism"][data-view="home"] .web-nav,
body[data-skin="prism"][data-view="home"] .plain-home-top,
body[data-skin="prism"][data-view="home"] .home-continue,
body[data-skin="prism"][data-view="home"] .entry-card {
  border: 0;
  border-radius: 28px;
  background: #fffdf8;
  box-shadow: none;
}

body[data-skin="prism"][data-view="home"] .web-nav {
  display: flex;
  padding: 12px 16px;
  margin-bottom: 16px;
}

body[data-skin="prism"][data-view="home"] .web-nav button:not(.brand) {
  color: #26231f;
}

body[data-skin="prism"][data-view="home"] .web-nav button.active {
  color: #fff;
  background: #111;
}

body[data-skin="prism"][data-view="home"] .plain-home-top {
  min-height: 210px;
  margin-bottom: 16px;
  padding: 26px;
  align-items: end;
  position: relative;
  overflow: hidden;
  background: #fffdf8;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  bottom: 22px;
  width: min(42%, 460px);
  border-radius: 24px;
  background:
    linear-gradient(120deg, transparent 0 20%, rgba(232, 255, 56, 0.82) 20% 58%, rgba(242, 184, 215, 0.76) 58% 100%);
  pointer-events: none;
}

body[data-skin="prism"][data-view="home"] .plain-home-top h1 {
  color: #111;
  font-family: inherit;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 950;
  line-height: 0.95;
}

body[data-skin="prism"][data-view="home"] .plain-home-top p {
  color: #2e2c27;
  font-size: 16px;
}

body[data-skin="prism"][data-view="home"] .menu-dot {
  width: auto;
  min-width: 76px;
  min-height: 44px;
  border-radius: 999px;
  color: #fff;
  background: #111;
}

body[data-skin="prism"][data-view="home"] .home-card-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body[data-skin="prism"][data-view="home"] .entry-card {
  display: grid;
  grid-template-rows: 210px 1fr;
  min-height: 460px;
}

body[data-skin="prism"][data-view="home"] .entry-cover {
  min-height: 210px;
  border-bottom: 0;
}

body[data-skin="prism"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 118px no-repeat,
    linear-gradient(135deg, #e8ff38 0 40%, #b8d2ed 40% 72%, #fffdf8 72%);
}

body[data-skin="prism"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.1), transparent),
    #f2b8d7;
}

body[data-skin="prism"][data-view="home"] .entry-cover span {
  border: 0;
  border-radius: 999px;
  color: #111;
  background: rgba(255, 255, 255, 0.86);
}

body[data-skin="prism"][data-view="home"] .entry-cover b {
  color: #111;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.02;
}

body[data-skin="prism"][data-view="home"] .entry-body {
  padding: 24px;
  color: #111;
}

body[data-skin="prism"][data-view="home"] .entry-body h2 {
  color: #111;
  font-family: inherit;
  font-size: 32px;
  font-weight: 950;
}

body[data-skin="prism"][data-view="home"] .entry-body p {
  color: #4a4740;
}

body[data-skin="prism"][data-view="home"] .entry-tags span {
  border-radius: 999px;
  color: #111;
  background: #f1ede4;
}

body[data-skin="prism"][data-view="home"] .gold-btn,
body[data-skin="prism"][data-view="home"] .blue-btn {
  border-radius: 999px;
  color: #fff;
  background: #111;
}

body[data-skin="studio"][data-view="login"],
body[data-skin="studio"][data-view="register"],
body[data-skin="studio"][data-view="forgot"],
body[data-skin="studio"][data-view="home"] {
  background: #101114;
  color: #f7f2e8;
}

body[data-skin="studio"] .auth-page {
  width: min(1040px, calc(100vw - 40px));
  padding: 22px 0 38px;
}

body[data-skin="studio"] .auth-brand {
  padding-bottom: 18px;
}

body[data-skin="studio"] .brand {
  color: #f7f2e8;
}

body[data-skin="studio"] .auth-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 18px;
}

body[data-skin="studio"] .welcome-card,
body[data-skin="studio"] .login-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: none;
}

body[data-skin="studio"] .welcome-card {
  min-height: 520px;
  padding: 34px;
  color: #f7f2e8;
  background:
    linear-gradient(135deg, transparent 0 56%, rgba(142, 119, 255, 0.34) 56% 78%, transparent 78%),
    linear-gradient(115deg, rgba(219, 255, 74, 0.2), transparent 42%),
    #17181d;
}

body[data-skin="studio"] .welcome-card::before {
  content: "";
  position: absolute;
  right: 32px;
  bottom: 34px;
  width: 180px;
  height: 104px;
  border-radius: 28px;
  background: rgba(219, 255, 74, 0.82);
  transform: rotate(-6deg);
}

body[data-skin="studio"] .welcome-card h1 {
  position: relative;
  max-width: 7.5em;
  color: #fff;
  font-family: inherit;
  font-size: clamp(42px, 5.5vw, 70px);
  font-weight: 950;
  line-height: 0.98;
}

body[data-skin="studio"] .welcome-card p {
  position: relative;
  max-width: 600px;
  color: #d7d0c5;
  font-size: 16px;
  line-height: 1.75;
}

body[data-skin="studio"] .soft-card {
  position: relative;
  width: min(420px, 100%);
  border: 0;
  border-radius: 22px;
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.08);
}

body[data-skin="studio"] .soft-card:nth-of-type(2) {
  background: rgba(142, 119, 255, 0.16);
}

body[data-skin="studio"] .soft-card b {
  color: #dbff4a;
}

body[data-skin="studio"] .soft-card span {
  color: #d7d0c5;
}

body[data-skin="studio"] .login-card {
  align-self: center;
  padding: 32px;
  color: #f7f2e8;
  background: #1a1b20;
}

body[data-skin="studio"] .login-card h2 {
  color: #fff;
  font-family: inherit;
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 950;
  line-height: 1.02;
}

body[data-skin="studio"] .login-card p {
  color: #b9b1a6;
  font-size: 14px;
}

body[data-skin="studio"] .login-card input {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  background: #111216;
}

body[data-skin="studio"] .dark-btn,
body[data-skin="studio"] .pill-btn {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}

body[data-skin="studio"] .dark-btn {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"] .pill-btn {
  color: #111;
  background: #f2b8d7;
}

body[data-skin="studio"][data-view="home"] .mobile-shell {
  width: min(1040px, calc(100vw - 40px));
  padding: 22px 0 46px;
}

body[data-skin="studio"][data-view="home"] .web-nav,
body[data-skin="studio"][data-view="home"] .plain-home-top,
body[data-skin="studio"][data-view="home"] .home-continue,
body[data-skin="studio"][data-view="home"] .entry-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: #1a1b20;
  box-shadow: none;
}

body[data-skin="studio"][data-view="home"] .web-nav {
  display: flex;
  padding: 12px 16px;
  margin-bottom: 16px;
}

body[data-skin="studio"][data-view="home"] .web-nav button:not(.brand) {
  color: #d7d0c5;
}

body[data-skin="studio"][data-view="home"] .web-nav button.active {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"][data-view="home"] .plain-home-top {
  min-height: 210px;
  margin-bottom: 16px;
  padding: 26px;
  align-items: end;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #17181d;
}

body[data-skin="studio"][data-view="home"] .plain-home-top::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg, transparent 0 55%, rgba(219, 255, 74, 0.72) 55% 70%, rgba(242, 184, 215, 0.72) 70% 100%);
  pointer-events: none;
}

body[data-skin="studio"][data-view="home"] .plain-home-top > * {
  position: relative;
  z-index: 1;
}

body[data-skin="studio"][data-view="home"] .plain-home-top h1 {
  color: #fff;
  font-family: inherit;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 950;
  line-height: 0.95;
}

body[data-skin="studio"][data-view="home"] .plain-home-top p {
  color: #d7d0c5;
  font-size: 16px;
}

body[data-skin="studio"][data-view="home"] .menu-dot {
  width: auto;
  min-width: 86px;
  min-height: 48px;
  border-radius: 999px;
  color: #111;
  border: 3px solid #111;
  background: #dbff4a;
  box-shadow: 8px 8px 0 #111;
}

body[data-skin="studio"][data-view="home"] .home-card-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body[data-skin="studio"][data-view="home"] .entry-card {
  display: grid;
  grid-template-rows: 210px 1fr;
  min-height: 460px;
}

body[data-skin="studio"][data-view="home"] .entry-cover {
  min-height: 210px;
  border-bottom: 0;
}

body[data-skin="studio"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 118px no-repeat,
    linear-gradient(135deg, #dbff4a 0 38%, #8e77ff 38% 72%, #17181d 72%);
}

body[data-skin="studio"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(142, 119, 255, 0.46), transparent),
    #111216;
}

body[data-skin="studio"][data-view="home"] .entry-cover span {
  border: 0;
  border-radius: 999px;
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"][data-view="home"] .entry-cover b {
  color: #fff;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.02;
}

body[data-skin="studio"][data-view="home"] .entry-body {
  padding: 24px;
  color: #f7f2e8;
}

body[data-skin="studio"][data-view="home"] .entry-body h2 {
  color: #fff;
  font-family: inherit;
  font-size: 32px;
  font-weight: 950;
}

body[data-skin="studio"][data-view="home"] .entry-body p {
  color: #d7d0c5;
}

body[data-skin="studio"][data-view="home"] .entry-tags span {
  border: 0;
  border-radius: 999px;
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.08);
}

body[data-skin="studio"][data-view="home"] .gold-btn,
body[data-skin="studio"][data-view="home"] .blue-btn {
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}

body[data-skin="studio"][data-view="home"] .gold-btn {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"][data-view="home"] .blue-btn {
  color: #111;
  background: #f2b8d7;
}

@media (max-width: 899px) {
  body[data-skin="prism"] .auth-page,
  body[data-skin="studio"] .auth-page,
  body[data-skin="prism"][data-view="home"] .mobile-shell,
  body[data-skin="studio"][data-view="home"] .mobile-shell {
    width: 100%;
    max-width: 430px;
    padding: 12px 12px calc(80px + env(safe-area-inset-bottom));
  }

  body[data-skin="prism"] .auth-brand,
  body[data-skin="studio"] .auth-brand {
    display: flex;
    padding: 0 0 10px;
  }

  body[data-skin="prism"] .auth-grid,
  body[data-skin="studio"] .auth-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body[data-skin="prism"] .welcome-card,
  body[data-skin="studio"] .welcome-card {
    min-height: 280px;
    padding: 22px;
  }

  body[data-skin="prism"] .welcome-card h1,
  body[data-skin="studio"] .welcome-card h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  body[data-skin="prism"] .login-card,
  body[data-skin="studio"] .login-card {
    padding: 22px;
  }

  body[data-skin="prism"] .login-card h2,
  body[data-skin="studio"] .login-card h2 {
    font-size: clamp(30px, 9vw, 38px);
  }

  body[data-skin="prism"][data-view="home"] .web-nav,
  body[data-skin="studio"][data-view="home"] .web-nav {
    display: none;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top,
  body[data-skin="studio"][data-view="home"] .plain-home-top {
    min-height: 156px;
    padding: 18px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top h1,
  body[data-skin="studio"][data-view="home"] .plain-home-top h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top p,
  body[data-skin="studio"][data-view="home"] .plain-home-top p {
    font-size: 14px;
  }

  body[data-skin="prism"][data-view="home"] .home-card-list,
  body[data-skin="studio"][data-view="home"] .home-card-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body[data-skin="prism"][data-view="home"] .entry-card,
  body[data-skin="studio"][data-view="home"] .entry-card {
    grid-template-rows: 140px 1fr;
    min-height: auto;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover,
  body[data-skin="studio"][data-view="home"] .entry-cover {
    min-height: 140px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body,
  body[data-skin="studio"][data-view="home"] .entry-body {
    padding: 18px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body h2,
  body[data-skin="studio"][data-view="home"] .entry-body h2 {
    font-size: 26px;
  }
}

/* Full-site skin coverage for library, study, AI, and profile pages. */
body[data-skin="prism"][data-view="library"],
body[data-skin="prism"][data-view="learn"],
body[data-skin="prism"][data-view="ai"],
body[data-skin="prism"][data-view="profile"] {
  background: #f3f0e8;
}

body[data-skin="studio"][data-view="library"],
body[data-skin="studio"][data-view="learn"],
body[data-skin="studio"][data-view="ai"],
body[data-skin="studio"][data-view="profile"] {
  color: #fffef8;
  background: #101115;
}

body[data-skin="prism"] .library-top,
body[data-skin="prism"] .simple-top,
body[data-skin="prism"] .study-top {
  color: #111;
}

body[data-skin="prism"] .library-top h1,
body[data-skin="prism"] .simple-top h1,
body[data-skin="prism"] .profile-head h1 {
  color: #111;
}

body[data-skin="studio"] .library-top,
body[data-skin="studio"] .simple-top,
body[data-skin="studio"] .study-top {
  color: #fffef8;
}

body[data-skin="studio"] .library-top h1,
body[data-skin="studio"] .simple-top h1,
body[data-skin="studio"] .profile-head h1 {
  color: #fffef8;
}

body[data-skin="studio"] .library-top p,
body[data-skin="studio"] .simple-top p,
body[data-skin="studio"] .study-meta span,
body[data-skin="studio"] .profile-head p {
  color: #d7d0c5;
}

body[data-skin="prism"] .web-nav,
body[data-skin="prism"] .search-card,
body[data-skin="prism"] .video-card,
body[data-skin="prism"] .study-meta,
body[data-skin="prism"] .subtitle-settings,
body[data-skin="prism"] .sentence-card,
body[data-skin="prism"] .tool-card,
body[data-skin="prism"] .ai-chat,
body[data-skin="prism"] .profile-list,
body[data-skin="prism"] .continue-card,
body[data-skin="prism"] .empty-card {
  border-color: rgba(17, 17, 17, 0.1);
  background: rgba(255, 253, 248, 0.94);
}

body[data-skin="studio"] .web-nav,
body[data-skin="studio"] .search-card,
body[data-skin="studio"] .video-card,
body[data-skin="studio"] .study-meta,
body[data-skin="studio"] .subtitle-settings,
body[data-skin="studio"] .sentence-card,
body[data-skin="studio"] .tool-card,
body[data-skin="studio"] .ai-chat,
body[data-skin="studio"] .profile-list,
body[data-skin="studio"] .continue-card,
body[data-skin="studio"] .empty-card {
  border-color: rgba(255, 255, 255, 0.1);
  color: #fffef8;
  background: #1a1b20;
  box-shadow: none;
}

body[data-skin="studio"] .search-card input,
body[data-skin="studio"] .ai-chat textarea,
body[data-skin="studio"] .login-card input {
  border-color: rgba(255, 255, 255, 0.1);
  color: #fffef8;
  background: #111217;
}

body[data-skin="studio"] .search-card input::placeholder,
body[data-skin="studio"] .ai-chat textarea::placeholder,
body[data-skin="studio"] .login-card input::placeholder {
  color: #8f8b84;
}

body[data-skin="studio"] .category-menu > button,
body[data-skin="studio"] .category-item > button,
body[data-skin="studio"] .meta-tags span,
body[data-skin="studio"] .meta-tags b,
body[data-skin="studio"] .entry-tags span,
body[data-skin="studio"] .word-card,
body[data-skin="studio"] .word-empty,
body[data-skin="studio"] .speed-current,
body[data-skin="studio"] .segmented button,
body[data-skin="studio"] .font-options button,
body[data-skin="studio"] .size-options button,
body[data-skin="studio"] .color-options button {
  color: #f5f1ea;
  background: rgba(255, 255, 255, 0.08);
}

body[data-skin="studio"] .category-menu > button.active,
body[data-skin="studio"] .category-item > button.active,
body[data-skin="studio"] .category-item:hover > button,
body[data-skin="studio"] .category-item:focus-within > button,
body[data-skin="studio"] .category-item.menu-open > button,
body[data-skin="studio"] .segmented button.active,
body[data-skin="studio"] .font-options button.active,
body[data-skin="studio"] .size-options button.active,
body[data-skin="studio"] .color-options button.active,
body[data-skin="studio"] .speed-menu button.active {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"] .category-panel,
body[data-skin="studio"] .speed-menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(26, 27, 32, 0.88);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

body[data-skin="studio"] .menu-row:hover,
body[data-skin="studio"] .menu-row:focus,
body[data-skin="studio"] .menu-row.active,
body[data-skin="studio"] .category-back {
  background: rgba(255, 255, 255, 0.1);
}

body[data-skin="studio"] .category-panel-head b,
body[data-skin="studio"] .menu-row,
body[data-skin="studio"] .category-back,
body[data-skin="studio"] .video-info h2,
body[data-skin="studio"] .study-meta b,
body[data-skin="studio"] .study-summary strong,
body[data-skin="studio"] .sentence-card b,
body[data-skin="studio"] .tool-card h2,
body[data-skin="studio"] .profile-list b {
  color: #fffef8;
}

body[data-skin="studio"] .category-panel-head span,
body[data-skin="studio"] .menu-row small,
body[data-skin="studio"] .video-info p,
body[data-skin="studio"] .study-summary p,
body[data-skin="studio"] .sentence-card p,
body[data-skin="studio"] .sentence-actions span,
body[data-skin="studio"] .word-card small,
body[data-skin="studio"] .word-card em,
body[data-skin="studio"] .profile-list span {
  color: #d7d0c5;
}

body[data-skin="studio"] .poster-fallback {
  color: #111;
  background:
    linear-gradient(135deg, rgba(219, 255, 74, 0.95), rgba(142, 119, 255, 0.9));
}

body[data-skin="studio"] .course-progress,
body[data-skin="studio"] .bottom-nav,
body[data-skin="studio"] .study-toolbar {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(26, 27, 32, 0.96);
}

body[data-skin="studio"] .bottom-nav button,
body[data-skin="studio"] .study-toolbar button,
body[data-skin="studio"] .speed-picker {
  color: #d7d0c5;
}

body[data-skin="studio"] .bottom-nav button.active,
body[data-skin="studio"] .study-toolbar button.active {
  color: #dbff4a;
}

body[data-skin="studio"] .play-main,
body[data-skin="studio"] .green-btn,
body[data-skin="studio"] .gold-btn {
  color: #111 !important;
  background: #dbff4a !important;
}

body[data-skin="studio"] .blue-btn {
  color: #111;
  background: #f2b8d7;
}

body[data-skin="studio"] .logout-btn {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"] .bubble.user {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"] .bubble.bot {
  color: #fffef8;
  background: rgba(255, 255, 255, 0.08);
}

body[data-skin="studio"] .study-shell {
  color: #fffef8;
}

body[data-skin="studio"] .study-top {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fffef8;
  background: #1a1b20;
}

body[data-skin="studio"] .study-top h1 {
  color: #fffef8;
}

body[data-skin="studio"] .study-video {
  border-color: rgba(255, 255, 255, 0.1);
  background: #050608;
}

body[data-skin="studio"] .round-btn {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"] .sentence-card.active {
  border-color: rgba(219, 255, 74, 0.7);
  background: rgba(219, 255, 74, 0.08);
}

body[data-skin="prism"] .video-cover b,
body[data-skin="prism"] .ai-cover b,
body[data-skin="studio"] .video-cover b,
body[data-skin="studio"] .ai-cover b {
  letter-spacing: 0;
}

/* Final pass: restore the confirmed light skin and normalize logged-in scale. */
body[data-skin="prism"] {
  color: #151515;
  background: #f3f0e8;
}

body[data-skin="prism"][data-view="home"],
body[data-skin="prism"][data-view="library"],
body[data-skin="prism"][data-view="learn"],
body[data-skin="prism"][data-view="ai"],
body[data-skin="prism"][data-view="profile"] {
  background: #f3f0e8;
}

body[data-skin="prism"][data-view="home"] .mobile-shell,
body[data-skin="prism"][data-view="library"] .mobile-shell,
body[data-skin="prism"][data-view="ai"] .mobile-shell,
body[data-skin="prism"][data-view="profile"] .mobile-shell,
body[data-skin="studio"][data-view="home"] .mobile-shell,
body[data-skin="studio"][data-view="library"] .mobile-shell,
body[data-skin="studio"][data-view="ai"] .mobile-shell,
body[data-skin="studio"][data-view="profile"] .mobile-shell {
  width: min(1040px, calc(100vw - 40px));
  padding: 18px 0 42px;
}

body[data-skin="prism"] .web-nav,
body[data-skin="studio"] .web-nav {
  min-height: 64px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 22px;
}

body[data-skin="prism"] .brand img,
body[data-skin="studio"] .brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

body[data-skin="prism"] .brand b,
body[data-skin="studio"] .brand b {
  font-size: 18px;
}

body[data-skin="prism"] .brand small,
body[data-skin="studio"] .brand small {
  margin-top: 4px;
  font-size: 11px;
}

body[data-skin="prism"] .web-nav button:not(.brand),
body[data-skin="studio"] .web-nav button:not(.brand) {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

body[data-skin="prism"] .theme-switch,
body[data-skin="studio"] .theme-switch {
  padding: 3px;
}

body[data-skin="prism"] .theme-switch button,
body[data-skin="studio"] .theme-switch button {
  min-width: 48px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

body[data-skin="prism"][data-view="home"] .plain-home-top,
body[data-skin="studio"][data-view="home"] .plain-home-top {
  min-height: 176px;
  margin-bottom: 14px;
  padding: 22px;
  border-radius: 24px;
}

body[data-skin="prism"][data-view="home"] .plain-home-top {
  background: #fffdf8;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::after {
  inset: 0;
  width: auto;
  border-radius: inherit;
  background:
    linear-gradient(120deg, transparent 0 56%, rgba(232, 255, 56, 0.68) 56% 72%, rgba(242, 184, 215, 0.58) 72% 100%);
}

body[data-skin="prism"][data-view="home"] .plain-home-top h1,
body[data-skin="studio"][data-view="home"] .plain-home-top h1 {
  font-size: clamp(38px, 4.8vw, 58px);
  line-height: 0.98;
}

body[data-skin="prism"][data-view="home"] .plain-home-top p,
body[data-skin="studio"][data-view="home"] .plain-home-top p {
  font-size: 14px;
}

body[data-skin="prism"][data-view="home"] .menu-dot,
body[data-skin="studio"][data-view="home"] .menu-dot {
  min-width: 70px;
  min-height: 40px;
  font-size: 14px;
}

body[data-skin="prism"][data-view="home"] .home-card-list,
body[data-skin="studio"][data-view="home"] .home-card-list {
  gap: 14px;
}

body[data-skin="prism"][data-view="home"] .entry-card,
body[data-skin="studio"][data-view="home"] .entry-card {
  grid-template-rows: 156px 1fr;
  min-height: 372px;
  border-radius: 24px;
}

body[data-skin="prism"][data-view="home"] .entry-cover,
body[data-skin="studio"][data-view="home"] .entry-cover {
  min-height: 156px;
  padding: 16px;
  gap: 12px;
}

body[data-skin="prism"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #e8ff38 0 38%, #b8d2ed 38% 72%, #fffdf8 72%);
}

body[data-skin="prism"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent),
    #f2b8d7;
}

body[data-skin="studio"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #dbff4a 0 38%, #8e77ff 38% 72%, #17181d 72%);
}

body[data-skin="prism"][data-view="home"] .entry-cover b,
body[data-skin="studio"][data-view="home"] .entry-cover b {
  font-size: clamp(22px, 2.4vw, 30px);
}

body[data-skin="prism"][data-view="home"] .entry-cover span,
body[data-skin="studio"][data-view="home"] .entry-cover span {
  padding: 6px 11px;
  font-size: 11px;
}

body[data-skin="prism"][data-view="home"] .entry-body,
body[data-skin="studio"][data-view="home"] .entry-body {
  padding: 18px;
}

body[data-skin="prism"][data-view="home"] .entry-body h2,
body[data-skin="studio"][data-view="home"] .entry-body h2,
body[data-skin="prism"] .library-top h1,
body[data-skin="studio"] .library-top h1,
body[data-skin="prism"] .simple-top h1,
body[data-skin="studio"] .simple-top h1,
body[data-skin="prism"] .profile-head h1,
body[data-skin="studio"] .profile-head h1 {
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 950;
  line-height: 1.08;
}

body[data-skin="prism"][data-view="home"] .entry-body p,
body[data-skin="studio"][data-view="home"] .entry-body p {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.6;
}

body[data-skin="prism"] .entry-tags,
body[data-skin="studio"] .entry-tags,
body[data-skin="prism"] .meta-tags,
body[data-skin="studio"] .meta-tags {
  gap: 6px;
  margin: 12px 0;
}

body[data-skin="prism"] .entry-tags span,
body[data-skin="prism"] .meta-tags span,
body[data-skin="prism"] .meta-tags b,
body[data-skin="studio"] .entry-tags span,
body[data-skin="studio"] .meta-tags span,
body[data-skin="studio"] .meta-tags b {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

body[data-skin="prism"] .library-top,
body[data-skin="studio"] .library-top,
body[data-skin="prism"] .simple-top,
body[data-skin="studio"] .simple-top {
  padding: 10px 0 16px;
}

body[data-skin="prism"] .library-top p,
body[data-skin="studio"] .library-top p,
body[data-skin="prism"] .simple-top p,
body[data-skin="studio"] .simple-top p {
  font-size: 14px;
}

body[data-skin="prism"] .search-card,
body[data-skin="studio"] .search-card {
  width: min(560px, 100%);
  padding: 8px;
  border-radius: 18px;
}

body[data-skin="prism"] .search-card input,
body[data-skin="studio"] .search-card input {
  min-height: 44px;
  border-radius: 13px;
  font-size: 14px;
}

body[data-skin="prism"] .category-menu,
body[data-skin="studio"] .category-menu {
  gap: 8px;
  margin: 14px 0 16px;
}

body[data-skin="prism"] .category-menu > button,
body[data-skin="prism"] .category-item > button,
body[data-skin="studio"] .category-menu > button,
body[data-skin="studio"] .category-item > button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 12px;
}

body[data-skin="prism"] .course-list,
body[data-skin="studio"] .course-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body[data-skin="prism"] .video-card,
body[data-skin="studio"] .video-card {
  border-radius: 20px;
}

body[data-skin="prism"] .thumb,
body[data-skin="studio"] .thumb {
  aspect-ratio: 16 / 8.5;
}

body[data-skin="prism"] .poster-fallback {
  color: #111;
  background:
    linear-gradient(135deg, rgba(232, 255, 56, 0.78), rgba(184, 210, 237, 0.78) 56%, rgba(242, 184, 215, 0.58));
}

body[data-skin="prism"] .poster-fallback span {
  color: rgba(17, 17, 17, 0.62);
}

body[data-skin="prism"] .poster-fallback b,
body[data-skin="studio"] .poster-fallback b {
  font-size: 16px;
}

body[data-skin="prism"] .video-info,
body[data-skin="studio"] .video-info {
  padding: 13px 14px 14px;
}

body[data-skin="prism"] .video-info h2,
body[data-skin="studio"] .video-info h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-skin="prism"] .video-info p,
body[data-skin="studio"] .video-info p {
  margin-top: 7px;
  font-size: 12px;
}

body[data-skin="prism"] .duration-pill,
body[data-skin="studio"] .duration-pill {
  right: 8px;
  bottom: 8px;
  padding: 5px 7px;
  font-size: 11px;
}

body[data-skin="prism"] .ai-chat,
body[data-skin="studio"] .ai-chat,
body[data-skin="prism"] .profile-list,
body[data-skin="studio"] .profile-list,
body[data-skin="prism"] .continue-card,
body[data-skin="studio"] .continue-card {
  width: min(700px, 100%);
  padding: 16px;
  border-radius: 20px;
}

body[data-skin="prism"] .profile-head img,
body[data-skin="studio"] .profile-head img {
  width: 58px;
  height: 58px;
}

body[data-skin="prism"] .profile-list article,
body[data-skin="studio"] .profile-list article {
  padding: 12px 0;
  font-size: 14px;
}

body[data-skin="prism"] .logout-btn,
body[data-skin="studio"] .logout-btn {
  width: min(700px, 100%);
}

body[data-skin="prism"] .study-shell,
body[data-skin="studio"] .study-shell {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

body[data-skin="prism"] .study-top,
body[data-skin="studio"] .study-top {
  top: 12px;
  min-height: 54px;
  margin: 18px 0 12px;
  border-radius: 18px;
}

body[data-skin="prism"] .study-top h1,
body[data-skin="studio"] .study-top h1 {
  font-size: 16px;
}

@media (min-width: 900px) {
  body[data-skin="prism"] .bottom-nav,
  body[data-skin="studio"] .bottom-nav {
    display: none;
  }
}

@media (max-width: 899px) {
  body[data-view="library"] .mobile-shell,
  body[data-view="ai"] .mobile-shell,
  body[data-view="profile"] .mobile-shell {
    display: flex;
    flex-direction: column;
    padding-top: 76px !important;
    padding-top: calc(76px + env(safe-area-inset-top)) !important;
  }

  body[data-view="library"] .bottom-nav,
  body[data-view="ai"] .bottom-nav,
  body[data-view="profile"] .bottom-nav {
    position: fixed !important;
    top: 8px;
    top: max(8px, env(safe-area-inset-top));
    left: 50%;
    bottom: auto;
    z-index: 50;
    width: calc(100% - 22px);
    max-width: 408px;
    width: min(408px, calc(100% - 22px));
    height: 56px;
    min-height: 56px;
    margin: 0;
    padding-bottom: 0;
    border: 1px solid rgba(20, 20, 20, 0.1);
    border-radius: 20px;
    box-shadow: 0 12px 26px rgba(24, 22, 18, 0.1);
    transform: translateX(-50%);
  }

  .bottom-nav button:focus-visible {
    outline: 3px solid #2457ff;
    outline-offset: -4px;
  }

  body[data-skin="studio"] .bottom-nav button:focus-visible {
    outline-color: #ffffff;
  }

  body[data-skin="studio"] .bottom-nav button.active:focus-visible {
    outline-color: #2457ff;
  }

  body[data-skin="prism"][data-view="home"] .mobile-shell,
  body[data-skin="prism"][data-view="library"] .mobile-shell,
  body[data-skin="prism"][data-view="ai"] .mobile-shell,
  body[data-skin="prism"][data-view="profile"] .mobile-shell,
  body[data-skin="studio"][data-view="home"] .mobile-shell,
  body[data-skin="studio"][data-view="library"] .mobile-shell,
  body[data-skin="studio"][data-view="ai"] .mobile-shell,
  body[data-skin="studio"][data-view="profile"] .mobile-shell {
    width: 100%;
    max-width: 430px;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top,
  body[data-skin="studio"][data-view="home"] .plain-home-top {
    min-height: 146px;
    padding: 16px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top h1,
  body[data-skin="studio"][data-view="home"] .plain-home-top h1,
  body[data-skin="prism"] .library-top h1,
  body[data-skin="studio"] .library-top h1,
  body[data-skin="prism"] .simple-top h1,
  body[data-skin="studio"] .simple-top h1 {
    font-size: clamp(26px, 8vw, 34px);
  }

  body[data-skin="prism"][data-view="home"] .entry-card,
  body[data-skin="studio"][data-view="home"] .entry-card {
    grid-template-rows: 126px 1fr;
    min-height: auto;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover,
  body[data-skin="studio"][data-view="home"] .entry-cover {
    min-height: 126px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body h2,
  body[data-skin="studio"][data-view="home"] .entry-body h2 {
    font-size: 24px;
  }

  body[data-skin="prism"] .course-list,
  body[data-skin="studio"] .course-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-skin="prism"] .video-card,
  body[data-skin="studio"] .video-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    min-height: 92px;
  }

  body[data-skin="prism"] .thumb,
  body[data-skin="studio"] .thumb {
    height: 100%;
    min-height: 92px;
    aspect-ratio: auto;
  }

  body[data-skin="prism"] .video-info,
  body[data-skin="studio"] .video-info {
    padding: 10px 11px;
  }

  body[data-skin="prism"] .video-info h2,
  body[data-skin="studio"] .video-info h2 {
    font-size: 14px;
  }

  body[data-skin="prism"] .meta-tags span,
  body[data-skin="prism"] .meta-tags b,
  body[data-skin="studio"] .meta-tags span,
  body[data-skin="studio"] .meta-tags b {
    min-height: 23px;
    padding: 0 8px;
    font-size: 11px;
  }

  body[data-skin="prism"] .web-nav,
  body[data-skin="studio"] .web-nav {
    display: none;
  }

  body[data-skin="prism"] .bottom-nav,
  body[data-skin="studio"] .bottom-nav {
    display: grid;
  }
}

.profile-account-tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manual-head {
  align-items: center;
}

.manual-reader-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line, #dedbd3);
  border-radius: 28px;
  background: var(--card, #fffdf8);
  box-shadow: 0 18px 45px rgba(31, 30, 26, .08);
}

.manual-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.manual-reader-toolbar div {
  display: grid;
  gap: 4px;
}

.manual-reader-toolbar b {
  font-size: 20px;
}

.manual-reader-toolbar small,
.manual-reader-note {
  color: var(--muted, #706d65);
}

.manual-pdf-frame {
  display: block;
  width: 100%;
  min-height: min(76vh, 980px);
  border: 0;
  border-radius: 18px;
  background: #ececec;
}

.manual-reader-note {
  margin: 14px 4px 0;
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .manual-reader-card { padding: 12px; border-radius: 20px; }
  .manual-reader-toolbar { align-items: flex-start; flex-direction: column; }
  .manual-pdf-frame { min-height: 70vh; border-radius: 12px; }
}

/* Final scale tuning after visual QA. */
@media (min-width: 900px) {
  body[data-skin="prism"][data-view="home"] .mobile-shell,
  body[data-skin="prism"][data-view="library"] .mobile-shell,
  body[data-skin="prism"][data-view="ai"] .mobile-shell,
  body[data-skin="prism"][data-view="profile"] .mobile-shell,
  body[data-skin="studio"][data-view="home"] .mobile-shell,
  body[data-skin="studio"][data-view="library"] .mobile-shell,
  body[data-skin="studio"][data-view="ai"] .mobile-shell,
  body[data-skin="studio"][data-view="profile"] .mobile-shell {
    width: min(980px, calc(100vw - 48px));
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top,
  body[data-skin="studio"][data-view="home"] .plain-home-top {
    min-height: 150px;
    padding: 20px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top h1,
  body[data-skin="studio"][data-view="home"] .plain-home-top h1 {
    font-size: clamp(34px, 4vw, 48px);
  }

  body[data-skin="prism"][data-view="home"] .home-continue,
  body[data-skin="studio"][data-view="home"] .home-continue {
    padding: 14px 16px;
  }

  body[data-skin="prism"][data-view="home"] .home-continue h2,
  body[data-skin="studio"][data-view="home"] .home-continue h2 {
    font-size: 16px;
  }

  body[data-skin="prism"][data-view="home"] .entry-card,
  body[data-skin="studio"][data-view="home"] .entry-card {
    grid-template-rows: 132px 1fr;
    min-height: 322px;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover,
  body[data-skin="studio"][data-view="home"] .entry-cover {
    min-height: 132px;
  }

  body[data-skin="prism"][data-view="home"] .video-cover,
  body[data-skin="studio"][data-view="home"] .video-cover {
    background-size: 76px, auto;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover b,
  body[data-skin="studio"][data-view="home"] .entry-cover b {
    font-size: 24px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body h2,
  body[data-skin="studio"][data-view="home"] .entry-body h2 {
    font-size: 26px;
  }

  body[data-skin="prism"] .library-top h1,
  body[data-skin="studio"] .library-top h1,
  body[data-skin="prism"] .simple-top h1,
  body[data-skin="studio"] .simple-top h1,
  body[data-skin="prism"] .profile-head h1,
  body[data-skin="studio"] .profile-head h1 {
    font-size: 30px;
  }

  body[data-skin="prism"] .thumb,
  body[data-skin="studio"] .thumb {
    aspect-ratio: 16 / 7.6;
  }

  body[data-skin="prism"] .video-info h2,
  body[data-skin="studio"] .video-info h2 {
    font-size: 14px;
  }

  body[data-skin="prism"] .video-info,
  body[data-skin="studio"] .video-info {
    padding: 12px 13px 13px;
  }
}

body[data-skin="studio"] .home-continue h2,
body[data-skin="studio"] .continue-card h2 {
  color: #fffef8;
}

body[data-skin="studio"] .home-continue p,
body[data-skin="studio"] .continue-card p {
  color: #d7d0c5;
}

body[data-skin="studio"] .home-continue span,
body[data-skin="studio"] .continue-card span {
  color: #22c777;
}

/* Restore Scheme A as a distinct light-forward visual direction. */
body[data-skin="prism"][data-view="home"] {
  background: #f3efe7;
}

body[data-skin="prism"][data-view="home"] .mobile-shell {
  width: min(1120px, calc(100vw - 48px));
  padding-top: 18px;
}

body[data-skin="prism"][data-view="home"] .web-nav {
  min-height: 66px;
  border: 0;
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: none;
}

body[data-skin="prism"][data-view="home"] .web-nav button.active {
  color: #fff;
  background: #111;
}

body[data-skin="prism"][data-view="home"] .plain-home-top {
  min-height: 226px;
  margin-bottom: 18px;
  padding: 30px;
  border: 0;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  background: #fffdf8;
  box-shadow: none;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::before {
  content: "";
  position: absolute;
  left: -8%;
  top: -20%;
  z-index: 0;
  width: 34%;
  height: 145%;
  border-radius: 34px;
  background: #e8ff38;
  transform: skewX(-24deg);
}

body[data-skin="prism"][data-view="home"] .plain-home-top::after {
  content: "";
  position: absolute;
  right: -4%;
  bottom: -18%;
  top: auto;
  left: auto;
  z-index: 0;
  width: 44%;
  height: 132%;
  border-radius: 34px;
  background: #b8d2ed;
  transform: skewX(-24deg);
}

body[data-skin="prism"][data-view="home"] .plain-home-top > * {
  position: relative;
  z-index: 1;
}

body[data-skin="prism"][data-view="home"] .plain-home-top h1 {
  color: #111;
  font-size: clamp(52px, 6vw, 86px);
  font-weight: 950;
  line-height: 0.92;
}

body[data-skin="prism"][data-view="home"] .plain-home-top p {
  color: #25231f;
  font-size: 15px;
}

body[data-skin="prism"][data-view="home"] .menu-dot {
  min-width: 76px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #111;
  box-shadow: none;
}

body[data-skin="prism"][data-view="home"] .home-continue,
body[data-skin="prism"][data-view="home"] .entry-card {
  border: 0;
  border-radius: 30px;
  background: #fffdf8;
  box-shadow: none;
}

body[data-skin="prism"][data-view="home"] .home-continue {
  padding: 18px 22px;
}

body[data-skin="prism"][data-view="home"] .home-card-list {
  gap: 18px;
}

body[data-skin="prism"][data-view="home"] .entry-card {
  grid-template-rows: 190px 1fr;
  min-height: 430px;
}

body[data-skin="prism"][data-view="home"] .entry-cover {
  min-height: 190px;
  padding: 20px;
}

body[data-skin="prism"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 108px no-repeat,
    linear-gradient(135deg, #e8ff38 0 36%, #b8d2ed 36% 70%, #fffdf8 70%);
}

body[data-skin="prism"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
    #f2b8d7;
}

body[data-skin="prism"][data-view="home"] .entry-cover span {
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  color: #111;
  background: rgba(255, 255, 255, 0.9);
}

body[data-skin="prism"][data-view="home"] .entry-cover b {
  color: #111;
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: 1;
}

body[data-skin="prism"][data-view="home"] .entry-body {
  padding: 22px;
}

body[data-skin="prism"][data-view="home"] .entry-body h2 {
  color: #111;
  font-size: 34px;
}

body[data-skin="prism"][data-view="home"] .entry-body p {
  color: #4b4740;
  font-size: 14px;
}

body[data-skin="prism"][data-view="home"] .gold-btn,
body[data-skin="prism"][data-view="home"] .blue-btn {
  min-height: 48px;
  border-radius: 999px;
  color: #fff;
  background: #111;
}

body[data-skin="prism"][data-view="library"] .poster-fallback,
body[data-skin="prism"][data-view="profile"] .poster-fallback {
  background:
    linear-gradient(135deg, #e8ff38 0 26%, #b8d2ed 26% 72%, #f2b8d7 72% 100%);
}

@media (max-width: 899px) {
  body[data-skin="prism"][data-view="home"] .mobile-shell {
    width: 100%;
    max-width: 430px;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top {
    min-height: 176px;
    padding: 18px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top h1 {
    font-size: clamp(42px, 12vw, 56px);
  }

  body[data-skin="prism"][data-view="home"] .entry-card {
    grid-template-rows: 146px 1fr;
    min-height: auto;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover {
    min-height: 146px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body h2 {
    font-size: 28px;
  }
}

/* Match Scheme A page scale to Scheme B while keeping Scheme A colors. */
@media (min-width: 900px) {
  body[data-skin="prism"][data-view="home"] .mobile-shell {
    width: min(980px, calc(100vw - 48px));
    padding-top: 18px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top {
    min-height: 150px;
    padding: 20px;
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top h1 {
    font-size: clamp(34px, 4vw, 48px);
  }

  body[data-skin="prism"][data-view="home"] .plain-home-top p {
    font-size: 14px;
  }

  body[data-skin="prism"][data-view="home"] .home-continue {
    padding: 14px 16px;
  }

  body[data-skin="prism"][data-view="home"] .entry-card {
    grid-template-rows: 132px 1fr;
    min-height: 322px;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover {
    min-height: 132px;
    padding: 16px;
  }

  body[data-skin="prism"][data-view="home"] .video-cover {
    background-size: 76px, auto;
  }

  body[data-skin="prism"][data-view="home"] .entry-cover b {
    font-size: 24px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body {
    padding: 18px;
  }

  body[data-skin="prism"][data-view="home"] .entry-body h2 {
    font-size: 26px;
  }
}

/* Edge sealing: avoid 1px background leaks around rounded color panels. */
body[data-skin="prism"][data-view="home"] .plain-home-top {
  background:
    linear-gradient(110deg, #e8ff38 0 24%, transparent 24.2%),
    linear-gradient(110deg, transparent 0 64%, #b8d2ed 64.2% 100%),
    #fffdf8;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::before,
body[data-skin="prism"][data-view="home"] .plain-home-top::after {
  display: none;
}

body[data-skin="studio"][data-view="home"] .plain-home-top {
  background:
    linear-gradient(120deg, #17181d 0 52%, #9dbb35 52.2% 70%, #b68fa5 70.2% 100%);
}

body[data-skin="studio"][data-view="home"] .plain-home-top::after {
  display: none;
}

body[data-skin="prism"][data-view="home"] .entry-card,
body[data-skin="studio"][data-view="home"] .entry-card,
body[data-skin="prism"] .video-card,
body[data-skin="studio"] .video-card {
  overflow: hidden;
  background-clip: padding-box;
}

body[data-skin="prism"][data-view="home"] .entry-cover,
body[data-skin="studio"][data-view="home"] .entry-cover,
body[data-skin="prism"] .thumb,
body[data-skin="studio"] .thumb {
  margin: -1px -1px 0;
  width: calc(100% + 2px);
}

body[data-skin="prism"] .poster-fallback,
body[data-skin="studio"] .poster-fallback,
body[data-skin="prism"][data-view="home"] .video-cover,
body[data-skin="studio"][data-view="home"] .video-cover,
body[data-skin="prism"][data-view="home"] .ai-cover,
body[data-skin="studio"][data-view="home"] .ai-cover {
  background-origin: border-box;
  background-clip: border-box;
}

/* Final skin edge lock: all decorative color panels must fill their masks cleanly. */
body[data-skin="prism"][data-view="home"] .plain-home-top,
body[data-skin="studio"][data-view="home"] .plain-home-top,
body[data-skin="prism"][data-view="home"] .entry-cover,
body[data-skin="studio"][data-view="home"] .entry-cover,
body[data-skin="prism"] .thumb,
body[data-skin="studio"] .thumb {
  transform: translateZ(0);
  backface-visibility: hidden;
  isolation: isolate;
}

body[data-skin="studio"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #dbff4a 0 36%, #8e77ff 36.2% 74%, #b68fa5 74.2% 100%);
}

body[data-skin="prism"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #e8ff38 0 36%, #b8d2ed 36.2% 74%, #f2b8d7 74.2% 100%);
}

body[data-skin="prism"][data-view="home"] .plain-home-top,
body[data-skin="studio"][data-view="home"] .plain-home-top {
  outline: 1px solid transparent;
  background-clip: border-box;
}

/* Clean clipped hero panels: no gradient edge can skim the rounded frame. */
body[data-skin="prism"][data-view="home"] .plain-home-top {
  background: #fffdf8;
}

body[data-skin="studio"][data-view="home"] .plain-home-top {
  background: #17181d;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::before,
body[data-skin="prism"][data-view="home"] .plain-home-top::after,
body[data-skin="studio"][data-view="home"] .plain-home-top::before,
body[data-skin="studio"][data-view="home"] .plain-home-top::after {
  content: "";
  display: block;
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::before {
  inset: -1px auto -1px -1px;
  width: 28%;
  background: #e8ff38;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
}

body[data-skin="prism"][data-view="home"] .plain-home-top::after {
  inset: -1px -1px -1px auto;
  width: 33%;
  background: #b8d2ed;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="studio"][data-view="home"] .plain-home-top::before {
  inset: -1px auto -1px 48%;
  width: 26%;
  background: #9dbb35;
  clip-path: polygon(22% 0, 100% 0, 76% 100%, 0 100%);
}

body[data-skin="studio"][data-view="home"] .plain-home-top::after {
  inset: -1px -1px -1px auto;
  width: 34%;
  background: #b68fa5;
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="prism"][data-view="home"] .plain-home-top > *,
body[data-skin="studio"][data-view="home"] .plain-home-top > * {
  position: relative;
  z-index: 1;
}

/* Login welcome cards use clipped panels too, so no accent color peeks through edges. */
body[data-skin="prism"] .welcome-card,
body[data-skin="studio"] .welcome-card {
  position: relative;
  overflow: hidden;
  background-clip: border-box;
}

body[data-skin="prism"] .welcome-card {
  background:
    linear-gradient(104deg, #e8ff38 0 22%, transparent 22.2%),
    #fffaf0;
}

body[data-skin="studio"] .welcome-card {
  background: #17181d;
}

body[data-skin="prism"] .welcome-card::before,
body[data-skin="studio"] .welcome-card::before,
body[data-skin="prism"] .welcome-card::after,
body[data-skin="studio"] .welcome-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transform: none;
}

body[data-skin="prism"] .welcome-card::before {
  inset: -1px -1px -1px 38%;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: rgba(184, 210, 237, 0.76);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="studio"] .welcome-card::before {
  inset: -1px -1px -1px 36%;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: rgba(142, 119, 255, 0.44);
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="prism"] .welcome-card::after {
  right: 12%;
  bottom: 7%;
  width: 168px;
  height: 104px;
  border-radius: 24px;
  background: #f2b8d7;
  transform: rotate(-7deg);
}

body[data-skin="studio"] .welcome-card::after {
  right: 9%;
  bottom: 8%;
  width: 178px;
  height: 108px;
  border-radius: 26px;
  background: rgba(219, 255, 74, 0.78);
  transform: rotate(-6deg);
}

body[data-skin="prism"] .welcome-card > *,
body[data-skin="studio"] .welcome-card > * {
  position: relative;
  z-index: 1;
}

/* Keep Scheme B visually independent from Scheme A after the edge fixes. */
body[data-skin="studio"] .welcome-card {
  color: #f7f2e8;
  background:
    radial-gradient(circle at 18% 16%, rgba(219, 255, 74, 0.14), transparent 34%),
    linear-gradient(150deg, #17181d 0%, #17181d 56%, #231f35 56.2% 100%);
}

body[data-skin="studio"] .welcome-card::before {
  inset: -1px -1px -1px auto;
  width: 32%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: #4b427d;
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="studio"] .welcome-card::after {
  right: 9%;
  bottom: 7%;
  width: 178px;
  height: 102px;
  border-radius: 24px;
  background: #b9da3d;
  transform: rotate(-6deg);
}

body[data-skin="studio"][data-view="home"] .plain-home-top {
  color: #f7f2e8;
  background:
    radial-gradient(circle at 78% 40%, rgba(219, 255, 74, 0.08), transparent 24%),
    #17181d;
}

body[data-skin="studio"][data-view="home"] .plain-home-top::before {
  inset: auto -1px -1px 48%;
  width: auto;
  height: 44%;
  background: #9fbc36;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="studio"][data-view="home"] .plain-home-top::after {
  inset: -1px -1px -1px auto;
  width: 27%;
  background: #b68fa5;
  clip-path: none;
}

body[data-skin="studio"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #dbff4a 0 30%, #8e77ff 30.2% 64%, #17181d 64.2% 100%);
}

body[data-skin="studio"][data-view="home"] .ai-cover {
  background:
    linear-gradient(90deg, rgba(219, 255, 74, 0.08), transparent 34%),
    #2b2548;
}

/* Restore the agreed two visual schemes: A light-forward, B dark-premium. */
body[data-skin="prism"][data-view="login"],
body[data-skin="prism"][data-view="register"],
body[data-skin="prism"][data-view="forgot"],
body[data-skin="prism"][data-view="home"] {
  background: #f3eee5;
}

body[data-skin="prism"] .welcome-card {
  background:
    linear-gradient(104deg, #e8ff38 0 22%, transparent 22.2%),
    #fffaf0;
}

body[data-skin="prism"] .welcome-card::before {
  inset: -1px -1px -1px 38%;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: rgba(184, 210, 237, 0.76);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
  transform: none;
}

body[data-skin="prism"] .welcome-card::after {
  right: 12%;
  bottom: 7%;
  width: 168px;
  height: 104px;
  border-radius: 24px;
  background: #f2b8d7;
  transform: rotate(-7deg);
}

body[data-skin="prism"][data-view="home"] .plain-home-top {
  color: #111;
  background: #fffdf8;
}

body[data-skin="prism"][data-view="home"] .plain-home-top::before {
  inset: -1px auto -1px -1px;
  width: 28%;
  background: #e8ff38;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
}

body[data-skin="prism"][data-view="home"] .plain-home-top::after {
  inset: -1px -1px -1px auto;
  width: 33%;
  background: #b8d2ed;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="prism"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #e8ff38 0 36%, #b8d2ed 36.2% 74%, #f2b8d7 74.2% 100%);
}

body[data-skin="prism"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent),
    #f2b8d7;
}

body[data-skin="studio"][data-view="login"],
body[data-skin="studio"][data-view="register"],
body[data-skin="studio"][data-view="forgot"],
body[data-skin="studio"][data-view="home"] {
  background: #101114;
  color: #f7f2e8;
}

body[data-skin="studio"] .welcome-card {
  color: #f7f2e8;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(142, 119, 255, 0.42) 48.2% 76%, transparent 76.2%),
    linear-gradient(115deg, rgba(219, 255, 74, 0.18), transparent 38%),
    #17181d;
}

body[data-skin="studio"] .welcome-card::before {
  display: none;
}

body[data-skin="studio"] .welcome-card::after {
  right: 9%;
  bottom: 8%;
  width: 178px;
  height: 108px;
  border-radius: 26px;
  background: rgba(219, 255, 74, 0.78);
  transform: rotate(-6deg);
}

body[data-skin="studio"][data-view="home"] .plain-home-top {
  color: #f7f2e8;
  background: #17181d;
}

body[data-skin="studio"][data-view="home"] .plain-home-top::before {
  inset: -1px auto -1px 50%;
  width: 26%;
  height: auto;
  background: #9dbb35;
  clip-path: polygon(22% 0, 100% 0, 76% 100%, 0 100%);
}

body[data-skin="studio"][data-view="home"] .plain-home-top::after {
  inset: -1px -1px -1px auto;
  width: 34%;
  height: auto;
  background: #b68fa5;
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-skin="studio"][data-view="home"] .video-cover {
  background:
    url("assets/brand/suzy-english-academy-logo.png") center / 92px no-repeat,
    linear-gradient(135deg, #dbff4a 0 34%, #8e77ff 34.2% 72%, #17181d 72.2% 100%);
}

body[data-skin="studio"][data-view="home"] .ai-cover {
  background:
    linear-gradient(135deg, rgba(219, 255, 74, 0.08), transparent 34%),
    #2b2548;
}

/* Subtitle menu opens over the paused video frame. */
.study-video.settings-open .video-subtitle {
  opacity: 0.22;
}

.study-video .subtitle-settings {
  position: absolute;
  right: 8px;
  bottom: 136px;
  left: auto;
  z-index: 2147483647;
  display: grid;
  width: min(360px, calc(100% - 16px));
  max-height: min(420px, calc(100dvh - 180px));
  overflow-y: auto;
  overflow-x: hidden;
  transform: none;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: #f7f2e8;
  background: rgba(18, 19, 24, 0.82);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.study-video .subtitle-settings span {
  position: static;
  inset: auto;
  display: inline;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-weight: inherit;
}

.study-video .subtitle-settings-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.study-video .subtitle-settings-head b {
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.study-video .subtitle-settings-head button {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #111;
  background: rgba(255, 253, 248, 0.88);
  font-size: 11px;
  font-weight: 900;
}

.study-video .subtitle-setting-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.study-video .subtitle-setting-row > span {
  padding-top: 7px;
  color: rgba(247, 242, 232, 0.7);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.study-video .segmented,
.study-video .font-options,
.study-video .size-options,
.study-video .color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.study-video .segmented button,
.study-video .font-options button,
.study-video .size-options button,
.study-video .color-options button {
  width: auto;
  min-height: 27px;
  padding: 0 8px;
  border-radius: 999px;
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.13);
  font-size: 10px;
  font-weight: 900;
}

.study-video .segmented button.active,
.study-video .font-options button.active,
.study-video .size-options button.active,
.study-video .color-options button.active {
  color: #111;
  background: #dbff4a;
}

.study-video .color-options button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.study-video .color-options i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

body[data-skin="prism"] .study-video .subtitle-settings {
  color: #111;
  border-color: rgba(24, 22, 18, 0.12);
  background: rgba(255, 253, 248, 0.78);
}

body[data-skin="prism"] .study-video .subtitle-settings-head b,
body[data-skin="prism"] .study-video .subtitle-setting-row > span {
  color: #171717;
}

body[data-skin="prism"] .study-video .segmented button,
body[data-skin="prism"] .study-video .font-options button,
body[data-skin="prism"] .study-video .size-options button,
body[data-skin="prism"] .study-video .color-options button {
  color: #171717;
  background: rgba(244, 240, 232, 0.82);
}

body[data-skin="prism"] .study-video .segmented button.active,
body[data-skin="prism"] .study-video .font-options button.active,
body[data-skin="prism"] .study-video .size-options button.active,
body[data-skin="prism"] .study-video .color-options button.active {
  color: #111;
  background: #e8ff38;
}

/* Place subtitle settings just above the native playback bar, not in the center. */
.study-video .subtitle-settings {
  top: auto;
  bottom: 78px;
  width: min(900px, calc(100% - 72px));
  max-height: min(44%, 190px);
  padding: 8px 10px;
  gap: 5px;
  border-radius: 16px;
  background: rgba(18, 19, 24, 0.52);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.study-video .subtitle-settings-head {
  margin-bottom: 2px;
}

.study-video .subtitle-settings-head b {
  font-size: 13px;
}

.study-video .subtitle-settings-head button {
  min-height: 24px;
  padding: 0 9px;
}

.study-video .subtitle-setting-row {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 5px;
}

.study-video .subtitle-setting-row > span {
  padding-top: 6px;
}

.study-video .segmented,
.study-video .font-options,
.study-video .size-options,
.study-video .color-options {
  gap: 5px;
}

.study-video .segmented button,
.study-video .font-options button,
.study-video .size-options button,
.study-video .color-options button {
  min-height: 24px;
  padding: 0 7px;
}

body[data-skin="prism"] .study-video .subtitle-settings {
  background: rgba(255, 253, 248, 0.56);
}

@media (max-width: 520px) {
  .study-video .subtitle-settings {
    top: auto;
    bottom: 56px;
    width: calc(100% - 20px);
    max-height: min(48%, 150px);
    padding: 7px;
    border-radius: 16px;
  }

  .study-video .subtitle-setting-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 5px;
  }

  .study-video .segmented button,
  .study-video .font-options button,
  .study-video .size-options button,
  .study-video .color-options button {
    min-height: 24px;
    padding: 0 7px;
    font-size: 10px;
  }
}

/* Subtitle settings now live in the video info card. */
.study-meta .subtitle-settings {
  position: static;
  display: grid;
  gap: 8px;
  width: 100%;
  max-height: 156px;
  margin: 14px 0 4px;
  overflow: visible;
  padding: 12px;
  border: 1px solid rgba(22, 22, 22, 0.1);
  border-radius: 18px;
  color: #171717;
  background: rgba(255, 253, 248, 0.68);
  box-shadow: none;
  transform: none;
  backdrop-filter: blur(14px);
}

.study-meta .subtitle-settings span {
  position: static;
  inset: auto;
  display: inline;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-weight: inherit;
}

.study-meta .subtitle-settings-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.study-meta .subtitle-settings-head b {
  font-size: 12px;
  line-height: 1.2;
}

.study-meta .subtitle-settings-head button,
.study-meta .segmented button,
.study-meta .font-options button,
.study-meta .size-options button,
.study-meta .color-options button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.study-meta .subtitle-setting-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.study-meta .subtitle-setting-row > span {
  padding-top: 8px;
  color: #69645d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.study-meta .subtitle-settings,
.study-meta .subtitle-settings * {
  font-size: 12px;
}

.study-meta .segmented,
.study-meta .font-options,
.study-meta .size-options,
.study-meta .color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.study-meta .color-options button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.study-meta .color-options i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.study-meta .segmented button.active,
.study-meta .font-options button.active,
.study-meta .size-options button.active,
.study-meta .color-options button.active {
  color: #111;
  background: #dbff4a;
}

body[data-skin="studio"] .study-meta .subtitle-settings {
  border-color: rgba(255, 255, 255, 0.12);
  color: #f7f2e8;
  background: rgba(23, 24, 29, 0.72);
}

body[data-skin="studio"] .study-meta .subtitle-setting-row > span {
  color: rgba(247, 242, 232, 0.76);
}

body[data-skin="studio"] .study-meta .subtitle-settings-head button,
body[data-skin="studio"] .study-meta .segmented button,
body[data-skin="studio"] .study-meta .font-options button,
body[data-skin="studio"] .study-meta .size-options button,
body[data-skin="studio"] .study-meta .color-options button {
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.12);
}

body[data-skin="studio"] .study-meta .subtitle-settings-head button {
  color: #111;
  background: rgba(255, 253, 248, 0.88);
}

body[data-skin="studio"] .study-meta .segmented button.active,
body[data-skin="studio"] .study-meta .font-options button.active,
body[data-skin="studio"] .study-meta .size-options button.active,
body[data-skin="studio"] .study-meta .color-options button.active {
  color: #111;
  background: #dbff4a;
}

@media (max-width: 520px) {
  .study-meta .subtitle-settings {
    padding: 10px;
    border-radius: 16px;
  }

  .study-meta .subtitle-setting-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
  }

  .study-meta .subtitle-settings-head button,
  .study-meta .segmented button,
  .study-meta .font-options button,
  .study-meta .size-options button,
  .study-meta .color-options button,
  .study-meta .subtitle-setting-row > span {
    font-size: 12px;
  }

  .study-meta .subtitle-settings,
  .study-meta .subtitle-settings * {
    font-size: 12px;
  }
}

/* Floating subtitle settings in the upper half of the info card. */
.study-meta {
  position: relative;
  overflow: visible;
}

.study-meta .subtitle-settings {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  z-index: 40;
  max-height: none;
  overflow: visible;
  margin: 0;
  background: rgba(255, 253, 248, 0.58);
  box-shadow: 0 16px 36px rgba(20, 18, 14, 0.12);
}

body[data-skin="studio"] .study-meta .subtitle-settings {
  background: rgba(23, 24, 29, 0.58);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

@media (max-width: 520px) {
  .study-meta .subtitle-settings {
    left: 10px;
    right: 10px;
    top: 10px;
    max-height: none;
  }
}

.study-toolbar {
  position: relative;
  z-index: 10;
}

/* Compact floating subtitle menu in the study toolbar. */
.study-toolbar {
  overflow: visible;
}

.study-toolbar .subtitle-settings {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: min(46vh, 330px);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(30, 25, 20, 0.1);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 18px 42px rgba(23, 19, 14, 0.16);
  backdrop-filter: blur(18px);
}

.study-toolbar .subtitle-settings-head {
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.study-toolbar .subtitle-settings-head b {
  font-size: 14px;
  line-height: 1;
}

.study-toolbar .subtitle-settings-head button {
  min-height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

.study-toolbar .subtitle-setting-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.study-toolbar .subtitle-setting-row > span {
  padding-top: 7px;
  font-size: 10px;
  line-height: 1.2;
}

.study-toolbar .segmented,
.study-toolbar .font-options,
.study-toolbar .size-options,
.study-toolbar .color-options {
  gap: 6px;
}

.study-toolbar .segmented button,
.study-toolbar .font-options button,
.study-toolbar .size-options button,
.study-toolbar .color-options button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
  line-height: 1;
}

.study-toolbar .color-options button {
  gap: 5px;
}

.study-toolbar .color-options i {
  width: 13px;
  height: 13px;
}

body[data-skin="studio"] .study-toolbar .subtitle-settings {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(23, 24, 29, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

body[data-skin="studio"] .study-toolbar .subtitle-settings-head b {
  color: #f7f2e8;
}

body[data-skin="studio"] .study-toolbar .subtitle-settings-head button,
body[data-skin="studio"] .study-toolbar .segmented button,
body[data-skin="studio"] .study-toolbar .font-options button,
body[data-skin="studio"] .study-toolbar .size-options button,
body[data-skin="studio"] .study-toolbar .color-options button {
  color: #f7f2e8;
  background: rgba(255, 255, 255, 0.1);
}

body[data-skin="studio"] .study-toolbar .segmented button.active,
body[data-skin="studio"] .study-toolbar .font-options button.active,
body[data-skin="studio"] .study-toolbar .size-options button.active,
body[data-skin="studio"] .study-toolbar .color-options button.active {
  color: #111;
  background: #dbff4a;
}

@media (max-width: 520px) {
  .study-toolbar .subtitle-settings {
    left: 4px;
    right: 4px;
    max-height: min(42vh, 218px);
    padding: 9px;
    border-radius: 18px;
  }

  .study-toolbar .subtitle-setting-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 6px;
  }

  .study-toolbar .segmented button,
  .study-toolbar .font-options button,
  .study-toolbar .size-options button,
  .study-toolbar .color-options button {
    min-height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }
}

/* Final study-page repair: keep subtitles readable and the playback bar in place. */

@media (max-width: 640px) {
  .simple-top {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .simple-top h1 {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    line-height: 1.05 !important;
  }

  .simple-top p {
    grid-column: 1 !important;
    margin-top: 0 !important;
  }
}
.study-video.settings-open .video-subtitle,
.study-video .video-subtitle {
  opacity: 1 !important;
}

.video-subtitle {
  bottom: 34px !important;
  z-index: 8 !important;
  pointer-events: none !important;
}

.subtitle-line {
  opacity: 1 !important;
  color: var(--subtitle-color, #fff) !important;
  background: var(--subtitle-bg, rgba(0, 0, 0, 0.68)) !important;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.82) !important;
}

.study-meta {
  position: relative;
  overflow: visible;
}

.study-meta .subtitle-settings {
  position: static !important;
  z-index: auto !important;
  display: grid !important;
  width: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 14px 0 4px !important;
  transform: none !important;
  padding: 14px !important;
  border-radius: 20px !important;
  background: rgba(255, 253, 248, 0.86) !important;
  box-shadow: 0 18px 42px rgba(20, 18, 14, 0.16) !important;
  backdrop-filter: blur(16px);
}

body[data-skin="studio"] .study-meta .subtitle-settings {
  background: rgba(23, 24, 29, 0.86) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28) !important;
}

.study-meta .subtitle-settings,
.study-meta .subtitle-settings *,
.study-meta .subtitle-settings button,
.study-meta .subtitle-settings span,
.study-meta .subtitle-settings b {
  font-size: 14px !important;
  line-height: 1.15 !important;
}

.study-meta .subtitle-setting-row {
  grid-template-columns: 88px minmax(0, 1fr) !important;
  gap: 10px !important;
}

.study-meta .subtitle-settings-head button,
.study-meta .segmented button,
.study-meta .font-options button,
.study-meta .size-options button,
.study-meta .color-options button {
  min-height: 34px !important;
  padding: 0 13px !important;
}

.study-toolbar {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 12 !important;
  grid-column: 1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: center !important;
  width: 100% !important;
  max-width: none !important;
  height: 70px !important;
  min-height: 70px !important;
  margin: 0 0 14px !important;
  transform: none !important;
}

.study-toolbar .subtitle-settings {
  display: none !important;
}

@media (max-width: 899px) {
  .study-toolbar {
    width: calc(100% - 20px) !important;
    margin: 10px !important;
  }
}

@media (max-width: 520px) {
  .study-meta .subtitle-settings {
    margin: 10px 0 4px !important;
    padding: 11px !important;
  }

  .study-meta .subtitle-settings,
  .study-meta .subtitle-settings *,
  .study-meta .subtitle-settings button,
  .study-meta .subtitle-settings span,
  .study-meta .subtitle-settings b {
    font-size: 12px !important;
  }

  .study-meta .subtitle-setting-row {
    grid-template-columns: 62px minmax(0, 1fr) !important;
    gap: 6px !important;
  }
}

/* Mobile learning flow: hide the intro card while the video is playing. */
@media (max-width: 899px) {
  .study-shell.video-is-playing .study-meta {
    display: none !important;
  }
}

/* Fullscreen subtitles: fullscreen the whole player, not only the video element. */
.study-video:fullscreen,
.study-video.is-fullscreen,
.study-video:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  border-radius: 0 !important;
  background: #000 !important;
}

.study-video:fullscreen video,
.study-video.is-fullscreen video,
.study-video:-webkit-full-screen video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

.study-video:fullscreen .video-subtitle,
.study-video.is-fullscreen .video-subtitle,
.study-video:-webkit-full-screen .video-subtitle {
  bottom: max(68px, env(safe-area-inset-bottom)) !important;
  z-index: 2147483647 !important;
  width: min(92%, 1200px) !important;
}

.study-video:fullscreen .cue-progress,
.study-video.is-fullscreen .cue-progress,
.study-video:-webkit-full-screen .cue-progress,
.study-video:fullscreen .player-read-control,
.study-video.is-fullscreen .player-read-control,
.study-video:-webkit-full-screen .player-read-control,
.study-video:fullscreen .player-subtitle-control,
.study-video.is-fullscreen .player-subtitle-control,
.study-video:-webkit-full-screen .player-subtitle-control,
.study-video:fullscreen .player-download,
.study-video.is-fullscreen .player-download,
.study-video:-webkit-full-screen .player-download,
.study-video:fullscreen .player-fullscreen,
.study-video.is-fullscreen .player-fullscreen,
.study-video:-webkit-full-screen .player-fullscreen {
  z-index: 2147483647 !important;
}

.study-video:fullscreen .player-read-control,
.study-video.is-fullscreen .player-read-control,
.study-video:-webkit-full-screen .player-read-control {
  right: 198px !important;
  bottom: 78px !important;
}

.study-video:fullscreen .player-download,
.study-video.is-fullscreen .player-download,
.study-video:-webkit-full-screen .player-download {
  right: 72px !important;
  bottom: 78px !important;
}

.study-video:fullscreen .player-subtitle-control,
.study-video.is-fullscreen .player-subtitle-control,
.study-video:-webkit-full-screen .player-subtitle-control {
  right: 126px !important;
  bottom: 78px !important;
}

.study-video:fullscreen .player-queue-add,
.study-video.is-fullscreen .player-queue-add,
.study-video:-webkit-full-screen .player-queue-add {
  right: 190px !important;
  bottom: 78px !important;
}

.study-video:fullscreen .player-read-control,
.study-video.is-fullscreen .player-read-control,
.study-video:-webkit-full-screen .player-read-control {
  right: 254px !important;
  bottom: 78px !important;
}

.study-video:fullscreen .player-fullscreen,
.study-video.is-fullscreen .player-fullscreen,
.study-video:-webkit-full-screen .player-fullscreen {
  right: 18px !important;
  bottom: 78px !important;
}

@media (max-width: 520px) {
  .video-subtitle {
    bottom: 30px !important;
  }

  .player-fullscreen {
    right: 8px;
    bottom: 78px;
    width: 38px;
    height: 38px;
    font-size: 0;
  }

  .player-download {
    right: 52px;
    bottom: 78px;
    width: 38px;
    height: 38px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .player-download::before {
    transform: scale(0.88);
  }

  .player-subtitle-control {
    right: 104px;
    bottom: 78px;
    min-width: 48px;
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .player-queue-add {
    right: 168px;
    bottom: 78px;
    min-width: 48px;
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .player-read-control {
    right: 232px;
    bottom: 78px;
    min-width: 48px;
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .study-video:fullscreen .video-subtitle,
  .study-video.is-fullscreen .video-subtitle,
  .study-video:-webkit-full-screen .video-subtitle {
    bottom: max(62px, env(safe-area-inset-bottom)) !important;
    width: 94% !important;
  }
}

/* Final launch fixes: registration compact layout, controlled downloads, and smoother category menus. */
body[data-view="register"] .auth-page,
body[data-view="forgot"] .auth-page {
  width: min(1040px, calc(100vw - 32px)) !important;
  padding: 18px 0 28px !important;
}

body[data-view="register"] .auth-grid,
body[data-view="forgot"] .auth-grid {
  grid-template-columns: minmax(280px, 0.82fr) minmax(340px, 1fr) !important;
  gap: 16px !important;
  align-items: start !important;
}

body[data-view="register"] .welcome-card,
body[data-view="register"] .login-card,
body[data-view="forgot"] .welcome-card,
body[data-view="forgot"] .login-card {
  min-height: 0 !important;
  border-radius: 24px !important;
  padding: 26px !important;
}

body[data-view="register"] .welcome-card h1,
body[data-view="forgot"] .welcome-card h1,
body[data-view="register"] .login-card h2,
body[data-view="forgot"] .login-card h2 {
  max-width: 100% !important;
  font-size: clamp(32px, 4vw, 54px) !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
}

body[data-view="register"] .login-card label,
body[data-view="forgot"] .login-card label {
  gap: 8px !important;
}

body[data-view="register"] .login-card input,
body[data-view="forgot"] .login-card input {
  min-height: 46px !important;
}

body[data-view="register"] .legal-consent {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 10px !important;
}

body[data-view="register"] .legal-consent input {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin-top: 3px !important;
  padding: 0 !important;
}

body[data-view="register"] .legal-consent span {
  display: block !important;
  min-width: 0 !important;
  white-space: normal !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  line-height: 1.55 !important;
}

body[data-view="register"] .code-wrap {
  grid-template-columns: minmax(0, 1fr) minmax(116px, auto) !important;
}

.category-panel {
  width: min(420px, calc(100vw - 32px)) !important;
  height: min(430px, 54vh) !important;
  transition: opacity 120ms ease, transform 120ms ease !important;
}

.category-drill-track {
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.menu-row.has-children {
  min-height: 40px !important;
  cursor: pointer;
}

.course-row {
  min-height: 40px !important;
}

.study-toolbar {
  grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
}

.download-lock {
  color: #8a8377;
}

.playlist-panel {
  width: calc(100% - 20px);
  margin: 0 10px 8px;
  border-radius: 14px;
  background: rgba(117, 170, 136, 0.08);
  overflow: hidden;
}
.pl-head {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(117, 170, 136, 0.15);
  font-size: 13px;
  font-weight: 900;
  color: var(--green-dark);
}
.pl-head b { flex: 1; min-width: 0; }
.pl-toggle-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pl-toggle-btn:hover {
  background: rgba(117, 170, 136, 0.18);
}
.playlist-panel.collapsed .pl-head {
  border-bottom: 0;
}
.pl-head button:not(.pl-toggle-btn) {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.pl-head .pl-mode-inline {
  background: rgba(117, 170, 136, 0.16);
  color: var(--green-dark);
}
.pl-list { max-height: 200px; overflow-y: auto; }
.pl-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 36px;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.pl-item > .pl-drag-handle { margin-left: 5px; }
.pl-item.current { background: rgba(117, 170, 136, 0.14); }
.pl-play {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-remove {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: 16px;
  color: #999;
  background: transparent;
}

.playlist-toggle {
  color: var(--green-dark);
  font-size: 11px;
}

body[data-skin="studio"] .download-lock {
  color: #d7d0c5;
}

body[data-skin="studio"] .playlist-panel {
  background: #171c1b;
  border: 1px solid #30483b;
}

body[data-skin="studio"] .playlist-panel .pl-head {
  color: #18a56e;
  background: #151a19;
  border-bottom-color: #30483b;
}

body[data-skin="studio"] .playlist-panel .pl-item {
  background: #171c1b;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body[data-skin="studio"] .playlist-panel .pl-item.current {
  background: #26352e;
}

body[data-skin="studio"] .pl-play,
body[data-skin="studio"] .profile-playlist .pl-title-btn,
body[data-skin="studio"] .profile-playlist .pl-info span {
  color: #fffdf7;
}

body[data-skin="studio"] .pl-remove,
body[data-skin="studio"] .pl-remove-btn {
  color: #d8d1c8;
}

body[data-skin="studio"] .pl-drag-handle {
  color: #c6c0b7;
  background: #242a28;
}

body[data-skin="studio"] .pl-order-controls button {
  color: #d8ff4a;
  background: #2a392f;
  box-shadow: inset 0 0 0 1px rgba(216, 255, 74, 0.16);
}

body[data-skin="studio"] .pl-order-controls button:disabled {
  color: #777d77;
  background: #222825;
  box-shadow: none;
}

@media (max-width: 520px) {
  .profile-playlist-item {
    grid-template-columns: 26px 44px minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .profile-playlist-item .pl-thumb {
    width: 44px;
    height: 30px;
  }

  .pl-order-controls {
    grid-template-columns: repeat(2, 25px);
    gap: 2px;
  }

  .pl-order-controls button {
    width: 25px;
    height: 28px;
  }
}

@media (max-width: 760px) {
  body[data-view="register"] .auth-page,
  body[data-view="forgot"] .auth-page {
    width: min(430px, 100vw) !important;
    padding: 14px 14px 24px !important;
  }

  body[data-view="register"] .auth-grid,
  body[data-view="forgot"] .auth-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-view="login"] .welcome-card,
  body[data-view="register"] .welcome-card,
  body[data-view="forgot"] .welcome-card {
    display: none !important;
  }

  body[data-view="register"] .login-card,
  body[data-view="forgot"] .login-card {
    padding: 22px !important;
  }

  body[data-view="register"] .login-card h2,
  body[data-view="forgot"] .login-card h2 {
    font-size: clamp(28px, 9vw, 40px) !important;
  }
}

/* v54: independent document library inside the personal centre. */
.profile-document-library {
  margin: 18px 0;
  padding: 22px;
  border: 1px solid rgba(105, 116, 143, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.profile-document-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-document-title {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 12px;
}

.profile-document-toggle {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-grid;
  place-items: center;
  margin-top: 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(82, 104, 221, 0.11);
  color: #5268dd;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.profile-document-title > div {
  min-width: 0;
}

.profile-document-title > div > span,
.profile-document-recent span {
  color: #5268dd;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.profile-document-head h2 {
  margin: 5px 0 6px;
  color: #182033;
  font-size: 25px;
}

.profile-document-head p {
  margin: 0;
  color: #687187;
  line-height: 1.55;
}

.profile-document-head > b {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(82, 104, 221, 0.1);
  color: #5268dd;
  padding: 8px 11px;
  font-size: 11px;
}

.profile-document-body[hidden] {
  display: none !important;
}

.profile-document-library.collapsed {
  padding-bottom: 18px;
}

.profile-document-library.collapsed .profile-document-head {
  align-items: center;
}

.profile-document-library.collapsed .profile-document-head h2 {
  margin-bottom: 0;
}

.profile-document-library.collapsed .profile-document-head p {
  display: none;
}

.profile-document-recent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(82, 104, 221, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(82, 104, 221, 0.08), rgba(109, 84, 232, 0.04));
}

.profile-document-recent > div {
  display: grid;
  gap: 3px;
}

.profile-document-recent b {
  color: #26304a;
}

.profile-document-recent small {
  color: #727b8f;
}

.profile-document-recent button,
.profile-document-more {
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: #5268dd;
  color: #fff;
  padding: 0 15px;
  font-weight: 800;
  cursor: pointer;
}

.profile-document-controls {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.profile-document-controls > label {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px);
  align-items: center;
  justify-content: start;
  gap: 10px;
}

.profile-document-controls > label > span {
  color: #6a7388;
  font-size: 12px;
  font-weight: 800;
}

.profile-document-controls input {
  min-height: 40px;
  border: 1px solid rgba(105, 116, 143, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #273047;
  padding: 0 12px;
}

.profile-document-programmes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-document-programmes button {
  min-height: 33px;
  border: 1px solid rgba(105, 116, 143, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #3c455a;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.profile-document-programmes small {
  margin-left: 4px;
  color: #828a9b;
}

.profile-document-programmes button.active {
  border-color: #5268dd;
  background: rgba(82, 104, 221, 0.1);
  color: #4057ce;
}

.profile-document-programmes button.active small {
  color: inherit;
  opacity: 0.72;
}

.profile-document-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 10px;
  color: #727b8f;
  font-size: 11px;
}

.profile-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.profile-document-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(105, 116, 143, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.profile-document-cover {
  position: relative;
  min-height: 164px;
  background: #e9ebf2;
}

.profile-document-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-document-cover > b {
  position: absolute;
  left: 7px;
  bottom: 7px;
  border-radius: 999px;
  background: rgba(13, 18, 31, 0.78);
  color: #fff;
  padding: 4px 7px;
  font-size: 9px;
}

.profile-document-copy {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 13px;
}

.profile-document-copy > small,
.profile-document-copy > p {
  color: #737c90;
  font-size: 10px;
}

.profile-document-copy h3 {
  display: -webkit-box;
  margin: 5px 0 7px;
  overflow: hidden;
  color: #20293e;
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-document-copy > p {
  margin: 0;
}

.profile-document-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.profile-document-kinds span {
  border-radius: 999px;
  background: #f0f2f8;
  color: #5d667c;
  padding: 4px 7px;
  font-size: 9px;
  font-weight: 760;
}

.profile-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.profile-document-actions button {
  min-height: 29px;
  border: 1px solid rgba(82, 104, 221, 0.22);
  border-radius: 9px;
  background: transparent;
  color: #4a5fc7;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.profile-document-actions .document-play {
  border-color: #5268dd;
  background: #5268dd;
  color: #fff;
}

.profile-document-more {
  display: block;
  margin: 16px auto 0;
}

.profile-document-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed rgba(105, 116, 143, 0.3);
  border-radius: 14px;
  text-align: center;
}

.profile-document-empty p {
  margin: 5px 0 0;
  color: #737c90;
}

body[data-skin="studio"] .profile-document-library {
  border-color: #30333c;
  background: #18191d;
}

body[data-skin="studio"] .profile-playlist {
  border-color: #30333c;
  background: #18191d;
  box-shadow: none;
}

body[data-skin="studio"] .profile-section-head {
  border-bottom-color: #30333c;
}

body[data-skin="studio"] .profile-playlist.collapsed .profile-section-head {
  border-bottom-color: transparent;
}

body[data-skin="studio"] .profile-section-head > b {
  color: #f2f0e9;
}

body[data-skin="studio"] .profile-playlist-toggle {
  color: #d4ff58;
  background: rgba(202, 255, 55, 0.1);
}

body[data-skin="studio"] .profile-playlist .pl-empty-hint {
  color: #8b8f99;
}

body[data-skin="studio"] .profile-playlist .pl-empty-hint b {
  color: #d4ff58;
}

body[data-skin="studio"] .profile-document-head h2,
body[data-skin="studio"] .profile-document-recent b,
body[data-skin="studio"] .profile-document-copy h3 {
  color: #f2f0e9;
}

body[data-skin="studio"] .profile-document-head p,
body[data-skin="studio"] .profile-document-controls > label > span,
body[data-skin="studio"] .profile-document-result-head,
body[data-skin="studio"] .profile-document-copy > small,
body[data-skin="studio"] .profile-document-copy > p,
body[data-skin="studio"] .profile-document-recent small {
  color: #8b8f99;
}

body[data-skin="studio"] .profile-document-head > b,
body[data-skin="studio"] .profile-document-programmes button.active {
  border-color: #caff37;
  background: rgba(202, 255, 55, 0.1);
  color: #d4ff58;
}

body[data-skin="studio"] .profile-document-toggle {
  background: rgba(202, 255, 55, 0.1);
  color: #d4ff58;
}

body[data-skin="studio"] .profile-document-title > div > span,
body[data-skin="studio"] .profile-document-recent span {
  color: #d4ff58;
}

body[data-skin="studio"] .profile-document-recent {
  border-color: rgba(202, 255, 55, 0.24);
  background: rgba(202, 255, 55, 0.06);
}

body[data-skin="studio"] .profile-document-recent button,
body[data-skin="studio"] .profile-document-more,
body[data-skin="studio"] .profile-document-actions .document-play {
  background: #caff37;
  color: #111318;
}

body[data-skin="studio"] .profile-document-controls input {
  border-color: #343741;
  background: #232429;
  color: #f0eee8;
}

body[data-skin="studio"] .profile-document-programmes button,
body[data-skin="studio"] .profile-document-card {
  border-color: #343741;
  background: #202126;
  color: #e8e6df;
}

body[data-skin="studio"] .profile-document-kinds span {
  background: #2b2c32;
  color: #aaaeb8;
}

body[data-skin="studio"] .profile-document-actions button {
  border-color: #484b55;
  color: #d9dce6;
}

@media (max-width: 820px) {
  .profile-document-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .profile-playlist {
    padding: 0 14px 10px;
    border-radius: 17px;
  }

  .profile-document-library {
    margin: 12px 0;
    padding: 16px;
    border-radius: 17px;
  }

  .profile-document-head,
  .profile-document-recent {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-document-title {
    width: 100%;
  }

  .profile-document-head > b {
    align-self: flex-start;
  }

  .profile-document-controls > label {
    grid-template-columns: 1fr;
  }

  .profile-document-programmes {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .profile-document-programmes::-webkit-scrollbar {
    display: none;
  }

  .profile-document-programmes button {
    flex: 0 0 auto;
  }

  .profile-document-result-head {
    display: grid;
  }

  .profile-document-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .profile-document-cover {
    min-height: 180px;
  }
}

@media (max-width: 520px) {
  .study-toolbar {
    grid-template-columns: minmax(0, 0.86fr) 66px repeat(3, minmax(0, 0.86fr)) !important;
  }

  .study-toolbar button {
    font-size: 11px !important;
  }
}

/* Keep subtitle controls available inside the player, including fullscreen.
   Position near the subtitle button (bottom-left) as a semi-transparent, draggable floating panel. */
.subtitle-settings {
  position: fixed !important;
  left: 8px;
  bottom: 150px;
  right: auto !important;
  top: auto !important;
  z-index: 2147483647 !important;
  display: grid !important;
  width: min(280px, calc(100% - 24px)) !important;
  max-height: min(380px, calc(100vh - 200px)) !important;
  max-height: min(380px, calc(100dvh - 200px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  transform: none !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 18px !important;
  color: #f8f5ee !important;
  background: rgba(17, 18, 22, 0.72) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  isolation: isolate !important;
  pointer-events: auto !important;
}

.study-video.settings-open {
  z-index: 2147483645 !important;
  overflow: visible !important;
}

.study-video .subtitle-settings .drag-handle {
  cursor: grab !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.study-video .subtitle-settings .drag-handle:active {
  cursor: grabbing !important;
}

body[data-skin="prism"] .study-video .subtitle-settings {
  color: #171717 !important;
  background: rgba(255, 253, 248, 0.7) !important;
  border-color: rgba(17, 17, 17, 0.1) !important;
}

.study-video .subtitle-settings,
.study-video .subtitle-settings *,
.study-video .subtitle-settings button,
.study-video .subtitle-settings span,
.study-video .subtitle-settings b {
  font-size: 12px !important;
  line-height: 1.12 !important;
}

.study-video .subtitle-settings-head {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 8px !important;
  align-items: center !important;
  margin: 0 !important;
}

.study-video .subtitle-settings-head button {
  min-height: 28px !important;
  padding: 0 12px !important;
  color: #111 !important;
  background: rgba(255, 253, 248, 0.9) !important;
}

.study-video .subtitle-setting-row {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: start !important;
}

.study-video .subtitle-setting-row > span {
  position: static !important;
  inset: auto !important;
  display: block !important;
  padding: 7px 0 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  font-weight: 900 !important;
}

.study-video .segmented,
.study-video .font-options,
.study-video .size-options,
.study-video .color-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.study-video .segmented button,
.study-video .font-options button,
.study-video .size-options button,
.study-video .color-options button {
  min-height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  color: #f8f5ee !important;
  background: rgba(255, 255, 255, 0.12) !important;
  font-weight: 900 !important;
}

body[data-skin="prism"] .study-video .segmented button,
body[data-skin="prism"] .study-video .font-options button,
body[data-skin="prism"] .study-video .size-options button,
body[data-skin="prism"] .study-video .color-options button {
  color: #171717 !important;
  background: rgba(244, 240, 232, 0.84) !important;
}

.study-video .segmented button.active,
.study-video .font-options button.active,
.study-video .size-options button.active,
.study-video .color-options button.active,
body[data-skin="prism"] .study-video .segmented button.active,
body[data-skin="prism"] .study-video .font-options button.active,
body[data-skin="prism"] .study-video .size-options button.active,
body[data-skin="prism"] .study-video .color-options button.active {
  color: #111 !important;
  background: #dbff4a !important;
}

.study-video .color-options button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.study-video .color-options i {
  width: 13px !important;
  height: 13px !important;
  border-radius: 50% !important;
}

.study-video:fullscreen .subtitle-settings,
.study-video.is-fullscreen .subtitle-settings,
.study-video:-webkit-full-screen .subtitle-settings {
  bottom: max(108px, calc(env(safe-area-inset-bottom) + 92px)) !important;
  width: min(920px, calc(100% - 148px)) !important;
  z-index: 2147483647 !important;
}

@media (max-width: 640px) {
  .study-video .subtitle-settings {
    bottom: 88px !important;
    width: calc(100% - 20px) !important;
    padding: 9px !important;
    gap: 5px !important;
    border-radius: 16px !important;
  }

  .study-video .subtitle-setting-row {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .study-video .subtitle-settings,
  .study-video .subtitle-settings *,
  .study-video .subtitle-settings button,
  .study-video .subtitle-settings span,
  .study-video .subtitle-settings b {
    font-size: 10px !important;
  }

  .study-video .segmented button,
  .study-video .font-options button,
  .study-video .size-options button,
  .study-video .color-options button {
    min-height: 25px !important;
    padding: 0 7px !important;
  }

  .study-video:fullscreen .subtitle-settings,
  .study-video.is-fullscreen .subtitle-settings,
  .study-video:-webkit-full-screen .subtitle-settings {
    bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px)) !important;
    width: calc(100% - 20px) !important;
  }
}

/* Playback chrome: keep controls quiet while the video is playing. */
.player-read-control,
.player-subtitle-control,
.player-download,
.player-fullscreen {
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 140ms ease,
    color 140ms ease !important;
}

.study-shell.video-is-playing .player-read-control,
.study-shell.video-is-playing .player-subtitle-control,
.study-shell.video-is-playing .player-download,
.study-shell.video-is-playing .player-fullscreen {
  opacity: 0 !important;
  transform: translateY(6px) !important;
  pointer-events: none !important;
  transition-delay: 80ms, 80ms, 0ms, 0ms !important;
}

.study-shell.video-is-playing .study-video:hover .player-read-control,
.study-shell.video-is-playing .study-video:hover .player-subtitle-control,
.study-shell.video-is-playing .study-video:hover .player-download,
.study-shell.video-is-playing .study-video:hover .player-fullscreen,
.study-shell.video-is-playing .study-video:focus-within .player-read-control,
.study-shell.video-is-playing .study-video:focus-within .player-subtitle-control,
.study-shell.video-is-playing .study-video:focus-within .player-download,
.study-shell.video-is-playing .study-video:focus-within .player-fullscreen,
.study-shell.video-is-playing .study-video.settings-open .player-read-control,
.study-shell.video-is-playing .study-video.settings-open .player-subtitle-control,
.study-shell.video-is-playing .study-video.settings-open .player-download,
.study-shell.video-is-playing .study-video.settings-open .player-fullscreen {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  transition-delay: 40ms, 40ms, 0ms, 0ms !important;
}

@media (hover: none), (pointer: coarse) {
  .study-shell.video-is-playing .player-read-control,
  .study-shell.video-is-playing .player-subtitle-control,
  .study-shell.video-is-playing .player-download,
  .study-shell.video-is-playing .player-fullscreen {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    transition-delay: 0ms !important;
  }
}
/* Click-to-save word cards */
.video-subtitle.word-enabled {
  pointer-events: none !important;
}

.video-subtitle.word-enabled .inline-word {
  pointer-events: auto !important;
}

.inline-word {
  display: inline;
  margin: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-shadow: inherit;
  cursor: pointer;
}

.inline-word:hover,
.inline-word:focus-visible {
  color: #d6ff35;
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.word-popover-layer {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.word-popover {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  color: #fff;
  background: rgba(17, 18, 23, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.word-popover span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 900;
}

.word-popover h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.word-popover-phonetic {
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 800;
}

.word-popover p {
  margin: 0;
  line-height: 1.55;
}

.word-popover-meaning {
  color: #d6ff35;
  font-weight: 900;
}

.word-popover-definition {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 800;
}

.word-popover-context,
.word-popover-collocations,
.word-popover-note {
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
}

.word-popover-sentence {
  font-weight: 800;
}

.word-popover-translation,
.word-popover small {
  color: rgba(255, 255, 255, 0.72);
}

.word-popover div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.word-popover button {
  min-height: 42px;
}

.word-popover-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.profile-word-cards {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

body[data-skin="studio"] .profile-word-cards {
  color: #fff;
  background: rgba(27, 28, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.profile-word-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-word-head h2,
.profile-word-cards h2 {
  margin: 0;
}

.profile-word-head span {
  color: var(--muted);
  font-weight: 900;
}

.profile-word-group {
  display: grid;
  gap: 10px;
}

.profile-word-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-word-group-head b {
  font-size: 16px;
}

.profile-word-group-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

body[data-skin="studio"] .profile-word-group-head {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.profile-word-list {
  display: grid;
  gap: 10px;
}

.saved-word-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(244, 240, 232, 0.86);
}

body[data-skin="studio"] .saved-word-card {
  background: rgba(255, 255, 255, 0.07);
}

.saved-word-card b,
.saved-word-card em,
.saved-word-card strong,
.saved-word-card small {
  display: block;
}

.saved-word-card b {
  font-size: 20px;
}

.saved-word-card em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.saved-word-card strong {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.saved-word-card p {
  margin: 7px 0;
  color: inherit;
  line-height: 1.5;
}

.saved-word-definition {
  color: inherit !important;
  font-weight: 800;
}

body[data-skin="studio"] .saved-word-definition {
  color: rgba(255, 255, 255, 0.82) !important;
}

.saved-word-sentence {
  font-weight: 800;
}

.saved-word-translation {
  color: var(--muted) !important;
}

.saved-word-card small {
  color: var(--muted);
}

.saved-word-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-word-actions button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 900;
}

@media (max-width: 640px) {
  .word-popover-layer {
    bottom: 12px;
  }

  .word-popover {
    padding: 15px;
    border-radius: 20px;
  }

  .word-popover h2 {
    font-size: 24px;
  }

  .saved-word-card {
    grid-template-columns: 1fr;
  }

  .saved-word-actions {
    flex-direction: row;
  }
}

/* Mobile and launch player fixes: quiet playback chrome, sticky video, and in-page fullscreen fallback. */
.player-read-control {
  width: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  font-size: 0 !important;
}

.player-read-control::before {
  content: "";
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8v8'/%3E%3Cpath d='M9 6v12'/%3E%3Cpath d='M13 9v6'/%3E%3Cpath d='M17 7v10'/%3E%3Cpath d='M21 10v4'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8v8'/%3E%3Cpath d='M9 6v12'/%3E%3Cpath d='M13 9v6'/%3E%3Cpath d='M17 7v10'/%3E%3Cpath d='M21 10v4'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.study-video.chrome-visible .player-read-control,
.study-video.chrome-visible .player-subtitle-control,
.study-video.chrome-visible .player-queue-add,
.study-video.chrome-visible .player-download,
.study-video.chrome-visible .player-fullscreen,
.study-shell.video-is-playing .study-video.chrome-visible .player-read-control,
.study-shell.video-is-playing .study-video.chrome-visible .player-subtitle-control,
.study-shell.video-is-playing .study-video.chrome-visible .player-queue-add,
.study-shell.video-is-playing .study-video.chrome-visible .player-download,
.study-shell.video-is-playing .study-video.chrome-visible .player-fullscreen {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  transition-delay: 0ms !important;
}

@media (hover: none), (pointer: coarse) {
  .study-shell.video-is-playing .player-read-control,
  .study-shell.video-is-playing .player-subtitle-control,
  .study-shell.video-is-playing .player-queue-add,
  .study-shell.video-is-playing .player-download,
  .study-shell.video-is-playing .player-fullscreen {
    opacity: 0 !important;
    transform: translateY(8px) !important;
    pointer-events: none !important;
  }

  .study-shell.video-is-playing .study-video.chrome-visible .player-read-control,
  .study-shell.video-is-playing .study-video.chrome-visible .player-subtitle-control,
  .study-shell.video-is-playing .study-video.chrome-visible .player-queue-add,
  .study-shell.video-is-playing .study-video.chrome-visible .player-download,
  .study-shell.video-is-playing .study-video.chrome-visible .player-fullscreen,
  .study-shell.video-is-playing .study-video.settings-open .player-read-control,
  .study-shell.video-is-playing .study-video.settings-open .player-subtitle-control,
  .study-shell.video-is-playing .study-video.settings-open .player-queue-add,
  .study-shell.video-is-playing .study-video.settings-open .player-download,
  .study-shell.video-is-playing .study-video.settings-open .player-fullscreen {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
}

.player-read-control,
.player-subtitle-control,
.player-queue-add,
.player-download,
.player-fullscreen,
.cue-progress,
.player-guide {
  z-index: 30 !important;
}

@media (max-width: 899px) {
  .study-video {
    position: sticky !important;
    top: 0;
    z-index: 35;
  }

  .study-shell.video-is-playing .study-video {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
  }
}

body.mobile-player-fullscreen {
  overflow: hidden !important;
}

html.mobile-player-fullscreen {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Authentication/home pages must always remain vertically scrollable even if
   a browser restores a stale fullscreen class from its back-forward cache.
   Placed AFTER the fullscreen lock rules (and given higher specificity via the
   combined selectors) so this release rule ALWAYS wins over the fullscreen
   overflow:hidden — otherwise Chrome's bfcache restore leaves the page stuck. */
html.page-scroll-enabled,
html.page-scroll-enabled body,
html.page-scroll-enabled.mobile-player-fullscreen,
html.page-scroll-enabled.mobile-player-fullscreen body {
  overflow-y: auto !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: auto;
}

.study-video.is-mobile-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483600 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: none !important;
  border-radius: 0 !important;
  background: #000 !important;
  box-shadow: none !important;
}

.study-video {
  isolation: isolate;
}

.player-fullscreen,
.player-exit-fullscreen {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.player-exit-fullscreen {
  display: none;
}

.study-video:fullscreen .player-exit-fullscreen,
.study-video:-webkit-full-screen .player-exit-fullscreen,
.study-video.is-fullscreen .player-exit-fullscreen,
.study-video.is-mobile-fullscreen .player-exit-fullscreen {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 2147483647;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #111;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

.study-video:fullscreen .player-exit-fullscreen > span,
.study-video:-webkit-full-screen .player-exit-fullscreen > span,
.study-video.is-fullscreen .player-exit-fullscreen > span,
.study-video.is-mobile-fullscreen .player-exit-fullscreen > span {
  position: static;
  padding: 0;
  color: inherit;
  background: transparent;
}

.study-video.is-mobile-fullscreen video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

.player-guide {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 18;
  width: min(430px, calc(100% - 28px));
  padding: 14px 46px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  color: #fff;
  background: rgba(0, 0, 0, 0.64);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
  pointer-events: none;
}

.player-guide b {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.player-guide p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  line-height: 1.55;
}

.player-guide-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  color: #111;
  background: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.fullscreen-cue-rail {
  display: none;
}

.study-video:fullscreen .fullscreen-cue-rail,
.study-video:-webkit-full-screen .fullscreen-cue-rail,
.study-video.is-fullscreen .fullscreen-cue-rail,
.study-video.is-mobile-fullscreen .fullscreen-cue-rail {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 104px;
  z-index: 2147483647;
  display: flex;
  width: min(30vw, 430px);
  min-width: 280px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(12, 12, 16, 0.68);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.study-video.fullscreen-cues-closed .fullscreen-cue-rail {
  display: none !important;
}

.fullscreen-cue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.fullscreen-cue-head > div {
  display: flex;
  gap: 6px;
}

.fullscreen-cue-head button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  color: #111;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  cursor: pointer;
}

.fullscreen-cue-list {
  overflow-y: auto;
  padding: 10px;
  scroll-behavior: smooth;
  scroll-padding-block: 40%;
  overscroll-behavior: contain;
}

.fullscreen-cue-card {
  margin-bottom: 8px;
  padding: 10px 11px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.fullscreen-cue-card.active {
  color: #111;
  background: rgba(216, 255, 47, 0.92);
}

.fullscreen-cue-card b,
.fullscreen-cue-card p {
  display: block;
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.45;
}

.fullscreen-cue-card span {
  position: static !important;
  display: inline;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 900;
}

@media (orientation: portrait) and (max-width: 899px) {
  .study-video.is-mobile-fullscreen .fullscreen-cue-rail,
  .study-video.is-fullscreen .fullscreen-cue-rail {
    top: auto;
    right: 10px;
    bottom: 90px;
    left: 10px;
    width: auto;
    min-width: 0;
    max-height: 38vh;
  }

  .study-video.is-mobile-fullscreen .video-subtitle,
  .study-video.is-fullscreen .video-subtitle {
    bottom: max(52px, env(safe-area-inset-bottom)) !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .study-shell.video-is-playing .study-video:hover .player-read-control,
  .study-shell.video-is-playing .study-video:hover .player-subtitle-control,
  .study-shell.video-is-playing .study-video:hover .player-download,
  .study-shell.video-is-playing .study-video:hover .player-fullscreen,
  .study-shell.video-is-playing .study-video:focus-within .player-read-control,
  .study-shell.video-is-playing .study-video:focus-within .player-subtitle-control,
  .study-shell.video-is-playing .study-video:focus-within .player-download,
  .study-shell.video-is-playing .study-video:focus-within .player-fullscreen {
    opacity: 0 !important;
    transform: translateY(8px) !important;
    pointer-events: none !important;
  }

  .study-shell.video-is-playing .study-video.chrome-visible:hover .player-read-control,
  .study-shell.video-is-playing .study-video.chrome-visible:hover .player-subtitle-control,
  .study-shell.video-is-playing .study-video.chrome-visible:hover .player-download,
  .study-shell.video-is-playing .study-video.chrome-visible:hover .player-fullscreen,
  .study-shell.video-is-playing .study-video.chrome-visible:focus-within .player-read-control,
  .study-shell.video-is-playing .study-video.chrome-visible:focus-within .player-subtitle-control,
  .study-shell.video-is-playing .study-video.chrome-visible:focus-within .player-download,
  .study-shell.video-is-playing .study-video.chrome-visible:focus-within .player-fullscreen,
  .study-shell.video-is-playing .study-video.settings-open:hover .player-read-control,
  .study-shell.video-is-playing .study-video.settings-open:hover .player-subtitle-control,
  .study-shell.video-is-playing .study-video.settings-open:hover .player-download,
  .study-shell.video-is-playing .study-video.settings-open:hover .player-fullscreen {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
}

.study-shell.video-is-playing .player-guide {
  opacity: 0 !important;
  pointer-events: none !important;
}

html.touch-device .study-shell.video-is-playing .study-video .player-read-control,
html.touch-device .study-shell.video-is-playing .study-video .player-subtitle-control,
html.touch-device .study-shell.video-is-playing .study-video .player-download,
html.touch-device .study-shell.video-is-playing .study-video .player-fullscreen,
html.touch-device .study-shell.video-is-playing .study-video:hover .player-read-control,
html.touch-device .study-shell.video-is-playing .study-video:hover .player-subtitle-control,
html.touch-device .study-shell.video-is-playing .study-video:hover .player-download,
html.touch-device .study-shell.video-is-playing .study-video:hover .player-fullscreen,
html.touch-device .study-shell.video-is-playing .study-video:focus-within .player-read-control,
html.touch-device .study-shell.video-is-playing .study-video:focus-within .player-subtitle-control,
html.touch-device .study-shell.video-is-playing .study-video:focus-within .player-download,
html.touch-device .study-shell.video-is-playing .study-video:focus-within .player-fullscreen {
  opacity: 0 !important;
  transform: translateY(8px) !important;
  pointer-events: none !important;
}

html.touch-device .study-shell.video-is-playing .study-video.chrome-visible .player-read-control,
html.touch-device .study-shell.video-is-playing .study-video.chrome-visible .player-subtitle-control,
html.touch-device .study-shell.video-is-playing .study-video.chrome-visible .player-download,
html.touch-device .study-shell.video-is-playing .study-video.chrome-visible .player-fullscreen,
html.touch-device .study-shell.video-is-playing .study-video.settings-open .player-read-control,
html.touch-device .study-shell.video-is-playing .study-video.settings-open .player-subtitle-control,
html.touch-device .study-shell.video-is-playing .study-video.settings-open .player-download,
html.touch-device .study-shell.video-is-playing .study-video.settings-open .player-fullscreen {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Resilient subtitle loading: never show synthetic lesson text as real captions. */
.subtitle-load-state {
  display: grid;
  min-height: 210px;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.subtitle-load-state strong {
  font-size: 18px;
}

.subtitle-load-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.subtitle-load-state.is-error {
  border-color: rgba(190, 62, 62, 0.28);
  background: rgba(255, 246, 246, 0.94);
}

.subtitle-loading-dot {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(126, 166, 0, 0.22);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: subtitle-loading-spin 0.8s linear infinite;
}

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

/* Launch repair: independently scrolling lesson cues and side-by-side fullscreen captions. */
@media (max-width: 899px) {
  .sentence-area {
    height: min(56dvh, 560px);
    min-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .sentence-area::after {
    content: "";
    display: block;
    min-height: max(18px, env(safe-area-inset-bottom));
  }
}

.study-video:fullscreen,
.study-video:-webkit-full-screen,
.study-video.is-fullscreen,
.study-video.is-mobile-fullscreen {
  --fullscreen-rail-width: clamp(280px, 34vw, 430px);
  --fullscreen-rail-gap: 18px;
  --fullscreen-rail-edge: max(12px, env(safe-area-inset-right));
}

.study-video:fullscreen:not(.fullscreen-cues-closed) video,
.study-video:-webkit-full-screen:not(.fullscreen-cues-closed) video,
.study-video.is-fullscreen:not(.fullscreen-cues-closed) video,
.study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) video {
  width: calc(100% - var(--fullscreen-rail-width) - var(--fullscreen-rail-gap) - var(--fullscreen-rail-edge)) !important;
  margin: 0 !important;
}

.study-video:fullscreen:not(.fullscreen-cues-closed) .video-subtitle,
.study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .video-subtitle,
.study-video.is-fullscreen:not(.fullscreen-cues-closed) .video-subtitle,
.study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .video-subtitle {
  left: 3% !important;
  right: calc(var(--fullscreen-rail-width) + var(--fullscreen-rail-gap) + var(--fullscreen-rail-edge) + 3%) !important;
  width: auto !important;
  transform: none !important;
}

.study-video:fullscreen:not(.fullscreen-cues-closed) .cue-progress,
.study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .cue-progress,
.study-video.is-fullscreen:not(.fullscreen-cues-closed) .cue-progress,
.study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .cue-progress {
  right: calc(var(--fullscreen-rail-width) + var(--fullscreen-rail-gap) + var(--fullscreen-rail-edge) + 10px) !important;
}

.study-video:fullscreen .player-guide,
.study-video:-webkit-full-screen .player-guide,
.study-video.is-fullscreen .player-guide,
.study-video.is-mobile-fullscreen .player-guide {
  display: none !important;
}

.study-video:fullscreen .player-fullscreen,
.study-video:-webkit-full-screen .player-fullscreen,
.study-video.is-fullscreen .player-fullscreen,
.study-video.is-mobile-fullscreen .player-fullscreen {
  display: none !important;
}

.study-video:fullscreen .fullscreen-cue-rail,
.study-video:-webkit-full-screen .fullscreen-cue-rail,
.study-video.is-fullscreen .fullscreen-cue-rail,
.study-video.is-mobile-fullscreen .fullscreen-cue-rail {
  top: max(12px, env(safe-area-inset-top)) !important;
  right: var(--fullscreen-rail-edge) !important;
  bottom: max(86px, env(safe-area-inset-bottom)) !important;
  left: auto !important;
  width: var(--fullscreen-rail-width) !important;
  min-width: 0 !important;
  max-height: none !important;
}

@media (orientation: portrait) and (max-width: 899px) {
  .study-video:fullscreen,
  .study-video:-webkit-full-screen,
  .study-video.is-fullscreen,
  .study-video.is-mobile-fullscreen {
    --fullscreen-rail-width: clamp(250px, 38vw, 360px);
    --fullscreen-rail-gap: 10px;
  }
}

@media (max-width: 520px) {
  .study-video:fullscreen,
  .study-video:-webkit-full-screen,
  .study-video.is-fullscreen,
  .study-video.is-mobile-fullscreen {
    --fullscreen-rail-width: clamp(190px, 42vw, 240px);
    --fullscreen-rail-gap: 8px;
  }

  .fullscreen-cue-head {
    padding: 9px 10px;
  }

  .fullscreen-cue-head b {
    font-size: 13px;
  }

  .fullscreen-cue-head button {
    padding: 6px 9px;
    font-size: 12px;
  }

  .fullscreen-cue-list {
    padding: 7px;
  }

  .fullscreen-cue-card {
    padding: 8px 9px;
  }

  .fullscreen-cue-card b,
  .fullscreen-cue-card p {
    font-size: 12px;
    line-height: 1.35;
  }

  .study-video:fullscreen .player-read-control,
  .study-video:-webkit-full-screen .player-read-control,
  .study-video.is-fullscreen .player-read-control,
  .study-video.is-mobile-fullscreen .player-read-control,
  .study-video:fullscreen .player-subtitle-control,
  .study-video:-webkit-full-screen .player-subtitle-control,
  .study-video.is-fullscreen .player-subtitle-control,
  .study-video.is-mobile-fullscreen .player-subtitle-control,
  .study-video:fullscreen .player-download,
  .study-video:-webkit-full-screen .player-download,
  .study-video.is-fullscreen .player-download,
  .study-video.is-mobile-fullscreen .player-download {
    display: none !important;
  }

  .study-video:fullscreen:not(.fullscreen-cues-closed) .subtitle-line,
  .study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .subtitle-line,
  .study-video.is-fullscreen:not(.fullscreen-cues-closed) .subtitle-line,
  .study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .subtitle-line {
    padding: 3px 6px !important;
    font-size: clamp(12px, 3.6vw, 16px) !important;
    line-height: 1.25 !important;
  }

  .study-video:fullscreen:not(.fullscreen-cues-closed) .subtitle-line.zh,
  .study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .subtitle-line.zh,
  .study-video.is-fullscreen:not(.fullscreen-cues-closed) .subtitle-line.zh,
  .study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .subtitle-line.zh {
    font-size: clamp(11px, 3.3vw, 15px) !important;
  }
}

/* Current-caption focus: make the playing sentence unmistakable without
   overriding the learner's video subtitle font and color preferences. */
.sentence-card,
.fullscreen-cue-card {
  position: relative;
  isolation: isolate;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.sentence-card.active {
  z-index: 2;
  border-color: rgba(72, 151, 196, 0.58) !important;
  color: #152b3a !important;
  background:
    linear-gradient(145deg, rgba(239, 249, 255, 0.98), rgba(218, 238, 250, 0.96)) !important;
  box-shadow:
    0 16px 34px rgba(30, 72, 96, 0.22),
    0 4px 10px rgba(30, 72, 96, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
  transform: translateY(-2px);
}

.sentence-card.active::before,
.fullscreen-cue-card.active::before {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #59a9d5;
  box-shadow: 0 0 14px rgba(89, 169, 213, 0.54);
}

.sentence-card.active b,
body[data-skin="studio"] .sentence-card.active b {
  color: #152b3a !important;
}

.sentence-card.active p,
body[data-skin="studio"] .sentence-card.active p {
  color: #4b687a !important;
}

.sentence-card.active .sentence-actions > span {
  color: #567183 !important;
}

.fullscreen-cue-card.active {
  z-index: 2;
  border-color: rgba(107, 190, 232, 0.72) !important;
  color: #102634 !important;
  background:
    linear-gradient(145deg, rgba(237, 249, 255, 0.98), rgba(207, 235, 249, 0.96)) !important;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.16) inset !important;
  transform: translateY(-1px);
}

.fullscreen-cue-card.active b {
  color: #102634 !important;
}

.fullscreen-cue-card.active p {
  color: #456476 !important;
}

.fullscreen-cue-card.active span {
  color: #587486 !important;
}

@media (max-width: 640px) {
  .sentence-card.active {
    box-shadow:
      0 12px 24px rgba(30, 72, 96, 0.2),
      0 3px 8px rgba(30, 72, 96, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sentence-card,
  .fullscreen-cue-card {
    transition: none;
  }

  .sentence-card.active,
  .fullscreen-cue-card.active {
    transform: none;
  }
}

/* iOS/mobile player proportions: keep captions readable without allowing
   them to dominate the picture, and keep the tool row just above controls. */
#learningVideo::cue {
  color: var(--native-subtitle-color, #fff);
  background: var(--native-subtitle-bg, rgba(0, 0, 0, 0.58));
  font-family: var(--native-subtitle-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: var(--native-subtitle-size, 18px);
}

/* v52: learner-first categories, podcast player and in-course documents */
.simple-category-menu {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}

.simple-category-menu > button {
  min-height: 66px;
  border: 1px solid rgba(112, 125, 155, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  color: var(--ink, #172033);
  cursor: pointer;
}

.simple-category-menu > button.active {
  border-color: #4568f2;
  background: linear-gradient(135deg, #4568f2, #7458e8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(69, 104, 242, 0.2);
}

.simple-category-menu small {
  opacity: 0.68;
}

.library-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
  padding: 14px;
  border: 1px solid rgba(112, 125, 155, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.library-filters label {
  display: grid;
  gap: 6px;
}

.library-filters label > span {
  color: #6a7182;
  font-size: 12px;
  font-weight: 700;
}

.library-filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(112, 125, 155, 0.24);
  border-radius: 12px;
  background: #fff;
  color: #20283a;
  padding: 0 10px;
}

.media-type-pill {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(16, 22, 39, 0.84);
  color: #fff;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.study-video.audio-mode {
  min-height: 520px;
  background: linear-gradient(145deg, #14182a, #252f52);
}

.audio-cover-player {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 42px 24px 108px;
  overflow: hidden;
}

.audio-cover-player::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: inherit;
  opacity: 0.25;
}

.audio-cover-player > img {
  width: min(56%, 280px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  z-index: 1;
}

.audio-cover-copy {
  position: absolute;
  left: 24px;
  top: 24px;
  z-index: 1;
  display: grid;
  color: #fff;
}

.audio-cover-copy span,
.audio-cover-copy small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.audio-cover-copy b {
  margin: 4px 0;
  font-size: 18px;
}

.audio-cover-player #learningVideo {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 4;
  width: calc(100% - 48px);
  height: 54px;
  object-fit: initial;
  background: transparent;
}

.audio-mode .video-subtitle {
  bottom: 92px;
  z-index: 5;
}

.audio-mode .cue-progress {
  bottom: 88px;
}

.audio-mode .player-tool-row {
  top: 18px;
}

.learning-document {
  max-width: 920px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid rgba(112, 125, 155, 0.18);
  border-radius: 22px;
  background: #fff;
  color: #20283a;
}

.learning-document > header {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(112, 125, 155, 0.16);
}

.learning-document > header span {
  color: #5268dd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.learning-document h2,
.learning-document h3 {
  margin: 6px 0 10px;
}

.learning-document section {
  margin-top: 24px;
}

.document-transcript-lines {
  display: grid;
  margin-top: 14px;
}

.document-transcript-lines button {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px 4px;
  border: 0;
  border-bottom: 1px solid rgba(112, 125, 155, 0.13);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.document-transcript-lines button:hover {
  background: rgba(82, 104, 221, 0.055);
}

.document-transcript-lines time,
.document-transcript-lines small {
  color: #71798c;
}

.document-transcript-lines small {
  display: block;
  margin-top: 5px;
  line-height: 1.65;
}

.guide-vocabulary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-vocabulary article,
.learning-document details,
.official-document-grid > * {
  border: 1px solid rgba(112, 125, 155, 0.16);
  border-radius: 14px;
  background: #f8f9fd;
  padding: 14px;
}

.guide-vocabulary em {
  margin-left: 8px;
  color: #737b8f;
  font-size: 12px;
}

.guide-vocabulary small,
.learning-document details small {
  display: block;
  margin-top: 6px;
  color: #60697d;
  line-height: 1.55;
}

.learning-document details {
  margin-top: 9px;
}

.learning-document summary {
  cursor: pointer;
  font-weight: 700;
}

.learning-document footer {
  margin-top: 24px;
  color: #747d90;
  font-size: 12px;
}

.official-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.official-document-grid a,
.document-pending {
  display: grid;
  gap: 6px;
  color: #26304a;
  text-decoration: none;
}

.official-document-grid a:hover {
  border-color: #5268dd;
}

.official-document-grid span,
.source-page-link {
  color: #667089;
  font-size: 13px;
}

.source-page-link {
  display: inline-block;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .simple-category-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .library-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-toolbar {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .study-toolbar > button {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .simple-category-menu,
  .library-filters,
  .guide-vocabulary,
  .official-document-grid {
    grid-template-columns: 1fr 1fr;
  }

  .simple-category-menu > button {
    min-height: 56px;
    padding: 0 11px;
  }

  .learning-document {
    padding: 18px;
    border-radius: 16px;
  }

  .study-video.audio-mode {
    min-height: 460px;
  }

  .audio-cover-player > img {
    width: min(72%, 250px);
  }
}

.study-video .player-read-control,
.study-video .player-subtitle-control,
.study-video .player-queue-add,
.study-video .player-download,
.study-video .player-fullscreen,
.study-video:fullscreen .player-read-control,
.study-video:fullscreen .player-subtitle-control,
.study-video:fullscreen .player-queue-add,
.study-video:fullscreen .player-download,
.study-video:fullscreen .player-fullscreen,
.study-video:-webkit-full-screen .player-read-control,
.study-video:-webkit-full-screen .player-subtitle-control,
.study-video:-webkit-full-screen .player-queue-add,
.study-video:-webkit-full-screen .player-download,
.study-video:-webkit-full-screen .player-fullscreen,
.study-video.is-fullscreen .player-read-control,
.study-video.is-fullscreen .player-subtitle-control,
.study-video.is-fullscreen .player-queue-add,
.study-video.is-fullscreen .player-download,
.study-video.is-fullscreen .player-fullscreen,
.study-video.is-mobile-fullscreen .player-read-control,
.study-video.is-mobile-fullscreen .player-subtitle-control,
.study-video.is-mobile-fullscreen .player-queue-add,
.study-video.is-mobile-fullscreen .player-download,
.study-video.is-mobile-fullscreen .player-fullscreen {
  bottom: 28px !important;
}

@media (max-width: 899px), (hover: none), (pointer: coarse) {
  .video-subtitle {
    bottom: 32px !important;
    width: min(96%, 760px) !important;
    gap: 3px !important;
  }

  .study-video:fullscreen .video-subtitle,
  .study-video:-webkit-full-screen .video-subtitle,
  .study-video.is-fullscreen .video-subtitle,
  .study-video.is-mobile-fullscreen .video-subtitle {
    bottom: 84px !important;
  }

  .subtitle-line,
  .study-video:fullscreen:not(.fullscreen-cues-closed) .subtitle-line,
  .study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .subtitle-line,
  .study-video.is-fullscreen:not(.fullscreen-cues-closed) .subtitle-line,
  .study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .subtitle-line {
    max-width: 96% !important;
    padding: 2px 6px !important;
    font-size: clamp(10px, calc(var(--subtitle-size, 18px) * 0.72), 14px) !important;
    line-height: 1.18 !important;
  }

  .subtitle-line.zh,
  .study-video:fullscreen:not(.fullscreen-cues-closed) .subtitle-line.zh,
  .study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .subtitle-line.zh,
  .study-video.is-fullscreen:not(.fullscreen-cues-closed) .subtitle-line.zh,
  .study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .subtitle-line.zh {
    font-size: clamp(9px, calc(var(--subtitle-size, 18px) * 0.66), 13px) !important;
  }

  .study-video:not(.is-fullscreen):not(.is-mobile-fullscreen) .player-read-control,
  .study-video:not(.is-fullscreen):not(.is-mobile-fullscreen) .player-queue-add,
  .study-video:not(.is-fullscreen):not(.is-mobile-fullscreen) .player-subtitle-control,
  .study-video:not(.is-fullscreen):not(.is-mobile-fullscreen) .player-download,
  .study-video:not(.is-fullscreen):not(.is-mobile-fullscreen) .player-fullscreen {
    bottom: 6px !important;
  }

  .study-shell.video-is-playing .study-video:not(.chrome-visible):not(.settings-open) .video-subtitle {
    bottom: 14px !important;
  }

  .study-shell:not(.video-is-playing) .video-subtitle .inline-word,
  .study-video.chrome-visible .video-subtitle .inline-word {
    pointer-events: none !important;
  }
}

.category-mobile-panel {
  display: none;
}

@media (max-width: 899px), (hover: none), (pointer: coarse) {
  .category-item > .category-panel {
    display: none !important;
  }

  .category-mobile-panel {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    z-index: 24 !important;
    display: block !important;
    width: 100% !important;
    height: min(390px, 48vh) !important;
    margin: -6px 0 16px !important;
    border-radius: 18px !important;
  }
}

/* iOS Safari cannot keep custom HTML controls inside the operating system's
   native video fullscreen. Offer an explicit learning fullscreen instead of
   silently hiding the follow-reading tools. */
.fullscreen-mode-dialog {
  position: absolute;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #fff;
  background: rgba(2, 5, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fullscreen-mode-dialog[hidden] {
  display: none !important;
}

.fullscreen-mode-card {
  width: min(390px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(11, 15, 23, 0.96);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.46);
}

.fullscreen-mode-card > b {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.fullscreen-mode-card > p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.fullscreen-mode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fullscreen-mode-actions button {
  min-height: 78px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.fullscreen-mode-actions button:first-child {
  border-color: rgba(201, 255, 37, 0.55);
  color: #101606;
  background: #c9ff25;
}

.fullscreen-mode-actions strong,
.fullscreen-mode-actions span {
  display: block;
}

.fullscreen-mode-actions strong {
  font-size: 16px;
}

.fullscreen-mode-actions span {
  margin-top: 5px;
  font-size: 12px;
  opacity: 0.72;
}

.fullscreen-mode-cancel {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 0;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
}

@media (max-width: 480px) {
  .fullscreen-mode-dialog {
    padding: 12px;
  }

  .fullscreen-mode-card {
    padding: 16px;
    border-radius: 18px;
  }

  .fullscreen-mode-card > b {
    font-size: 18px;
  }

  .fullscreen-mode-card > p {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .fullscreen-mode-actions button {
    min-height: 66px;
  }
}

/* Keep the learning controls reachable in compact learning fullscreen.
   Native iOS fullscreen still replaces the DOM by design. */
@media (max-width: 520px) {
  .study-video.is-fullscreen .player-read-control,
  .study-video.is-mobile-fullscreen .player-read-control,
  .study-video.is-fullscreen .player-subtitle-control,
  .study-video.is-mobile-fullscreen .player-subtitle-control,
  .study-video.is-fullscreen .player-download,
  .study-video.is-mobile-fullscreen .player-download,
  .study-video.is-fullscreen .player-queue-add,
  .study-video.is-mobile-fullscreen .player-queue-add {
    display: inline-flex !important;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  z-index: 2147483646;
  padding: 10px 22px;
  border-radius: 999px;
  color: #111;
  background: #dbff4a;
  font-size: 14px;
  font-weight: 900;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* Collapsible course introduction and scroll-following mini player. */
.study-video-slot {
  position: relative;
  min-width: 0;
}

.study-meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.study-meta-head > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.study-meta-toggle {
  min-width: 78px;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  border-radius: 999px;
  color: #315f47;
  background: #edf5ee;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.study-meta.collapsed {
  padding-top: 10px;
  padding-bottom: 10px;
}

.study-meta .study-summary[hidden] {
  display: none !important;
}

body[data-skin="studio"] .study-meta-toggle {
  border-color: #3d5548;
  color: #d8ff4a;
  background: #25342c;
}

.mini-player-actions {
  display: none;
}

.study-video.is-mini-player {
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  left: auto !important;
  top: auto !important;
  z-index: 2147483000 !important;
  width: min(360px, 34vw) !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 16px !important;
  background: #060706 !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42) !important;
}

.study-video.is-mini-player video {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: contain !important;
  background: #000 !important;
}

.study-video.is-mini-player .player-read-control,
.study-video.is-mini-player .player-subtitle-control,
.study-video.is-mini-player .player-queue-add,
.study-video.is-mini-player .player-download,
.study-video.is-mini-player .player-fullscreen,
.study-video.is-mini-player .player-exit-fullscreen,
.study-video.is-mini-player .cue-progress,
.study-video.is-mini-player .fullscreen-cue-rail,
.study-video.is-mini-player .subtitle-settings,
.study-video.is-mini-player .player-guide {
  display: none !important;
}

.study-video.is-mini-player .mini-player-actions {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 60;
  display: flex;
  gap: 5px;
}

.study-video.is-mini-player .mini-player-actions button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.study-video.is-mini-player .video-subtitle {
  bottom: 30px !important;
  width: 92% !important;
  gap: 2px !important;
}

.study-video.is-mini-player .subtitle-line,
.study-video.is-mini-player .subtitle-line.zh {
  max-width: 96% !important;
  padding: 2px 5px !important;
  font-size: clamp(8px, 1.1vw, 12px) !important;
  line-height: 1.15 !important;
}

@media (max-width: 899px) {
  .study-video:not(.is-mini-player):not(.is-fullscreen):not(.is-mobile-fullscreen) {
    position: relative !important;
    top: auto !important;
  }

  .sentence-area {
    height: clamp(320px, 62svh, 620px) !important;
    min-height: 320px !important;
    max-height: 620px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    scrollbar-gutter: stable !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
  }

  .study-video.is-mini-player {
    top: calc(64px + env(safe-area-inset-top)) !important;
    right: 10px !important;
    bottom: auto !important;
    width: min(56vw, 240px) !important;
    border-radius: 13px !important;
  }

  .study-video.is-mini-player .mini-player-actions {
    top: 5px;
    right: 5px;
  }

  .study-video.is-mini-player .mini-player-actions button {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .study-meta-head {
    gap: 8px;
  }

  .study-meta-toggle {
    min-width: 70px;
    min-height: 34px;
    padding: 0 10px;
  }
}

/* A category can be deliberately collapsed while the pointer is still over
   its trigger. Keep the desktop hover rule from immediately reopening it. */
.category-item.menu-closed:hover .category-panel,
.category-item.menu-closed:focus-within .category-panel,
.category-item.menu-closed.menu-open .category-panel {
  display: none !important;
}

@media (max-width: 899px) {
  .sentence-card {
    scroll-margin-top: 12px;
  }
}

/* Compact playback toolbar: match the queue header footprint instead of
   visually overpowering the lesson controls below it. */
.study-toolbar {
  width: calc(100% - 20px) !important;
  max-width: none !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 10px 8px !important;
  border-radius: 14px !important;
}

.study-toolbar .play-main {
  width: 58px !important;
  height: 36px !important;
}

.study-toolbar .speed-current {
  width: 48px !important;
  min-height: 30px !important;
}

@media (max-width: 520px) {
  .study-toolbar {
    grid-template-columns: minmax(0, 0.9fr) 58px repeat(3, minmax(0, 0.9fr)) !important;
  }

  .study-toolbar .play-main {
    width: 54px !important;
    height: 34px !important;
  }
}

/* Reading window: the current cue is the dark first card; every other cue
   uses the light preview treatment. */
.sentence-card.active {
  z-index: 3;
  border-color: rgba(219, 255, 74, 0.72) !important;
  color: #fffef8 !important;
  background: #13161a !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
  transform: none !important;
}

.sentence-card.active::before {
  background: #d8ff4a !important;
  box-shadow: 0 0 14px rgba(216, 255, 74, 0.42) !important;
}

.sentence-card.active b,
body[data-skin="studio"] .sentence-card.active b {
  color: #fffef8 !important;
}

.sentence-card.active p,
body[data-skin="studio"] .sentence-card.active p,
.sentence-card.active .sentence-actions > span {
  color: #d7d0c5 !important;
}

.sentence-card.preview {
  z-index: 2;
  border-color: rgba(72, 151, 196, 0.58) !important;
  color: #152b3a !important;
  background:
    linear-gradient(145deg, rgba(239, 249, 255, 0.98), rgba(218, 238, 250, 0.96)) !important;
  box-shadow:
    0 12px 28px rgba(30, 72, 96, 0.18),
    0 3px 8px rgba(30, 72, 96, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
  transform: none !important;
}

.sentence-card.preview::before {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #59a9d5;
  box-shadow: 0 0 14px rgba(89, 169, 213, 0.46);
}

.sentence-card.preview b,
body[data-skin="studio"] .sentence-card.preview b {
  color: #152b3a !important;
}

.sentence-card.preview p,
body[data-skin="studio"] .sentence-card.preview p {
  color: #4b687a !important;
}

.sentence-card.preview .sentence-actions > span {
  color: #567183 !important;
}

/* Balance the visibly wider speed control against the short download label:
   pin both outer controls to equal insets and distribute the middle three. */
.study-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  padding: 0 100px !important;
  box-sizing: border-box;
}

.study-toolbar > .speed-picker {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
}

.study-toolbar > .download-lock {
  position: absolute;
  top: 0;
  right: 14px;
  width: auto;
  height: 100%;
  padding: 0;
}

@media (max-width: 520px) {
  .study-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding: 0 88px !important;
  }

  .study-toolbar > .speed-picker {
    left: 10px;
  }

  .study-toolbar > .download-lock {
    right: 10px;
  }
}

/* One coordinated surface color for the stacked lesson sections. */
body[data-skin="studio"] .study-meta,
body[data-skin="studio"] .study-toolbar,
body[data-skin="studio"] .playlist-panel,
body[data-skin="studio"] .playlist-panel .pl-head,
body[data-skin="studio"] .playlist-panel .pl-item {
  border-color: #383a42 !important;
  background: #1b1c21 !important;
}

body[data-skin="studio"] .playlist-panel .pl-item.current {
  background: #272a30 !important;
}

/* Keep the mini-player placeholder stable during automatic cue scrolling.
   Returning the fixed player to the document here causes mobile browsers to
   jump back to the video; hide it in place until the learner scrolls. */
.study-video.is-mini-player.is-auto-follow-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* v44 sentence shadowing and pronunciation assessment. */
.sentence-actions .sentence-shadow-btn {
  border-color: rgba(216, 255, 74, 0.54) !important;
  color: #111 !important;
  background: #d8ff4a !important;
  font-weight: 900;
}

.sentence-card.active .sentence-actions .sentence-shadow-btn {
  box-shadow: 0 0 0 2px rgba(216, 255, 74, 0.16);
}

.pronunciation-overlay {
  position: fixed;
  z-index: 2600;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 8, 0.72);
  backdrop-filter: blur(10px);
}

.pronunciation-panel {
  width: min(620px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  padding: 22px;
  color: #fffef8;
  background: #15171b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.pronunciation-panel > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.pronunciation-panel > header span {
  color: #d8ff4a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.pronunciation-panel > header h2 {
  margin: 8px 0 5px;
  color: #fffef8;
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.24;
}

.pronunciation-panel > header p {
  margin: 0;
  color: #aaa59d;
  line-height: 1.55;
}

.pronunciation-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  font-size: 25px;
  line-height: 1;
}

.pronunciation-privacy,
.pronunciation-status,
.pronunciation-error,
.pronunciation-best {
  display: block;
  margin-top: 16px;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.55;
}

.pronunciation-privacy {
  color: #c8c3bb;
  background: rgba(255, 255, 255, 0.055);
}

.pronunciation-status {
  min-height: 22px;
  color: #e8e3db;
  background: rgba(89, 169, 213, 0.12);
}

.pronunciation-status.recording {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #ffd8d8;
  background: rgba(255, 73, 73, 0.14);
}

.recording-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #ff4d55;
  box-shadow: 0 0 0 0 rgba(255, 77, 85, 0.58);
  animation: pronunciationPulse 1.15s infinite;
}

@keyframes pronunciationPulse {
  70% { box-shadow: 0 0 0 9px rgba(255, 77, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 85, 0); }
}

.pronunciation-error {
  color: #ffd2d2;
  background: rgba(255, 77, 85, 0.14);
}

.pronunciation-best {
  color: #d8ff4a;
  background: rgba(216, 255, 74, 0.08);
}

.pronunciation-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.pronunciation-actions button,
.pronunciation-panel > footer button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 9px 11px;
  color: #fffef8;
  background: #25282e;
  font-size: 13px;
  font-weight: 900;
}

.pronunciation-actions button:disabled,
.pronunciation-panel > footer button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pronunciation-actions .record-start {
  color: #fff;
  background: #e64049;
}

.pronunciation-actions .record-stop {
  color: #fff;
  background: #b9232d;
}

.pronunciation-result {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid rgba(216, 255, 74, 0.22);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(216, 255, 74, 0.1), rgba(89, 169, 213, 0.07));
}

.pronunciation-score-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 13px;
  align-items: center;
}

.pronunciation-score-main strong {
  grid-row: 1 / span 2;
  color: #d8ff4a;
  font-size: 54px;
  line-height: 1;
}

.pronunciation-score-main span {
  font-size: 18px;
  font-weight: 900;
}

.pronunciation-score-main em {
  color: #a9d8f2;
  font-size: 12px;
  font-style: normal;
}

.pronunciation-dimensions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pronunciation-dimensions div {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
}

.pronunciation-dimensions span {
  color: #bdb8b0;
  font-size: 11px;
}

.pronunciation-dimensions b {
  font-size: 20px;
}

.pronunciation-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pronunciation-words > span {
  display: inline-grid;
  gap: 2px;
  border-radius: 10px;
  padding: 6px 8px;
}

.pronunciation-words b {
  color: inherit;
  font-size: 15px;
}

.pronunciation-words small {
  font-size: 9px;
}

.pronunciation-words .good { color: #d8ff4a; background: rgba(216, 255, 74, 0.09); }
.pronunciation-words .medium { color: #ffd166; background: rgba(255, 209, 102, 0.1); }
.pronunciation-words .weak { color: #ff8b91; background: rgba(255, 77, 85, 0.1); }

.pronunciation-advice {
  margin: 0;
  color: #d5d0c8;
  font-size: 13px;
  line-height: 1.55;
}

.pronunciation-panel > footer {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.pronunciation-panel > footer .pronunciation-submit {
  color: #111;
  background: #d8ff4a;
}

.pronunciation-panel > footer small {
  color: #8f8a82;
  line-height: 1.45;
  text-align: center;
}

.profile-pronunciation {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.profile-pronunciation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.profile-pronunciation-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.profile-pronunciation-head h2 {
  margin: 3px 0 0;
}

.profile-pronunciation-head button,
.profile-pronunciation-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
  font-size: 12px;
  font-weight: 900;
}

.profile-pronunciation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-pronunciation-summary article {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  padding: 12px;
  background: rgba(89, 169, 213, 0.09);
}

.profile-pronunciation-summary span,
.profile-pronunciation-copy small,
.profile-pronunciation-copy > span,
.profile-pronunciation-note {
  color: var(--muted);
  font-size: 11px;
}

.profile-pronunciation-list {
  display: grid;
  gap: 10px;
}

.profile-pronunciation-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.profile-pronunciation-score {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #111;
  background: #d8ff4a;
}

.profile-pronunciation-score strong { font-size: 22px; line-height: 1; }
.profile-pronunciation-score span { font-size: 9px; font-weight: 900; }

.profile-pronunciation-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-pronunciation-copy b,
.profile-pronunciation-copy p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pronunciation-copy p { color: var(--muted); font-size: 12px; }

.profile-pronunciation-actions {
  display: flex;
  gap: 7px;
}

.profile-pronunciation-actions button:last-child {
  color: #111;
  background: #d8ff4a;
}

.profile-pronunciation-empty {
  border-radius: 16px;
  padding: 16px;
  background: rgba(89, 169, 213, 0.08);
}

.profile-pronunciation-empty p,
.profile-pronunciation-note { margin: 5px 0 0; line-height: 1.5; }

body[data-skin="studio"] .profile-pronunciation {
  border-color: #383a42;
  color: #fffef8;
  background: #1b1c21;
  box-shadow: none;
}

body[data-skin="studio"] .profile-pronunciation-head button,
body[data-skin="studio"] .profile-pronunciation-actions button {
  border-color: #41434a;
  color: #fffef8;
  background: #26282e;
}

body[data-skin="studio"] .profile-pronunciation-actions button:last-child {
  color: #111;
  background: #d8ff4a;
}

@media (max-width: 680px) {
  .pronunciation-overlay {
    align-items: end;
    padding: 0;
  }

  .pronunciation-panel {
    width: 100%;
    max-height: min(82svh, 760px);
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .pronunciation-actions,
  .pronunciation-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pronunciation-panel > header h2 {
    font-size: 21px;
  }

  .profile-pronunciation {
    padding: 14px;
  }

  .profile-pronunciation-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .profile-pronunciation-score {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .profile-pronunciation-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recording-dot { animation: none; }
}

/* v49: keep the complete auxiliary toolbar in the upper safe area, remove
   the outer pill, and give each action its own semi-transparent background. */
.player-tool-row {
  position: absolute;
  top: clamp(8px, 2.2vw, 14px);
  left: 50%;
  z-index: 42;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 132px);
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 0;
  transform: translate(-50%, -5px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.player-tool-row > .player-read-control,
.player-tool-row > .player-queue-add,
.player-tool-row > .player-subtitle-control,
.player-tool-row > .player-download,
.player-tool-row > .player-fullscreen {
  position: static !important;
  inset: auto !important;
  flex: 0 0 auto;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: rgba(8, 10, 13, 0.58) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease !important;
}

.player-tool-row > .player-read-control,
.player-tool-row > .player-download,
.player-tool-row > .player-fullscreen {
  width: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
}

.player-tool-row > .player-queue-add,
.player-tool-row > .player-subtitle-control {
  min-width: 54px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  letter-spacing: 0.01em;
}

.player-tool-row > .player-read-control,
.player-tool-row > .player-subtitle-control {
  color: #d8ff4a !important;
}

.player-tool-row > .player-queue-add {
  color: #ffe071 !important;
}

.player-tool-row > button:hover,
.player-tool-row > button:focus-visible {
  border-color: rgba(216, 255, 74, 0.64) !important;
  color: #111 !important;
  background: rgba(216, 255, 74, 0.92) !important;
  outline: none;
  transform: translateY(-1px) !important;
}

.study-video.chrome-visible .player-tool-row,
.study-video.settings-open .player-tool-row,
.study-video.fullscreen-mode-open .player-tool-row {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

html.touch-device .study-shell.video-is-playing .study-video:not(.chrome-visible):not(.settings-open) .player-tool-row {
  opacity: 0 !important;
  transform: translate(-50%, -5px) !important;
  pointer-events: none !important;
}

.study-video:fullscreen .player-tool-row,
.study-video:-webkit-full-screen .player-tool-row,
.study-video.is-fullscreen .player-tool-row,
.study-video.is-mobile-fullscreen .player-tool-row {
  top: max(14px, env(safe-area-inset-top));
  z-index: 2147483647;
}

.study-video:fullscreen:not(.fullscreen-cues-closed) .player-tool-row,
.study-video:-webkit-full-screen:not(.fullscreen-cues-closed) .player-tool-row,
.study-video.is-fullscreen:not(.fullscreen-cues-closed) .player-tool-row,
.study-video.is-mobile-fullscreen:not(.fullscreen-cues-closed) .player-tool-row {
  left: calc((100% - var(--fullscreen-rail-width) - var(--fullscreen-rail-gap) - var(--fullscreen-rail-edge)) / 2);
}

.study-video.is-mini-player .player-tool-row {
  display: none !important;
}

@media (max-width: 520px) {
  .player-tool-row {
    /* Real courses can show wide counters such as 17/142 and iOS may expose
       native corner actions. Use the next visual line while staying in the
       upper portion of the picture. */
    top: 44px;
    gap: 5px;
    max-width: calc(100% - 106px);
    min-height: 32px;
    padding: 0;
  }

  .player-tool-row > .player-read-control,
  .player-tool-row > .player-queue-add,
  .player-tool-row > .player-subtitle-control,
  .player-tool-row > .player-download,
  .player-tool-row > .player-fullscreen {
    display: inline-grid !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  .player-tool-row > .player-read-control,
  .player-tool-row > .player-download,
  .player-tool-row > .player-fullscreen {
    width: 32px !important;
    min-width: 32px !important;
  }

  .player-tool-row > .player-queue-add,
  .player-tool-row > .player-subtitle-control {
    min-width: 48px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  .player-tool-row > .player-read-control::before,
  .player-tool-row > .player-download::before {
    transform: scale(0.82);
  }

  .player-tool-row > .player-fullscreen::before {
    inset: 9px !important;
  }

  .study-video:fullscreen .player-tool-row,
  .study-video:-webkit-full-screen .player-tool-row,
  .study-video.is-fullscreen .player-tool-row,
  .study-video.is-mobile-fullscreen .player-tool-row {
    top: max(58px, calc(env(safe-area-inset-top) + 48px));
    left: 50%;
  }
}

/* Final v52 overrides must follow the legacy frozen-player refinements. */
.study-video.audio-mode .cue-progress {
  top: 14px !important;
  right: 14px !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
}

.study-video.audio-mode .audio-cover-copy {
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.62);
  line-height: 1.2;
  backdrop-filter: blur(8px);
}

.study-video.audio-mode .audio-cover-copy span,
.study-video.audio-mode .audio-cover-copy b,
.study-video.audio-mode .audio-cover-copy small {
  position: static;
  display: block;
  margin: 0;
  color: #fff;
  line-height: 1.25;
}

.study-video.audio-mode .audio-cover-copy span,
.study-video.audio-mode .audio-cover-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.study-toolbar {
  display: flex !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 82px 0 90px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.study-toolbar > button:not(.download-lock) {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 72px;
  padding: 0 10px !important;
}

.study-toolbar > .speed-picker,
.study-toolbar > .download-lock {
  z-index: 3;
  background: inherit;
}

@media (max-width: 700px) {
  .study-toolbar {
    justify-content: flex-start !important;
  }
}

/* v53: one clear secondary programme level and a compact filter toolbar. */
.secondary-category-menu {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(105, 116, 143, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
}

.secondary-category-head {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  min-width: 50px;
  padding-top: 7px;
  color: #616b80;
  font-size: 12px;
  font-weight: 800;
}

.secondary-category-head small {
  font-size: 10px;
  opacity: 0.72;
}

.secondary-category-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 7px;
}

.secondary-category-list button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(99, 111, 140, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #30384a;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.secondary-category-list button small {
  color: #7a8293;
  font-size: 10px;
}

.secondary-category-list button.active {
  border-color: #596fe7;
  background: rgba(89, 111, 231, 0.1);
  color: #4057ce;
}

.secondary-category-list button.active small {
  color: inherit;
  opacity: 0.72;
}

.library-filters {
  display: flex !important;
  align-items: flex-end;
  flex-wrap: wrap;
  width: fit-content !important;
  max-width: 100%;
  gap: 9px !important;
  margin: 12px 0 20px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(105, 116, 143, 0.18) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.52) !important;
  box-sizing: border-box;
}

.library-filters label {
  display: grid !important;
  flex: 0 0 auto;
  gap: 5px !important;
}

.library-filters .filter-level,
.library-filters .filter-duration {
  width: 138px;
}

.library-filters .filter-source {
  width: 210px;
}

.library-filters .filter-sort {
  width: 150px;
}

.library-filters label > span {
  padding-left: 3px;
  color: #697286 !important;
  font-size: 11px !important;
}

.library-filters select {
  width: 100% !important;
  min-height: 38px !important;
  height: 38px;
  border: 1px solid rgba(105, 116, 143, 0.24) !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #293144 !important;
  padding: 0 32px 0 11px !important;
  font-size: 13px;
  box-shadow: none !important;
}

body[data-skin="studio"] .secondary-category-menu,
body[data-skin="studio"] .library-filters {
  border-color: #30333c !important;
  background: #18191d !important;
  box-shadow: none !important;
}

body[data-skin="studio"] .secondary-category-head,
body[data-skin="studio"] .library-filters label > span {
  color: #858b98 !important;
}

body[data-skin="studio"] .secondary-category-list button {
  border-color: #343741;
  background: #232429;
  color: #e6e4de;
}

body[data-skin="studio"] .secondary-category-list button small {
  color: #7f807c;
}

body[data-skin="studio"] .secondary-category-list button.active {
  border-color: #caff37;
  background: rgba(202, 255, 55, 0.1);
  color: #d4ff58;
  box-shadow: 0 0 0 1px rgba(202, 255, 55, 0.08);
}

body[data-skin="studio"] .library-filters select {
  color-scheme: dark;
  border-color: #343741 !important;
  background: #232429 !important;
  color: #f0eee8 !important;
}

body[data-skin="studio"] .library-filters select:hover,
body[data-skin="studio"] .library-filters select:focus {
  border-color: #6f7583 !important;
  outline: none;
}

@media (max-width: 760px) {
  .secondary-category-menu {
    display: block;
  }

  .secondary-category-head {
    display: flex;
    gap: 7px;
    margin-bottom: 8px;
    padding-top: 0;
  }

  .secondary-category-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .secondary-category-list::-webkit-scrollbar {
    display: none;
  }

  .secondary-category-list button {
    flex: 0 0 auto;
  }

  .library-filters {
    width: 100% !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .library-filters::-webkit-scrollbar {
    display: none;
  }

  .library-filters .filter-level,
  .library-filters .filter-duration {
    width: 126px;
  }

  .library-filters .filter-source {
    width: 190px;
  }

  .library-filters .filter-sort {
    width: 140px;
  }
}

@media (max-width: 360px) {
  .player-tool-row {
    left: calc(50% - 8px);
    gap: 4px;
    max-width: calc(100% - 86px);
    min-height: 32px;
    padding: 0;
  }

  .player-tool-row > .player-read-control,
  .player-tool-row > .player-download,
  .player-tool-row > .player-fullscreen {
    width: 29px !important;
    min-width: 29px !important;
  }

  .player-tool-row > .player-queue-add,
  .player-tool-row > .player-subtitle-control {
    min-width: 43px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-tool-row,
  .player-tool-row > button {
    transition: none !important;
  }
}

/* Fullscreen already has a dedicated exit control; avoid duplicating it in
   the compact row, including portrait screens where mobile rules re-enable
   the other learning tools. */
.study-video:fullscreen .player-tool-row > .player-fullscreen,
.study-video:-webkit-full-screen .player-tool-row > .player-fullscreen,
.study-video.is-fullscreen .player-tool-row > .player-fullscreen,
.study-video.is-mobile-fullscreen .player-tool-row > .player-fullscreen {
  display: none !important;
}

/* v50: passwordless SMS sign-in and a YouTube-style fullscreen glyph. */
.login-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.05);
}

.login-mode-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.login-mode-tabs button.active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 4px 12px rgba(17, 17, 17, 0.14);
}

.login-legal-consent {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 10px !important;
  margin: 0;
  font-size: 13px;
}

.login-card .login-legal-consent input {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 3px 0 0 !important;
  padding: 0 !important;
}

.login-card .login-legal-consent span {
  display: block !important;
  min-width: 0 !important;
  white-space: normal !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  line-height: 1.55 !important;
}

.profile-account-tools,
.profile-license-card {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface, rgba(255, 253, 248, 0.96));
  box-shadow: var(--shadow);
}

body[data-skin="prism"] .profile-account-tools,
body[data-skin="prism"] .profile-license-card,
body[data-skin="studio"] .profile-account-tools,
body[data-skin="studio"] .profile-license-card {
  width: min(700px, 100%);
}

body[data-skin="studio"] .profile-account-tools,
body[data-skin="studio"] .profile-license-card {
  border-color: rgba(255, 255, 255, 0.1);
  color: #fffef8;
  background: #1a1b20;
  box-shadow: none;
}

body[data-skin="studio"] .profile-account-tools p,
body[data-skin="studio"] .profile-license-card p,
body[data-skin="studio"] .profile-account-tools-head span,
body[data-skin="studio"] .profile-license-card > div > span {
  color: #d7d0c5;
}

body[data-skin="studio"] .profile-password-form input,
body[data-skin="studio"] .profile-license-row input {
  border-color: rgba(255, 255, 255, 0.12);
  color: #fffef8;
  background: #111217;
}

.profile-account-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.profile-account-tools-head span,
.profile-license-card > div > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.profile-account-tools h2,
.profile-license-card h2 {
  margin: 3px 0 0;
  font-size: 19px;
  letter-spacing: 0;
}

.profile-account-tools p,
.profile-license-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.profile-password-form {
  display: grid;
  gap: 13px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.profile-password-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.profile-password-form input,
.profile-license-row input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
}

.profile-license-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.danger-zone-row > .code-wrap {
  min-width: 0;
}

.player-fullscreen::before {
  inset: auto !important;
  width: 20px !important;
  height: 20px !important;
  background: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5'/%3E%3C/svg%3E") center / 20px 20px no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5'/%3E%3C/svg%3E") center / 20px 20px no-repeat !important;
  transform: none !important;
}

.player-fullscreen::after {
  display: none !important;
}

@media (max-width: 620px) {
  .profile-license-row {
    grid-template-columns: 1fr;
  }

  .profile-account-tools,
  .profile-license-card {
    padding: 16px;
  }

  .player-tool-row > .player-fullscreen::before {
    width: 18px !important;
    height: 18px !important;
    -webkit-mask-size: 18px 18px !important;
    mask-size: 18px 18px !important;
  }
}

/* v55: final profile layout override — every primary panel shares one edge. */
body[data-view="profile"] .profile-list,
body[data-view="profile"] .profile-playlist,
body[data-view="profile"] .profile-document-library,
body[data-view="profile"] .profile-account-tools,
body[data-view="profile"] .profile-license-card,
body[data-view="profile"] .continue-card,
body[data-view="profile"] .profile-pronunciation,
body[data-view="profile"] .profile-word-cards,
body[data-view="profile"] .danger-zone,
body[data-view="profile"] .logout-btn {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* v57: admin internal-message composer and delivery audit. */
.admin-notice-compose {
  border-top: 4px solid #2563eb;
}

.admin-notice-compose .admin-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-notice-compose .admin-help {
  margin-top: 7px;
}

.admin-notice-compose textarea {
  line-height: 1.65;
}

.admin-notice-message {
  min-width: 280px;
  max-width: 520px;
}

.admin-notice-message b {
  color: #111827;
  font-size: 14px;
}

.admin-notice-message em {
  display: block;
  margin-top: 7px;
  color: #2563eb;
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

/* v58: bidirectional user-to-admin support mailbox. */
.admin-support-layout {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(460px, 1.22fr);
  gap: 16px;
  align-items: start;
}

.admin-support-list,
.admin-support-detail {
  min-width: 0;
}

.admin-support-items,
.admin-support-thread {
  display: grid;
  gap: 9px;
}

.admin-support-item {
  width: 100%;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(17, 24, 39, .1);
  border-radius: 10px;
  padding: 12px;
  color: #111827;
  background: #f8fafc;
  text-align: left;
}

.admin-support-item.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.admin-support-item.has-unread {
  box-shadow: inset 4px 0 #dc2626;
}

.admin-support-item span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-support-item b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-support-item em,
.admin-support-item small {
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
}

.admin-support-item strong {
  color: #b91c1c;
  font-size: 11px;
}

.admin-support-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-support-detail-head > div > span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
}

.admin-support-detail-head h2 {
  margin: 5px 0 !important;
}

.admin-support-detail-head p,
.admin-support-empty p {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
}

.admin-support-thread {
  max-height: 48vh;
  overflow-y: auto;
  border: 1px solid rgba(17, 24, 39, .08);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.admin-support-bubble {
  width: min(82%, 640px);
  border-radius: 12px 12px 12px 3px;
  padding: 11px 12px;
  background: #e5e7eb;
}

.admin-support-bubble.is-admin {
  justify-self: end;
  border-radius: 12px 12px 3px 12px;
  background: #dbeafe;
}

.admin-support-bubble > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 10px;
}

.admin-support-bubble p {
  margin: 6px 0 0;
  color: #111827;
  line-height: 1.65;
}

.admin-support-empty {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

@media (max-width: 1050px) {
  .admin-support-layout {
    grid-template-columns: 1fr;
  }
}

/* The inbox already contains the full contact form; avoid a duplicate floating
   customer-service button covering form fields on narrow screens. */
body[data-view="inbox"] .support-fab {
  display: none;
}

/* Android Chrome can leave the lesson page unable to pan when both root
   elements clip horizontally. Keep normal pages scrollable; real player
   fullscreen retains its dedicated scroll lock. */
@media (max-width: 899px) {
  html:not(.mobile-player-fullscreen),
  html:not(.mobile-player-fullscreen) body {
    overflow-y: auto !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto;
  }
}

/* Keep the desktop video and the sentence rail in one sightline. The mobile
   DOM and its stacked playback layout remain unchanged. */
@media (min-width: 900px) {
  body[data-skin="prism"] .study-shell,
  body[data-skin="studio"] .study-shell {
    width: min(1480px, calc(100vw - 64px));
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto auto auto auto auto;
    gap: 0 20px;
  }

  .study-primary { display: contents; }
  .study-top { grid-column: 1 / -1; grid-row: 1; }
  .study-shell > .transcript-mode-switch { grid-column: 1 / -1; grid-row: 2; }

  .study-video-slot { grid-column: 1; grid-row: 3; min-width: 0; }
  .sentence-area {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    align-content: start;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 0.961 / 1;
    max-height: none;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f4f7f4;
    scrollbar-gutter: stable;
  }

  .sentence-area[data-panel="sentences"]::before {
    content: "逐句字幕 · 当前句自动跟随";
    position: sticky;
    z-index: 4;
    top: -10px;
    display: block;
    margin: -10px -10px 4px;
    padding: 14px 16px;
    border-bottom: 1px solid #d8e2db;
    color: #203028;
    background: #f4f7f4;
    font-size: 14px;
    font-weight: 900;
  }

  .study-toolbar {
    grid-column: 1;
    grid-row: 4;
    width: 100% !important;
    margin: 12px 0 0 !important;
  }
  .playback-error { grid-column: 1; grid-row: 5; }
  .study-primary > .playlist-panel,
  .study-shell > .playlist-panel { grid-column: 1 / -1; grid-row: 6; }
  .study-shell .study-learning-method {
    grid-column: 1 / -1;
    grid-row: 7;
    min-width: 0;
    margin: 26px 0 0;
  }
  .study-shell .course-mastery-card {
    grid-column: 1 / -1;
    grid-row: 8;
    min-width: 0;
    margin: 14px 0 0;
  }
  .study-meta {
    grid-column: 1 / -1;
    grid-row: 9;
    width: 100%;
    margin: 14px 0 0;
  }

  body[data-skin="studio"] .study-shell .sentence-area {
    border-color: #333c38;
    background: #1b211e;
  }
  body[data-skin="studio"] .study-shell .sentence-area[data-panel="sentences"]::before {
    border-color: #35403a;
    color: #f4f6f2;
    background: #1b211e;
  }
  body[data-skin="studio"] .study-shell .subtitle-load-state {
    border-color: #39423e;
    color: #f4f6f2;
    background: #252d28;
  }
  body[data-skin="studio"] .study-shell .subtitle-load-state p { color: #c7d3cb; }
  body[data-skin="studio"] .study-shell .sentence-card.preview {
    border-color: #39423e !important;
    background: #252d28 !important;
    box-shadow: none !important;
  }
  body[data-skin="studio"] .study-shell .sentence-card.preview::before {
    background: #627e6c;
    box-shadow: none;
  }
  body[data-skin="studio"] .study-shell .sentence-card.preview b { color: #f4f6f2 !important; }
  body[data-skin="studio"] .study-shell .sentence-card.preview p,
  body[data-skin="studio"] .study-shell .sentence-card.preview .sentence-actions > span { color: #c7d3cb !important; }
}
