:root {
  --chalk: #1f2937;
  --muted: #718096;
  --blue: #4aa7f0;
  --green: #88bd5b;
  --gold: #dca536;
  --red: #d75b4e;
  --ink: #ffffff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(102, 116, 142, 0.2);
}

/* Base page and shared element styles */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 13% 17%, rgba(127, 226, 207, 0.22), transparent 17%),
    radial-gradient(circle at 88% 28%, rgba(110, 89, 255, 0.12), transparent 22%),
    radial-gradient(circle at 82% 78%, rgba(255, 173, 96, 0.13), transparent 18%),
    linear-gradient(135deg, #f7fbff 0%, #eef3ff 48%, #f8fbff 100%);
  color: var(--chalk);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(91, 108, 138, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 108, 138, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.55;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

#recorded-player {
  display: none;
}

.chalk-app {
  min-height: 100vh;
  padding: 22px;
}

/* Header and main layout */
.top-brand {
  max-width: 1480px;
  min-height: 96px;
  display: grid;
  grid-template-columns: 136px minmax(280px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 auto 12px;
}

.brand-mark {
  width: 128px;
  height: 103px;
  display: block;
  padding: 10px;
  border: 2px solid rgba(122, 137, 166, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(-2deg);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-copy {
  min-width: 0;
  container-type: inline-size;
}

.brand-copy h1 {
  margin: 0;
  color: #252f43;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(36px, 4.4vw, 62px);
  font-size: clamp(28px, 6.45cqw, 42px);
  line-height: 0.95;
  font-weight: 800;
  white-space: nowrap;
}

.brand-copy h1 > span {
  color: var(--blue);
}

.brand-shadowing {
  font-size: .72em;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .brand-copy h1 {
    font-size: clamp(22px, 7.1vw, 46px);
    white-space: nowrap;
  }
}

.brand-copy p {
  margin: 4px 0 0;
  color: #73819a;
  font-size: clamp(17px, 1.7vw, 24px);
  font-weight: 700;
}

.brand-copy .brand-motivation {
  width: 100%;
  margin: 10px 0 0;
  height: 28px;
  overflow: hidden;
  color: #66758e;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 700;
  line-height: 28px;
  text-overflow: clip;
  white-space: nowrap;
}

.workspace {
  max-width: 1480px;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(220px, 290px);
  gap: 20px;
  align-items: start;
  margin: 0 auto;
}

.library-column,
.center-column,
.premium-column {
  min-width: 0;
}

.library-column,
.center-column,
.premium-column,
.content-board,
.practice-board,
.lesson-hero,
.download-bar {
  border: 2px solid rgba(122, 137, 166, 0.18);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(79, 99, 140, 0.14);
}

.lesson-side-list {
  border-color: color-mix(in srgb, var(--side-accent) 52%, rgba(103, 116, 142, 0.18));
}

.side-lessons {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding-right: 4px;
  scrollbar-color: var(--side-accent) transparent;
}

.side-lesson-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 180px auto auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(103, 116, 142, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.side-lesson-card.active,
.side-lesson-card:hover {
  border-color: var(--side-accent);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 16px 32px rgba(79, 99, 140, 0.14),
    inset 0 0 0 1px color-mix(in srgb, var(--side-accent) 34%, transparent);
}

.side-lesson-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(238, 244, 255, 0.85), rgba(255, 255, 255, 0.3));
}

.side-lesson-card img:not([src]),
.drawer-card img:not([src]) {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--side-accent, var(--drawer-accent, var(--blue))) 18%, #eef4ff), #ffffff);
}

.side-lesson-card strong {
  min-width: 0;
  color: #132033;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.side-lesson-card span {
  color: var(--side-accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ribbon,
.premium-title {
  width: fit-content;
  margin: 0 0 12px;
  padding: 8px 20px;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-2deg);
}

.library-column {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.level-list {
  display: grid;
  gap: 0;
}

.level-row {
  width: 100%;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px dashed var(--line);
  text-align: left;
}

.level-row:first-child {
  border-top: 0;
}

.level-row b {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--level);
  border-radius: 999px;
  color: var(--level);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 24px;
  line-height: 1;
}

.level-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.level-row strong {
  color: #252f43;
  font-size: 21px;
  font-weight: 600;
}

.level-row em {
  color: #73819a;
  font-size: 15px;
  font-style: normal;
}

.level-row.active strong,
.level-row:hover strong {
  color: var(--level);
}

.level-note {
  padding: 16px;
  border: 2px solid rgba(74, 167, 240, 0.74);
  border-radius: 8px;
  color: var(--blue);
  text-align: center;
}

.level-note strong,
.level-note span {
  display: block;
}

.level-note span {
  margin-top: 6px;
  color: var(--chalk);
  font-size: 18px;
}

/* Center player column */
.center-column {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  border-color: rgba(74, 167, 240, 0.5);
}

.right-column-stack {
  position: static;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

.right-column-stack > .premium-column {
  position: static;
  top: auto;
}

.store-download-preview {
  min-width: 0;
  padding: 14px;
  border: 2px solid rgba(103, 80, 164, 0.18);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,244,255,.96));
  box-shadow: 0 18px 44px rgba(79, 99, 140, 0.14);
}

.store-download-preview > header {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-bottom: 12px;
  text-align: center;
}

.store-download-preview h2 {
  margin: 0;
  color: #6750a4;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 19px;
  line-height: 1.25;
}

.store-download-preview header span,
.store-download-preview > p {
  color: #7b879b;
  font-size: 11px;
  line-height: 1.35;
}

.store-download-list { display: grid; gap: 10px; }

.store-download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(103, 116, 142, 0.16);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
}

.store-download-card.android { border-color: rgba(61, 174, 72, 0.30); }
.store-download-card.apple { border-color: rgba(36, 44, 58, 0.22); }
.store-download-brand { min-width: 0; display: flex; align-items: center; gap: 8px; }
.store-download-brand span { min-width: 0; display: grid; }
.store-download-brand strong { color: #26334a; font-size: 14px; }
.store-download-brand small { overflow: hidden; color: #7b879b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.store-platform-icon { width: 36px; height: 36px; flex: 0 0 36px; color: #202631; fill: currentColor; }
.android-platform-icon {
  width: 132px;
  height: auto;
  flex: 0 1 132px;
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}
.apple-platform-icon { color: #202631; }

.store-qr-button,
.store-qr-large-button {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
}

.store-qr-button { padding: 0; }
.store-qr-button:hover .store-qr-placeholder { border-color: #6750a4; transform: scale(1.03); }

.store-qr-placeholder {
  position: relative;
  width: 82px;
  height: 82px;
  display: block;
  overflow: hidden;
  border: 2px dashed rgba(103, 80, 164, 0.30);
  border-radius: 8px;
  background:
    repeating-conic-gradient(#283247 0 25%, transparent 0 50%) 50% / 12px 12px,
    #fff;
  transition: transform .18s ease, border-color .18s ease;
}

.store-qr-placeholder::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 5px;
  background: rgba(255,255,255,.92);
}

.store-qr-placeholder i {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 5px solid #283247;
  background: #fff;
}

.store-qr-placeholder i:nth-child(1) { top: 6px; left: 6px; }
.store-qr-placeholder i:nth-child(2) { top: 6px; right: 6px; }
.store-qr-placeholder i:nth-child(3) { bottom: 6px; left: 6px; }
.store-qr-placeholder b,
.store-qr-placeholder em {
  position: absolute;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  color: #6750a4;
  background: rgba(255,255,255,.94);
  font-style: normal;
  text-align: center;
}
.store-qr-placeholder b { top: 28px; padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.store-qr-placeholder em { bottom: 4px; width: 72px; font-size: 7px; line-height: 1.1; }
.store-download-preview > p { margin: 10px 2px 0; text-align: center; }

.store-qr-dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid rgba(103,80,164,.2);
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 30px 90px rgba(18,25,43,.34);
  text-align: center;
}

.store-qr-dialog-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; text-align: left; }
.store-qr-dialog-brand .store-platform-icon { width: 48px; height: 48px; flex-basis: 48px; }
.store-qr-dialog-brand .android-platform-icon { width: 180px; height: auto; flex-basis: 180px; }
.visually-hidden { position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important; }
.store-qr-dialog-brand span { color: #7b879b; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.store-qr-dialog h2 { margin: 1px 0 0; color: #26334a; font-size: 24px; }
.store-qr-large-button { margin: 0 auto; padding: 8px; cursor: zoom-out; }
.store-qr-placeholder.large { width: min(260px, 70vw); height: min(260px, 70vw); background-size: 22px 22px; }
.store-qr-placeholder.large::after { inset: 42px; }
.store-qr-placeholder.large i { width: 48px; height: 48px; border-width: 10px; }
.store-qr-placeholder.large i:nth-child(1) { top: 16px; left: 16px; }
.store-qr-placeholder.large i:nth-child(2) { top: 16px; right: 16px; }
.store-qr-placeholder.large i:nth-child(3) { bottom: 16px; left: 16px; }
.store-qr-placeholder.large b { top: 43%; padding: 3px 8px; font-size: 22px; }
.store-qr-placeholder.large em { bottom: 16px; width: 180px; padding: 3px; font-size: 11px; }
.store-qr-dialog > p { margin: 18px 0 0; color: #65738a; font-size: 14px; line-height: 1.5; }

.shadowing-method {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 14px;
  border: 1px solid rgba(73, 164, 232, .24);
  border-radius: 12px;
  color: #318fd5;
  background:
    radial-gradient(circle at 100% 0, rgba(73,164,232,.12), transparent 38%),
    linear-gradient(135deg, #ffffff, #f2f9fe);
  box-shadow: 0 5px 16px rgba(49, 143, 213, .08);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(14px, 1.45vw, 18px);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.shadowing-method > div {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  font-size: 14px;
  font-size: clamp(11px, 2.8cqw, 18px);
  white-space: nowrap;
}
.shadowing-method strong { font-size: 1.08em; font-weight: 900; }
.shadowing-method span { opacity: 0.55; }
.shadowing-method em { font-style: normal; }
.shadowing-method small { max-width: 980px; color: #354866; font-family: "Segoe UI", Arial, sans-serif; font-size: clamp(11px, 1vw, 13px); font-weight: 650; line-height: 1.4; }
.shadowing-method-controls {
  position: relative;
  z-index: 12;
  min-height: 42px;
  padding: 3px 10px;
}
.expanded-player-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.expanded-player-actions .round-btn { width: 25px; height: 25px; font-size: 11px; }
.expanded-player-actions .play-btn { width: 33px; height: 33px; font-size: 14px; }
.expanded-player-actions .translation-toggle { flex: 0 0 172px; width: 172px; min-height: 25px; gap: 5px; padding: 4px 9px; box-sizing: border-box; font-size: 10px; white-space: nowrap; }
.expanded-player-actions .translation-toggle svg { width: 14px; height: 14px; }
.player-actions-relocated { min-height: 0; }
.shadowing-method-controls .translation-toggle span { opacity: 1; }

.public-reviews-preview {
  min-width: 0;
  padding: 16px;
  border: 2px solid rgba(103, 80, 164, 0.18);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(248, 245, 255, 0.96), rgba(255, 253, 249, 0.98));
  box-shadow: 0 14px 34px rgba(79, 61, 116, 0.10);
}

.public-reviews-preview > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.public-reviews-preview h2 {
  margin: 0;
  color: #6750a4;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 23px;
  line-height: 1.2;
  white-space: nowrap;
}

.public-reviews-preview header p {
  margin: 4px 0 0;
  color: #758199;
  font-size: 13px;
  line-height: 1.4;
}

.public-reviews-preview header > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #7c689f;
  background: rgba(103, 80, 164, 0.09);
  font-size: 11px;
  font-weight: 800;
}

.public-reviews-scroll {
  max-height: 252px;
  display: grid;
  gap: 10px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(103, 80, 164, 0.42) transparent;
}

.public-review-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(103, 80, 164, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.public-review-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(103, 80, 164, 0.26);
  color: #6750a4;
  background: rgba(103, 80, 164, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 3px 9px rgba(103, 80, 164, 0.08);
  font-weight: 900;
}

.public-review-content { min-width: 0; }

.public-review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-review-meta strong { color: #2d3850; }
.public-review-meta span { color: #7e89a0; font-size: 12px; }
.public-review-meta em { margin-left: auto; color: #e9a62b; font-size: 14px; font-style: normal; letter-spacing: 1px; }
.public-review-content p { margin: 6px 0 3px; color: #455168; font-size: 14px; line-height: 1.45; }
.public-review-content small { color: #8c79aa; font-size: 10px; }

.library-guide {
  display: none;
  padding: 14px;
  border: 1px solid rgba(73, 164, 232, .24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(73,164,232,.13), transparent 38%),
    linear-gradient(145deg, #fff, #f1f8fe);
}

.library-guide h2 {
  margin: 0 0 11px;
  color: #318fd5;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
}

.library-guide ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.library-guide li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #4d5b73;
  font-size: 12px;
  line-height: 1.35;
}

.library-guide li b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(49,143,213,.55);
  color: #318fd5;
  background: rgba(255,255,255,.78);
  font-size: 11px;
}

.library-guide-tips {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(73, 164, 232, .16);
}

.library-guide p {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: #52647e;
  font-size: 11px;
  line-height: 1.4;
}

.library-guide p span {
  color: #75b83d;
  font-weight: 900;
}

.library-homework-modes {
  display: grid;
  gap: 7px;
  margin: 11px 0;
  padding: 10px;
  border: 1px solid rgba(73,164,232,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.74);
}

.library-homework-modes > strong {
  color: #253b63;
  font-size: 11px;
  line-height: 1.3;
}

.library-homework-modes > div {
  display: grid;
  gap: 5px;
}

.library-homework-modes > div > span {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  color: #52647e;
  font-size: 10px;
  line-height: 1.25;
}

.library-homework-modes b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(49,143,213,.5);
  color: #318fd5;
  background: transparent;
  font-size: 9px;
}

.homework-library-nav {
  overflow: hidden;
}

.homework-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding-bottom: 9px;
  border-bottom: 1px dashed rgba(103,116,142,.2);
}

.homework-mode-toolbar button {
  padding: 6px 9px;
  border: 1px solid rgba(73,164,232,.24);
  border-radius: 9px;
  color: #318fd5;
  background: #f3f9fe;
  font-size: 10px;
  font-weight: 850;
}

.homework-mode-toolbar button:hover {
  border-color: #318fd5;
  background: #fff;
}

.homework-mode-toolbar strong {
  min-width: 0;
  overflow: hidden;
  color: #253b63;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homework-mode .homework-level-list {
  flex: 0 0 auto;
  align-content: start;
  grid-auto-rows: auto;
}

.homework-lessons-panel {
  position: sticky;
  top: 18px;
  display: flex;
  min-height: 0;
  max-height: calc(100dvh - 36px);
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--homework-accent) 38%, rgba(103,116,142,.18));
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--homework-accent) 12%, transparent), transparent 38%),
    linear-gradient(145deg,#fff,#f4f9fd);
}

.homework-lessons-panel > header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.homework-lessons-panel > header span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--homework-accent);
  font-size: 12px;
  font-weight: 900;
}

.homework-lessons-panel > header h2 {
  margin: 0;
  color: #253b63;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
}

.homework-lessons-panel .homework-lesson-list {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-color: var(--homework-accent) transparent;
}

.homework-lessons-panel .homework-lesson-list button:hover {
  border-color: var(--homework-accent);
  background: color-mix(in srgb, var(--homework-accent) 8%, #fff);
}

.homework-lessons-panel .homework-lesson-list button b {
  color: var(--homework-accent);
  background: color-mix(in srgb, var(--homework-accent) 10%, #fff);
}

.homework-lessons-panel .homework-lesson-list button.access-locked {
  cursor: default;
  opacity: 0.72;
}

.homework-lessons-panel .homework-lesson-list button.access-locked:hover {
  border-color: rgba(103, 80, 164, 0.13);
  background: rgba(255, 255, 255, 0.84);
}

.homework-lessons-panel .homework-lesson-list button.access-locked b {
  color: #8b94a3;
  background: #eceff2;
}

.homework-lessons-panel .homework-lesson-list button.access-locked .homework-lesson-title {
  color: #8b94a3;
}

.homework-library-entry {
  padding: 0;
}

.homework-library-entry > button {
  width: 100%;
  height: 100%;
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 17px;
  text-align: left;
}

.homework-library-entry > button:hover {
  background: rgba(255, 255, 255, 0.58);
}

.homework-library-entry > button span {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.homework-library-entry h2 {
  margin: 0;
}

.homework-library-entry small {
  color: #786b92;
  font-size: 11px;
  line-height: 1.4;
}

.homework-library-entry > button > b {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #6750a4, #4aa7f0);
  font-size: 19px;
}

.homework-library-entry .homework-shortcut-arrow {
  flex: 0 0 auto;
}

.course-homework-link {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 10px 11px;
  border: 1px solid rgba(73, 164, 232, .26);
  border-radius: 13px;
  color: #253b63;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.course-homework-link:hover {
  border-color: #318fd5;
  background: #fff;
  box-shadow: 0 8px 18px rgba(49, 143, 213, .12);
}

.course-homework-link > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.course-homework-link strong {
  font-size: 12px;
}

.course-homework-link small {
  overflow: hidden;
  color: #807493;
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-homework-link > b {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #49a7f0, #318fd5);
  font-size: 14px;
}

.homework-library-back {
  width: fit-content;
  margin-bottom: 10px;
  color: #6750a4;
  font-size: 11px;
  font-weight: 850;
}

.homework-library-back:hover {
  text-decoration: underline;
}

.homework-library-nav h2 {
  margin-bottom: 7px;
}

.homework-library-hint {
  display: block;
  margin: -3px 0 11px;
  color: #786b92;
  font-size: 11px;
  line-height: 1.35;
}

.homework-level-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.homework-level-tabs button {
  min-width: 0;
  height: 31px;
  border: 1px solid color-mix(in srgb, var(--homework-level) 44%, #ddd6e9);
  border-radius: 9px;
  color: var(--homework-level);
  background: rgba(255, 255, 255, 0.84);
  font-size: 10px;
  font-weight: 900;
}

.homework-level-tabs button.active {
  color: #fff;
  border-color: var(--homework-level);
  background: var(--homework-level);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--homework-level) 22%, transparent);
}

.homework-lessons-label {
  display: block;
  margin: 12px 0 7px;
  color: #59657b;
  font-size: 11px;
}

.homework-lesson-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: rgba(103, 80, 164, 0.42) transparent;
}

.homework-lesson-list button {
  min-width: 0;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(103, 80, 164, 0.13);
  border-radius: 9px;
  color: #3f4d65;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
}

.homework-lesson-list button:hover {
  border-color: #6750a4;
  background: #f4effc;
}

.homework-lesson-list button b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #6750a4;
  background: rgba(103, 80, 164, 0.10);
  font-size: 9px;
}

.homework-lesson-list button > .homework-lesson-title {
  min-width: 0;
  overflow: hidden;
  color: #253b63;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.homework-lesson-title.long-title {
  container-type: inline-size;
}

.homework-lesson-title .lesson-title-text {
  display: inline-block;
  min-width: max-content;
  transform: translateX(0);
  will-change: transform;
}

.homework-lesson-list button:hover .homework-lesson-title.long-title .lesson-title-text,
.homework-lesson-list button:focus-visible .homework-lesson-title.long-title .lesson-title-text {
  animation: lesson-title-hover-marquee 7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .homework-lesson-list button:hover .homework-lesson-title.long-title .lesson-title-text,
  .homework-lesson-list button:focus-visible .homework-lesson-title.long-title .lesson-title-text {
    animation: none;
  }
}

/* Keep the three desktop columns on one visual baseline. */
@media (min-width: 821px) {
  .workspace {
    align-items: stretch;
  }

  .library-column,
  .center-column,
  .right-column-stack {
    align-self: stretch;
    height: 100%;
  }

  .right-column-stack {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
  }

  .right-column-stack > :last-child {
    min-height: 0;
    height: 100%;
  }

  .right-column-stack .store-download-preview {
    display: flex;
    flex-direction: column;
  }

  .library-column .overall-progress-footer {
    margin-top: 0;
  }

  .library-column .library-guide {
    display: block;
    min-height: 0;
    flex: 1;
  }

  .library-column .library-guide.homework-library-entry {
    flex: 0 0 auto;
  }

  .library-column .homework-library-nav {
    display: flex;
    flex-direction: column;
  }

  .library-column .course-library-guide {
    display: flex;
    flex-direction: column;
  }

  .library-homework-modes > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 9px;
  }

  .center-column:has(.public-reviews-preview) {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .center-column:has(.public-reviews-preview) .public-reviews-preview {
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .center-column:has(.public-reviews-preview) .public-reviews-scroll {
    min-height: 0;
    max-height: none;
    flex: 1;
  }

  /* Keep the landing-page columns and review cards at their natural height. */
  .workspace:not(.lessons-open) {
    align-items: start;
  }

  .workspace:not(.lessons-open) .library-column,
  .workspace:not(.lessons-open) .center-column,
  .workspace:not(.lessons-open) .right-column-stack {
    align-self: start;
    height: auto;
  }

  .workspace:not(.lessons-open) .right-column-stack {
    grid-template-rows: auto auto;
    align-content: start;
  }

  .workspace:not(.lessons-open) .right-column-stack > :last-child {
    height: auto;
  }

  .center-column:has(.public-reviews-preview) .public-reviews-scroll {
    max-height: 252px;
    flex: 0 1 auto;
    align-content: start;
    grid-auto-rows: max-content;
  }

  /* Invariant: all three desktop columns keep the same height. */
  .workspace:not(.lessons-open) {
    align-items: stretch;
  }

  .workspace:not(.lessons-open) .library-column,
  .workspace:not(.lessons-open) .center-column,
  .workspace:not(.lessons-open) .right-column-stack {
    align-self: stretch;
    height: 100%;
  }

  .workspace:not(.lessons-open) .right-column-stack {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
  }

  .workspace:not(.lessons-open) .right-column-stack > :last-child {
    height: 100%;
  }

  .center-column:has(.public-reviews-preview) .public-reviews-scroll {
    max-height: none;
    flex: 1;
    align-content: start;
    grid-auto-rows: max-content;
  }
}

@media (max-width: 560px) {
  .shadowing-method { gap: 3px; padding: 8px 10px; }
  .shadowing-method > div { flex-wrap: wrap; gap: 2px 0.35em; white-space: normal; }
  .public-reviews-preview { padding: 13px; }
  .public-reviews-preview > header { align-items: flex-start; }
  .public-reviews-preview h2 { font-size: 20px; }
  .public-reviews-preview header > span { display: none; }
  .public-review-meta { flex-wrap: wrap; }
  .public-review-meta em { width: 100%; margin-left: 0; }
}

@media (max-width: 820px) {
  .mobile-screen-player .shadowing-method { margin-bottom: 10px; }
}

.lesson-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-color: rgba(74, 167, 240, 0.68);
}

.lesson-hero img {
  width: 180px;
  height: 116px;
  object-fit: cover;
  border-radius: 6px;
}

.lesson-hero span {
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
}

.lesson-hero h2 {
  margin: 6px 0;
  color: #252f43;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
  font-weight: 650;
}

.lesson-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.practice-board,
.content-board {
  padding: 20px;
}

.practice-board {
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head span {
  color: var(--blue);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
}

.section-head strong {
  color: #62718a;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.progress-line {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(103, 116, 142, 0.12);
}

.progress-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

/* Player canvas, intro scroll, and end screen */
.player-canvas {
  width: 100%;
  min-height: 460px;
  height: 460px;
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  align-items: stretch;
  gap: 14px;
}

.start-board {
  min-height: 520px;
}

.start-player-canvas {
  height: 520px;
  min-height: 520px;
  grid-template-rows: 1fr;
  place-items: center;
}

.player-start-brand {
  width: min(92%, 520px);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.player-start-brand img {
  width: min(96%, 460px);
  max-height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(72, 57, 118, 0.12));
}

.player-start-brand strong {
  color: #6750a4;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  font-weight: 800;
}

.lesson-intro-stage,
.lesson-intro-scroll {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  display: block;
  justify-self: center;
  overflow: hidden;
  padding: 0;
}

.lesson-intro-stage {
  isolation: isolate;
}

.lesson-intro-scroll {
  filter: drop-shadow(0 16px 22px rgba(55, 43, 30, 0.16));
}

.lesson-intro-scroll-opening {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scaleX(0.05);
  transform-origin: center;
  animation: lesson-scroll-open 1900ms cubic-bezier(0.16, 0.72, 0.14, 1) 1160ms forwards;
}

.lesson-intro-scroll-opened {
  opacity: 1;
  transform: scaleX(1);
}

.closed-scroll-throw {
  position: absolute;
  z-index: 3;
  left: calc(91% - 12px);
  top: calc(9.3% + 12px);
  width: 18%;
  height: 30%;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.1) rotate(0deg);
  transform-origin: center;
  filter: drop-shadow(0 8px 10px rgba(55, 43, 30, 0.22));
  will-change: left, top, transform, opacity;
  animation: closed-scroll-throw 1100ms ease-in-out 60ms forwards;
}

.scroll-sheet {
  position: relative;
  z-index: 2;
  min-width: 0;
  height: 100%;
  min-height: inherit;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.scroll-sheet img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  mix-blend-mode: normal;
  opacity: 1;
  filter: none;
}

.scroll-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.scroll-art {
  position: absolute;
  z-index: 2;
  inset: 7.2% 12.8% 8.6% 15.2%;
  width: 72% !important;
  height: 84.2% !important;
  max-width: 72%;
  max-height: 84.2%;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.91;
  filter: contrast(1.03) brightness(1.04);
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.45) 2.5%, #000 6.5%, #000 93.5%, rgba(0, 0, 0, 0.45) 97.5%, transparent 100%),
    linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.45) 3%, #000 7%, #000 92%, rgba(0, 0, 0, 0.45) 97%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.45) 2.5%, #000 6.5%, #000 93.5%, rgba(0, 0, 0, 0.45) 97.5%, transparent 100%),
    linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.45) 3%, #000 7%, #000 92%, rgba(0, 0, 0, 0.45) 97%, transparent 100%);
  mask-composite: intersect;
}

.scroll-rod {
  display: none;
}

.lesson-end-scroll {
  opacity: 0;
  transform: scaleX(1);
  transform-origin: center;
  animation: lesson-end-fade-in 700ms ease-out forwards;
}

.lesson-end-stage.closing .lesson-end-scroll {
  animation: lesson-scroll-close-exact 1900ms cubic-bezier(0.86, 0, 0.84, 0.28) forwards;
}

.closed-scroll-return {
  position: absolute;
  z-index: 4;
  left: calc(91% - 12px);
  top: calc(9.3% + 12px);
  width: 18%;
  height: 30%;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.1) rotate(0deg);
  filter: drop-shadow(0 8px 10px rgba(55, 43, 30, 0.22));
  pointer-events: none;
}

.lesson-end-stage.closing .closed-scroll-return {
  animation: closed-scroll-throw 1100ms ease-in-out 1900ms reverse forwards;
}

/* End-of-lesson text overlay */
.scroll-art-end {
  filter: blur(1.4px) saturate(0.72) brightness(1.12);
  opacity: 0.3;
}

.end-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.end-overlay strong,
.end-overlay em {
  position: relative;
  z-index: 1;
}

.end-overlay strong {
  color: #23324a;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1;
  font-weight: 600;
  text-shadow:
    0 2px 0 #ffffff,
    2px 0 0 #ffffff,
    0 -2px 0 #ffffff,
    -2px 0 0 #ffffff,
    0 8px 12px rgba(20, 32, 52, 0.22);
}

.end-overlay em {
  color: #23324a;
  font-size: clamp(14px, 2vw, 22px);
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 #ffffff,
    1px 0 0 #ffffff,
    0 -1px 0 #ffffff,
    -1px 0 0 #ffffff,
    0 4px 8px rgba(20, 32, 52, 0.18);
}

.intro-actions {
  display: flex;
  justify-content: center;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.mobile-intro-brand {
  display: none;
}

.start-lesson-btn {
  min-width: 96px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 2px rgba(74, 167, 240, 0.08);
}

@keyframes lesson-end-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lesson-scroll-open {
  from {
    opacity: 1;
    transform: scaleX(0.05);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes lesson-scroll-close-exact {
  0% {
    opacity: 1;
    transform: scaleX(1);
  }
  99.9% {
    opacity: 1;
    transform: scaleX(0.05);
  }
  100% {
    opacity: 0;
    transform: scaleX(0.05);
  }
}

@keyframes closed-scroll-throw {
  0% {
    left: calc(91% - 12px);
    top: calc(9.3% + 12px);
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.1) rotate(0deg);
  }

  99.9% {
    left: 50%;
    top: 50%;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5) rotate(720deg);
  }

  100% {
    left: 50%;
    top: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5) rotate(720deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .closed-scroll-throw {
    display: none;
    animation: none;
  }

  .lesson-intro-scroll-opening {
    opacity: 1;
    transform: none;
    animation: none;
  }
}


.sentence-stage {
  min-height: 0;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 18px 16px 10px;
  grid-auto-rows: min-content;
  text-align: center;
}

.sentence-stage h3 {
  max-width: 760px;
  min-height: 0;
  margin: 0;
  color: #1f2937;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(24px, 3.2vw, 42px);
  line-height: 1.18;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-wrap: balance;
  transition: color 400ms ease;
}

.sentence-stage.score-weak h3  { color: var(--red); }
.sentence-stage.score-ok h3    { color: var(--gold); }
.sentence-stage.score-great h3 { color: var(--green); }
.mic-live-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; color: #a43d35; background: #fff0ed; font-size: 13px; font-weight: 850; animation: mic-live-pulse 1.1s ease-in-out infinite; }
.mic-live-indicator svg { width: 18px; height: 18px; }
@keyframes mic-live-pulse { 50% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(215,91,78,.09); } }

.sentence-stage p {
  max-width: 760px;
  min-height: 0;
  margin: 0;
  color: #6d7b93;
  font-size: clamp(16px, 1.8vw, 24px);
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.sentence-translation {
  max-width: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

.sentence-translation.is-hidden {
  min-height: 0;
}

.translation-toggle {
  flex: 0 0 190px;
  width: 190px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 11px;
  box-sizing: border-box;
  border: 1px solid rgba(103, 80, 164, 0.22);
  border-radius: 999px;
  color: #6750a4;
  background: rgba(247, 243, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.translation-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.translation-toggle[aria-pressed="true"] {
  border-color: rgba(74, 167, 240, 0.34);
  color: #397faf;
  background: rgba(238, 248, 255, 0.94);
}

.translation-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(79, 99, 140, 0.12);
}

.translation-toggle:focus-visible {
  outline: 3px solid rgba(103, 80, 164, 0.22);
  outline-offset: 2px;
}

.sentence-stage .error {
  color: var(--red);
  font-size: 16px;
}

/* Player buttons and setting groups */
.player-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
}

.round-btn,
.play-btn,
.soft-btn,
.record-btn,
.check-btn,
.pause-row button,
.voice-row button,
.speed-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(103, 116, 142, 0.24);
  border-radius: 999px;
  color: var(--chalk);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.88);
}

.round-btn {
  width: 31px;
  height: 31px;
  font-size: 14px;
}

.play-btn {
  width: 42px;
  height: 42px;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 18px;
  box-shadow: 0 0 0 3px rgba(74, 167, 240, 0.1);
}

.round-btn:hover,
.play-btn:hover,
.soft-btn:hover,
.record-btn:hover,
.check-btn:hover,
.pause-row button:hover,
.voice-row button:hover,
.speed-row button:hover,
.store-link:hover,
.transcript-panel button:hover,
.side-lesson-card:hover,
.drawer-card:hover,
.preview-open:hover,
.preview-close:hover,
.drawer-close:hover,
.level-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(79, 99, 140, 0.12);
}

.round-btn:active,
.play-btn:active,
.soft-btn:active,
.record-btn:active,
.check-btn:active,
.pause-row button:active,
.voice-row button:active,
.speed-row button:active,
.store-link:active,
.transcript-panel button:active,
.side-lesson-card:active,
.drawer-card:active,
.preview-open:active,
.preview-close:active,
.drawer-close:active,
.level-row:active {
  transform: scale(0.96);
  box-shadow: inset 0 3px 10px rgba(31, 41, 55, 0.12);
}

.round-btn:focus-visible,
.play-btn:focus-visible,
.soft-btn:focus-visible,
.record-btn:focus-visible,
.check-btn:focus-visible,
.pause-row button:focus-visible,
.voice-row button:focus-visible,
.speed-row button:focus-visible,
.store-link:focus-visible,
.transcript-panel button:focus-visible,
.side-lesson-card:focus-visible,
.drawer-card:focus-visible,
.preview-open:focus-visible,
.preview-close:focus-visible,
.drawer-close:focus-visible,
.level-row:focus-visible {
  outline: 3px solid rgba(74, 167, 240, 0.28);
  outline-offset: 2px;
}

.play-btn.playing {
  background: #d75b4e;
  color: #ffffff;
  box-shadow:
    0 0 0 3px rgba(215, 91, 78, 0.16),
    0 8px 18px rgba(215, 91, 78, 0.22);
  transform: scale(1.02);
  border-color: #d75b4e;
}

.play-btn.playing svg {
  display: none;
}

.play-btn.playing::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: currentColor;
}

.controls-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding-top: 0;
  border-top: 0;
}

.player-options-row {
  width: min(100%, 680px);
  display: grid;
  grid-template-columns: repeat(3, max-content);
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.speed-row,
.voice-row,
.pause-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 0;
  padding: 7px 9px;
  border: 1px solid rgba(103, 116, 142, 0.14);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.78);
}

.player-option-label {
  margin-right: 3px;
  color: #6d7b93;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.speed-row button {
  min-width: 39px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
}

.speed-row button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.voice-row button {
  min-width: 51px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  color: #5f6f89;
}

.voice-row button.active {
  border-color: #8e55d8;
  color: #8e55d8;
  background: rgba(142, 85, 216, 0.08);
}

.pause-row {
  margin-left: 0;
}

.pause-row button {
  min-width: 29px;
  height: 22px;
  padding: 0 5px;
  font-size: 10px;
  color: #5f6f89;
}

.pause-row button.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(136, 189, 91, 0.1);
}

/* Transcript, recording, and assessment panels */
.transcript-board {
  border-color: rgba(103, 116, 142, 0.2);
}

.transcript-panel {
  max-height: 440px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 6px;
  scrollbar-color: var(--blue) transparent;
}

.transcript-panel button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 5px 12px;
  padding: 12px;
  border: 1px dashed rgba(103, 116, 142, 0.18);
  border-radius: 8px;
  text-align: left;
}

.transcript-panel button.active {
  border-color: var(--accent);
  background: rgba(74, 167, 240, 0.07);
}

.transcript-panel b {
  grid-row: span 2;
  color: var(--accent);
}

.transcript-panel span {
  color: #1f2937;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.3;
}

.transcript-panel em {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  line-height: 1.35;
}

.transcript-board.translations-hidden .transcript-panel em {
  display: none;
}

.transcript-board.translations-hidden .transcript-panel b {
  grid-row: auto;
}

.transcript-board.translations-hidden .transcript-panel button {
  align-items: center;
}

.recording-board p {
  margin: 0 0 14px;
  color: #63718a;
  font-size: 16px;
  line-height: 1.45;
}

.recording-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.record-btn,
.soft-btn,
.check-btn {
  min-height: 44px;
  padding: 0 16px;
}

.record-btn {
  border-color: var(--green);
  color: var(--green);
}

.record-btn.recording {
  border-color: var(--red);
  color: var(--red);
  animation: pulse 900ms infinite alternate;
}

.check-btn.checking {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 900ms infinite alternate;
  cursor: not-allowed;
}

.result-info {
  display: grid;
  gap: 6px;
}

.result-card .recognized-text {
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 14px;
  font-weight: 700;
  color: #253b63;
  opacity: 1;
  font-style: italic;
  word-break: break-word;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}

.assessment-grid {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.assessment-board {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.section-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.block-info-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 2px solid #49a4e8;
  border-radius: 50%;
  background: #fff;
  color: #318fd5;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(39, 87, 130, .12);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.block-info-button:hover,
.block-info-button[aria-expanded="true"] {
  transform: translateY(-1px);
  background: #49a4e8;
  color: #fff;
}

.block-info-button:focus-visible {
  outline: 3px solid rgba(73, 164, 232, .25);
  outline-offset: 2px;
}

.block-help-sheet {
  position: absolute;
  z-index: 8;
  inset: 0 0 0 auto;
  width: min(390px, 88%);
  overflow: auto;
  padding: 18px 20px;
  border-left: 2px solid rgba(73, 164, 232, .42);
  border-radius: 18px 0 0 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(73,164,232,.13), transparent 42%),
    linear-gradient(135deg, #ffffff, #f3f9fe);
  color: #253b63;
  box-shadow: -12px 0 30px rgba(49, 143, 213, .18);
  opacity: 0;
  transform: translateX(104%);
  pointer-events: none;
  transition: transform .32s cubic-bezier(.22,.8,.24,1), opacity .2s ease;
}

.block-help-sheet.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.block-help-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.block-help-sheet-head strong {
  color: #318fd5;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 19px;
}

.block-help-sheet-head button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(49, 143, 213, .1);
  color: #318fd5;
  cursor: pointer;
}

.block-help-sheet-head svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.block-help-sheet p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.check-btn {
  flex-direction: column;
  gap: 3px;
  min-height: 78px;
  padding: 10px 14px;
  border-radius: 12px;
  border-color: var(--gold);
  color: var(--gold);
  font-size: 15px;
}

.assessment-board.score-great { --speech-score: #4caf50; --speech-score-soft: rgba(76,175,80,.14); }
.assessment-board.score-ok { --speech-score: #ff9800; --speech-score-soft: rgba(255,152,0,.14); }
.assessment-board.score-weak { --speech-score: #f44336; --speech-score-soft: rgba(244,67,54,.14); }
.assessment-board.score-level-1 { --speech-score:#df493f;--speech-score-soft:rgba(223,73,63,.13); }
.assessment-board.score-level-2 { --speech-score:#ed6b35;--speech-score-soft:rgba(237,107,53,.13); }
.assessment-board.score-level-3 { --speech-score:#f39a18;--speech-score-soft:rgba(243,154,24,.14); }
.assessment-board.score-level-4 { --speech-score:#d6bc2d;--speech-score-soft:rgba(214,188,45,.15); }
.assessment-board.score-level-5 { --speech-score:#ffc400;--speech-score-soft:rgba(255,196,0,.24); }
.assessment-board[class*="score-level-"] .star-on { fill:var(--speech-score);filter:drop-shadow(0 0 5px var(--speech-score-soft)); }
.assessment-board.score-level-5 .star-on { filter:drop-shadow(0 0 6px rgba(255,196,0,.58)); }

.btn-stars {
  display: flex;
  gap: 3px;
  font-size: 18px;
  line-height: 1;
}

.star { flex-shrink: 0; }

.star-on {
  fill: var(--gold);
  filter: drop-shadow(0 0 3px rgba(220, 165, 54, 0.55));
}

.star-off {
  fill: rgba(103, 116, 142, 0.18);
}

.stars-listening .star-off {
  animation: star-breathe 1.2s ease-in-out infinite alternate;
}

@keyframes star-breathe {
  from { fill: rgba(103, 116, 142, 0.12); }
  to   { fill: rgba(220, 165, 54, 0.28); }
}

.status-weak  { color: var(--red)   !important; }
.status-ok    { color: var(--gold)  !important; }
.status-great { color: var(--green) !important; }

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.result-card.score-great,.result-card.score-ok,.result-card.score-weak { border-style: solid; border-color: var(--speech-score); background: var(--speech-score-soft); }

.speech-accuracy-head { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:7px;color:#526078;font-size:11px;font-weight:800; }
.speech-accuracy-head b { color:var(--speech-score);font-size:12px; }
.speech-accuracy-bar { height:6px;overflow:hidden;margin-top:4px;border-radius:99px;background:rgba(103,116,142,.15); }
.speech-accuracy-bar i { display:block;height:100%;border-radius:inherit;background:var(--speech-score);transition:width .35s ease; }

.result-card p {
  margin: 0;
  color: #63718a;
  font-size: 14px;
  line-height: 1.4;
}

.premium-column {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 14px;
  border-color: rgba(103, 116, 142, 0.18);
}

#plans,
#plans .price-card > span,
#plans .price-card .price-amount,
#plans .price-card .price-currency,
#plans .price-card em,
#plans .payment-preparation,
#plans .checks {
  font-family: "Segoe UI Variable Display", "Segoe UI", "Trebuchet MS", sans-serif;
}

.premium-title {
  justify-self: center;
  transform: rotate(1deg);
}

.price-card {
  min-height: 148px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.price-card.green { color: var(--green); }
.price-card.gold { color: var(--gold); }
.price-card.red { color: var(--red); }

.price-card > span {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.price-card strong {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.16em;
  font-size: 52px;
  line-height: 1;
}

.price-card .price-amount {
  font: inherit;
  line-height: inherit;
}

.price-card .price-currency {
  font-size: 0.32em;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.68;
}

.price-card em {
  color: var(--chalk);
  font-size: 16px;
  font-style: normal;
}

.checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #63718a;
  font-size: 15px;
  line-height: 1.35;
}

.checks li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
}

.checks li::before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
}

/* Download links, lesson drawer, and preview dialog */
.download-bar {
  max-width: 980px;
  margin: 14px auto 0;
  padding: 8px 12px;
  text-align: center;
}

.download-bar h2 {
  margin: 0 0 6px;
  color: var(--blue);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.store-link {
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(103, 116, 142, 0.2);
  border-radius: 8px;
  color: var(--chalk);
  text-align: left;
  text-decoration: none;
}

.store-link.android { border-color: rgba(136, 189, 91, 0.72); }
.store-link.web { border-color: rgba(74, 167, 240, 0.72); }

.store-link img {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.store-link span {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
}

.store-link strong {
  align-self: start;
  font-size: 18px;
  line-height: 1.1;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: transparent;
}

.lesson-drawer {
  position: fixed;
  left: 22px;
  top: 178px;
  bottom: auto;
  z-index: 21;
  width: min(60vw, 920px);
  min-width: 640px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
  max-height: 430px;
  border: 2px solid var(--drawer-accent);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(243, 248, 255, 0.97)),
    var(--panel-strong);
  box-shadow: 0 24px 70px rgba(71, 85, 105, 0.24);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.drawer-head span {
  color: var(--drawer-accent);
  font-weight: 900;
  text-transform: uppercase;
}

.drawer-head h2 {
  margin: 6px 0;
  color: #252f43;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.drawer-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.drawer-close {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 116, 142, 0.24);
  border-radius: 999px;
  color: var(--chalk);
  font-size: 24px;
}

.drawer-lessons {
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(170px, 17vw, 230px);
  gap: 14px;
  align-content: start;
  padding: 4px 8px 18px 0;
  scrollbar-color: var(--drawer-accent) transparent;
}

.drawer-card {
  min-height: 300px;
  display: grid;
  grid-template-rows: 128px auto 1fr auto auto;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(103, 116, 142, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.drawer-card.active {
  border-color: var(--drawer-accent);
  box-shadow: inset 0 0 0 1px var(--drawer-accent);
}

.drawer-card img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(238, 244, 255, 0.85), rgba(255, 255, 255, 0.3));
}

.drawer-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--drawer-accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.drawer-card strong {
  color: #252f43;
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
}

.drawer-card em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

.drawer-card-main > i {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid var(--drawer-accent);
  border-radius: 999px;
  color: var(--drawer-accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(30, 41, 59, 0.26);
  backdrop-filter: blur(3px);
}

.lesson-preview {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 31;
  width: min(76vw, 980px);
  max-height: min(86vh, 760px);
  display: grid;
  grid-template-columns: minmax(300px, 48%) minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  border: 2px solid var(--preview-accent);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.98)),
    var(--panel-strong);
  box-shadow: 0 28px 90px rgba(71, 85, 105, 0.34);
  transform: translate(-50%, -50%);
}

.lesson-preview > img {
  width: 100%;
  height: min(58vh, 520px);
  object-fit: cover;
  border-radius: 8px;
}

.preview-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 116, 142, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--chalk);
  font-size: 22px;
}

.preview-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 22px 14px 22px 0;
}

.preview-copy > span {
  color: var(--preview-accent);
  font-weight: 900;
  text-transform: uppercase;
}

.preview-copy h2 {
  margin: 0;
  color: #252f43;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
}

.preview-copy p {
  margin: 0;
  color: #63718a;
  font-size: 18px;
  line-height: 1.5;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-meta b {
  padding: 9px 12px;
  border: 1px solid rgba(103, 116, 142, 0.2);
  border-radius: 999px;
  color: #63718a;
  font-size: 14px;
}

.preview-features {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #4e5d74;
  font-size: 16px;
  line-height: 1.35;
}

.preview-features li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
}

.preview-features li::before {
  content: "✓";
  color: var(--preview-accent);
  font-weight: 900;
}

.preview-open {
  width: fit-content;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 2px solid var(--preview-accent);
  border-radius: 999px;
  color: var(--preview-accent);
  font-size: 16px;
  font-weight: 900;
}

/* Tablet layout */
@media (max-width: 820px) {
  .top-brand {
    grid-template-columns: 128px 1fr;
    min-height: 0;
  }

  .workspace {
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  }

  .premium-column {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .premium-title,
  .checks {
    grid-column: 1 / -1;
  }

  .right-column-stack {
    position: static;
    top: auto;
    grid-column: 1 / -1;
  }

  .right-column-stack .store-download-preview {
    width: min(290px, 100%);
    justify-self: end;
  }

  .lesson-drawer {
    width: 72vw;
    min-width: 0;
    left: 14px;
    top: 190px;
  }

  .player-canvas {
    min-height: 0;
    height: 400px;
  }

  .player-options-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
  }

  .speed-row,
  .voice-row,
  .pause-row {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile layout */
@media (max-width: 820px) {
  .chalk-app {
    padding: 12px;
  }

  .top-brand {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }

  .brand-mark {
    width: 122px;
    height: 99px;
    padding: 4px;
  }

  .brand-mark img {
    width: 100%;
    height: 100%;
  }

  .workspace,
  .premium-column,
  .download-actions {
    grid-template-columns: 1fr;
  }

  .workspace {
    gap: 10px;
  }

  .right-column-stack {
    display: none !important;
  }

  .library-column,
  .premium-column {
    position: static;
  }

  .library-column,
  .center-column,
  .premium-column,
  .practice-board,
  .content-board,
  .download-bar {
    border-radius: 6px;
  }

  .library-column,
  .premium-column,
  .center-column {
    padding: 12px;
  }

  .center-column {
    gap: 10px;
    order: 3;
  }

  .library-column {
    order: 1;
  }

  .lesson-side-list {
    order: 2;
  }

  .premium-column:not(.lesson-side-list) {
    order: 4;
  }

  .level-note,
  .download-bar,
  .checks,
  .premium-title {
    display: none;
  }

  .level-list {
    gap: 6px;
  }

  .level-row {
    grid-template-columns: 44px 1fr;
    gap: 10px;
    padding: 10px 0;
  }

  .level-row b {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .level-row strong {
    font-size: 17px;
  }

  .level-row em {
    font-size: 12px;
  }

  .lesson-hero {
    grid-template-columns: 1fr;
  }

  .lesson-hero img {
    width: 100%;
    height: 170px;
  }

  .section-head,
  .assessment-grid {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .section-head {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
  }

  .section-head span {
    font-size: 19px;
  }

  .section-head strong {
    font-size: 13px;
  }

  .sentence-stage {
    min-height: 170px;
    padding: 8px 4px 4px;
  }

  .sentence-stage h3 {
    font-size: clamp(21px, 6vw, 29px);
  }

  .sentence-stage p {
    font-size: 15px;
  }

  .player-canvas {
    min-height: 0;
    height: auto;
    grid-template-rows: minmax(180px, auto) auto;
    gap: 10px;
  }

  .practice-board,
  .content-board {
    padding: 14px;
  }

  .player-options-row {
    width: 100%;
    grid-template-columns: 1fr;
    justify-content: center;
    gap: 8px;
  }

  .speed-row,
  .voice-row,
  .pause-row {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .speed-row,
  .voice-row,
  .pause-row {
    gap: 5px;
  }

  .speed-row button,
  .voice-row button,
  .pause-row button {
    min-width: 0;
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
  }

  .voice-row button {
    min-width: 58px;
  }

  .speed-row button {
    min-width: 42px;
  }

  .pause-row button {
    min-width: 30px;
  }

  .lesson-intro-scroll {
    min-height: 0;
  }

  .play-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .round-btn {
    width: 29px;
    height: 29px;
    font-size: 13px;
  }

  .transcript-panel {
    max-height: min(680px, 10 * 68px);
    overflow-y: auto;
    padding-right: 0;
  }

  .transcript-panel button {
    padding: 10px;
    gap: 4px 10px;
  }

  .transcript-panel span {
    font-size: 15px;
  }

  .transcript-panel em {
    font-size: 13px;
  }

  .recording-actions {
    gap: 8px;
  }

  .record-btn,
  .soft-btn,
  .check-btn {
    width: 100%;
    min-height: 40px;
    justify-content: center;
  }

  .check-btn {
    min-height: 68px;
    font-size: 14px;
    border-radius: 10px;
  }

  .result-card {
    gap: 8px;
    padding: 8px 10px;
  }

  .lesson-side-list .side-lessons {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 76vw);
    gap: 10px;
    padding: 2px 2px 8px 0;
  }

  .lesson-side-list .side-lesson-card {
    grid-template-rows: 120px auto auto;
    gap: 8px;
    padding: 10px;
  }

  .lesson-side-list .side-lesson-card img {
    height: 120px;
  }

  .center-column > .practice-board {
    order: 1;
  }

  .center-column > .recording-board {
    order: 2;
  }

  .center-column > .assessment-board {
    order: 3;
  }

  .center-column > .transcript-board {
    order: 4;
  }

  .lesson-drawer {
    width: calc(100vw - 28px);
    min-width: 0;
    left: 14px;
    top: 150px;
    max-height: 430px;
    padding: 18px;
  }

  .drawer-lessons {
    grid-auto-columns: minmax(210px, 72vw);
  }

  .drawer-card {
    min-height: auto;
  }

  .lesson-preview {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    grid-template-columns: 1fr;
  }

  .lesson-preview > img {
    height: 260px;
  }

  .preview-copy {
    padding: 0;
  }
}

/* Native-language selection and persistent switcher */
.language-switcher {
  min-width: 104px;
  width: 110px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(103, 116, 142, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 16px rgba(54, 69, 96, 0.08);
}

.language-switcher select {
  min-width: 0;
  width: 100%;
  padding-right: 4px;
  border: 0;
  color: #33415c;
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
}

.language-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 27, 43, 0.72);
  backdrop-filter: blur(8px);
}

.language-dialog {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow-y: auto;
  padding: clamp(22px, 4vw, 38px);
  border: 2px solid rgba(103, 80, 164, 0.28);
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 28px 90px rgba(13, 20, 36, 0.34);
  text-align: center;
}

.language-dialog h2 {
  margin: 0;
  color: #2d3850;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1.18;
}

.language-dialog h2 span {
  color: #6750a4;
  font-size: 0.68em;
}

.language-dialog > p {
  margin: 12px auto 22px;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.language-choice {
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(103, 116, 142, 0.2);
  border-radius: 12px;
  color: #33415c;
  background: #fff;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.language-choice:hover,
.language-choice:focus-visible {
  transform: translateY(-2px);
  border-color: #6750a4;
  box-shadow: 0 8px 20px rgba(103, 80, 164, 0.14);
}

.language-choice > span { font-size: 27px; }
.language-choice strong { font-size: 16px; }
@media (min-width: 821px) {
  .top-brand { grid-template-columns: 136px minmax(280px, 1fr) auto; }
}

@media (max-width: 820px) {
  .language-switcher { grid-column: 2; grid-row: 1; justify-self: end; }
}

@media (max-width: 820px) {
  .language-switcher { grid-column: 1; grid-row: auto; justify-self: stretch; width: 100%; }
  .language-grid { grid-template-columns: 1fr; }
  .language-choice { min-height: 56px; }
}
/* Android-style lesson cards and three-pass wax stamps */
.lesson-drawer {
  top: 118px;
  bottom: 22px;
  width: min(48vw, 680px);
  min-width: 520px;
  max-height: none;
  border-radius: 18px;
}

.drawer-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.progress-reset,
.drawer-close {
  flex: 0 0 46px;
}

.progress-reset {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 116, 142, 0.24);
  border-radius: 999px;
  color: var(--drawer-accent);
  background: rgba(255, 255, 255, 0.74);
  font-size: 25px;
  font-weight: 900;
}

.level-progress {
  width: min(340px, 100%);
  height: 6px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--drawer-accent) 14%, #fff);
}

.level-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--drawer-accent);
  transition: width 280ms ease;
}

.drawer-head small {
  display: block;
  margin-top: 4px;
  color: var(--drawer-accent);
  font-weight: 900;
}

.drawer-lessons {
  overflow-x: hidden;
  overflow-y: auto;
  grid-auto-flow: row;
  grid-auto-columns: unset;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 4px 8px 18px 0;
}

.drawer-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 12px rgba(55, 65, 86, 0.08);
}

.drawer-card.completed {
  border-color: color-mix(in srgb, var(--drawer-accent) 64%, #d8c9bb);
}

.drawer-card-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 6px;
  padding-bottom: 12px;
}

.drawer-card .drawer-card-main img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 16px 0 0 0;
  border-bottom: 1px solid rgba(217, 205, 191, 0.95);
  background: rgba(255, 255, 255, 0.72);
}

.drawer-card-main > span,
.drawer-card-main > strong,
.drawer-card-main > em,
.drawer-card-main > i {
  margin-left: 12px;
  margin-right: 12px;
}

.lesson-stamp-strip {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 6px;
  padding: 8px;
  border-left: 1px solid rgba(232, 216, 200, 0.9);
  background: linear-gradient(180deg, #fffbf5, color-mix(in srgb, var(--drawer-accent, var(--side-accent, var(--blue))) 5%, #fffaf3), #fff8ef);
}

.wax-stamp {
  position: relative;
  width: 50px;
  height: 58px;
  display: grid;
  place-items: start center;
  color: #9f8f80;
  isolation: isolate;
}

.wax-stamp::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 2px;
  left: 8px;
  width: 34px;
  height: 34px;
  border: 2px solid #b8a895;
  border-radius: 46% 54% 48% 52% / 53% 45% 55% 47%;
  background: #e9ded2;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35);
  transform: rotate(-3deg);
}

.wax-stamp::after {
  content: "";
  position: absolute;
  z-index: -2;
  top: 22px;
  left: 12px;
  width: 26px;
  height: 34px;
  background: #d8cabb;
  clip-path: polygon(0 0, 43% 0, 43% 100%, 22% 82%, 0 100%, 0 0, 57% 0, 100% 0, 100% 100%, 78% 82%, 57% 100%, 57% 0);
  opacity: 0.55;
}

.wax-stamp.filled { color: #fff; }
.wax-stamp.filled::before {
  border-color: color-mix(in srgb, var(--drawer-accent, var(--side-accent, var(--blue))) 92%, #4a3427);
  background: var(--drawer-accent, var(--side-accent, var(--blue)));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.2), 0 3px 7px rgba(43, 37, 31, 0.2);
}
.wax-stamp.filled::after { background: var(--drawer-accent, var(--side-accent, var(--blue))); opacity: 0.72; }
.wax-stamp i { margin-top: 8px; font-size: 15px; font-style: normal; font-weight: 900; }
.wax-stamp b { margin-top: -2px; font-size: 6px; letter-spacing: 0.08em; }

.side-lesson-card {
  grid-template-columns: minmax(0, 1fr) 54px;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.side-card-main {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.side-lesson-card .lesson-stamp-strip { padding: 5px 2px; }
.side-lesson-card .wax-stamp { transform: scale(0.78); margin-block: -6px; }
.side-lesson-card img { height: 150px; }

@media (max-width: 820px) {
  .lesson-drawer {
    inset: 74px 8px 8px;
    width: auto;
    min-width: 0;
    max-height: none;
    padding: 14px;
  }
  .drawer-head h2 { font-size: 30px; }
  .drawer-head p { font-size: 14px; }
  .drawer-card { grid-template-columns: minmax(0, 1fr) 68px; }
  .lesson-stamp-strip { padding-inline: 4px; }
}
/* Fix vertical Lessons sizing after replacing the old horizontal carousel */
.lesson-drawer {
  height: calc(100dvh - 140px);
  min-height: 420px;
  overflow: hidden;
}

.drawer-lessons {
  min-height: 0;
  height: 100%;
  grid-auto-rows: max-content;
  align-content: start;
  overscroll-behavior: contain;
}

.drawer-card {
  width: 100%;
  height: auto;
  min-height: max-content;
  grid-template-rows: auto;
  align-self: start;
}

.drawer-card-main {
  height: auto;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
}

.drawer-card-main > strong,
.drawer-card-main > em {
  display: block;
  overflow: visible;
}

@media (max-width: 820px) {
  .lesson-drawer {
    height: auto;
    min-height: 0;
  }
}
/* Prevent the sticky right-side Lessons grid from shrinking its cards */
.lesson-side-list {
  align-self: start;
  max-height: calc(100dvh - 36px);
  overflow: hidden;
}

.lesson-side-list .side-lessons {
  min-height: 0;
  max-height: calc(100dvh - 130px);
  grid-auto-flow: row;
  grid-auto-rows: max-content;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
}

.lesson-side-list .side-lesson-card {
  width: 100%;
  height: auto;
  min-height: 252px;
  align-self: start;
}

.lesson-side-list .side-card-main {
  grid-template-rows: 150px auto auto;
  align-content: start;
}

.lesson-side-list .side-card-main img {
  width: 100%;
  height: 150px;
  min-height: 150px;
  object-fit: contain;
}

@media (max-width: 820px) {
  .lesson-side-list {
    max-height: none;
    overflow: visible;
  }
  .lesson-side-list .side-lessons {
    max-height: none;
    grid-auto-flow: column;
    grid-auto-rows: unset;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .lesson-side-list .side-lesson-card {
    min-height: 230px;
  }
}
/* Match the Android LessonImageCard proportions in the right-side Lessons list */
.lesson-side-list .side-lesson-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 78px;
  grid-template-rows: auto;
  border-radius: 16px;
}

.lesson-side-list .side-card-main {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.lesson-side-list .side-card-main img {
  grid-row: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 16px 0 0 0;
  border-bottom: 1px solid rgba(217, 205, 191, 0.95);
  background: rgba(255, 255, 255, 0.72);
}

.lesson-side-list .side-card-main strong {
  grid-row: 2;
  min-height: 70px;
  display: -webkit-box;
  align-content: center;
  padding: 8px 12px 24px;
  overflow: hidden;
  color: #252f43;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 17px;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lesson-side-list .side-card-main > span {
  position: absolute;
  left: 12px;
  bottom: 8px;
  color: var(--side-accent);
  font-size: 10px;
  line-height: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.lesson-side-list .side-card-main {
  position: relative;
}

.lesson-side-list .lesson-stamp-strip {
  width: 78px;
  min-width: 78px;
  padding: 8px;
  gap: 0;
}

.lesson-side-list .wax-stamp {
  width: 50px;
  height: 58px;
  margin: 0;
  transform: none;
}

@media (max-width: 820px) {
  .lesson-side-list .side-lesson-card {
    grid-template-columns: minmax(0, 1fr) 78px;
    min-height: 0;
  }
}

/* Exact web port of Android LessonImageCard and WaxLessonStamp */
.lesson-side-list .side-lesson-card {
  grid-template-columns: minmax(0, 78%) minmax(64px, 22%);
  border: 1px solid #d9cdbf;
  border-radius: 16px;
  background: #f2dfd5;
  box-shadow: 0 2px 5px rgba(55, 43, 30, 0.08);
}

.lesson-side-list .side-card-main {
  grid-template-rows: auto 70px;
  background: #f2dfd5;
}

.lesson-side-list .side-card-main img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 0;
  border-bottom: 1px solid #d9cdbf;
  border-radius: 15px 0 0 0;
  background: rgba(255, 255, 255, 0.72);
}

.lesson-side-list .side-card-main strong {
  min-height: 70px;
  padding: 9px 12px 25px;
  color: #211f20;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 17px;
  font-weight: 700;
}

.lesson-side-list .side-card-main > span {
  left: 12px;
  bottom: 8px;
  color: var(--side-accent);
  font-size: 10px;
  line-height: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.lesson-side-list .lesson-stamp-strip {
  width: 100%;
  min-width: 0;
  padding: 8px 4px;
  border-left: 1px solid rgba(232, 216, 200, 0.9);
  background: linear-gradient(180deg, #fffbf5, color-mix(in srgb, var(--side-accent) 4.5%, #fffaf3), #fff8ef);
}

.wax-stamp,
.side-lesson-card .wax-stamp,
.drawer-card .wax-stamp {
  width: 50px;
  height: 58px;
  display: block;
  flex: 0 0 58px;
  margin: 0;
  color: #b8a895;
  transform: none;
}

.wax-stamp::before,
.wax-stamp::after {
  display: none;
}

.wax-stamp svg {
  width: 50px;
  height: 58px;
  display: block;
  overflow: visible;
}

.wax-stamp .stamp-ribbon {
  fill: #e9ded2;
  fill-opacity: 0.34;
  stroke: #b8a895;
  stroke-opacity: 0.45;
  stroke-width: 1.1;
  stroke-linejoin: round;
}

.wax-stamp .stamp-seal {
  fill: #e9ded2;
  stroke: #b8a895;
  stroke-width: 1.4;
}

.wax-stamp .stamp-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1.2;
}

.wax-stamp .stamp-number,
.wax-stamp .stamp-word {
  fill: #9f8f80;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  text-anchor: middle;
  font-weight: 800;
}

.wax-stamp .stamp-number { font-size: 15px; }
.wax-stamp .stamp-word { font-size: 6px; letter-spacing: 0.6px; font-weight: 900; }

.wax-stamp.filled .stamp-ribbon {
  fill: var(--drawer-accent, var(--side-accent, var(--blue)));
  fill-opacity: 0.72;
  stroke: var(--drawer-accent, var(--side-accent, var(--blue)));
}

.wax-stamp.filled .stamp-seal {
  fill: var(--drawer-accent, var(--side-accent, var(--blue)));
  stroke: color-mix(in srgb, var(--drawer-accent, var(--side-accent, var(--blue))) 92%, #4a3427);
}

.wax-stamp.filled .stamp-ring { stroke: rgba(255, 255, 255, 0.23); }
.wax-stamp.filled .stamp-number,
.wax-stamp.filled .stamp-word { fill: #fff; }

@media (max-width: 820px) {
  .lesson-side-list .side-lesson-card {
    grid-template-columns: minmax(0, 78%) minmax(64px, 22%);
  }
}
/* Keep the caption secondary: no more than 25% of the 16:9 image height */
.lesson-side-list .side-card-main {
  grid-template-rows: auto auto;
}

.lesson-side-list .side-card-main strong {
  width: 100%;
  min-height: 0;
  aspect-ratio: 64 / 9;
  display: -webkit-box;
  align-content: center;
  padding: 5px 10px 14px;
  font-size: 11px;
  line-height: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lesson-side-list .side-card-main > span {
  left: 10px;
  bottom: 4px;
  font-size: 8px;
  line-height: 9px;
}

.wax-stamp,
.side-lesson-card .wax-stamp,
.drawer-card .wax-stamp {
  height: 53px;
  flex-basis: 53px;
}

.wax-stamp svg {
  height: 53px;
}
/* Bug fix: the stamp column must not stretch the caption grid row */
.lesson-side-list .side-card-main {
  container-type: inline-size;
  grid-template-rows: auto auto;
  align-content: start;
  align-self: start;
}

.lesson-side-list .side-card-main strong {
  box-sizing: border-box;
  width: 100%;
  height: 14.0625cqw;
  min-height: 30px;
  max-height: 42px;
  aspect-ratio: auto;
  align-content: center;
  padding: 3px 10px 11px;
  overflow: hidden;
  text-shadow: none;
}

.lesson-side-list .side-card-main > span {
  bottom: 2px;
  z-index: 2;
}

.lesson-side-list .lesson-stamp-strip {
  height: 100%;
  min-height: 0;
  align-self: stretch;
  justify-content: space-evenly;
}
/* Deterministic card geometry: image 80%, caption 20% (= 25% of image) */
.lesson-side-list .side-lesson-card {
  min-height: 0 !important;
  height: auto !important;
  grid-template-columns: minmax(0, 82%) minmax(64px, 18%);
  align-items: start;
}

.lesson-side-list .side-card-main {
  width: 100%;
  height: auto;
  aspect-ratio: 64 / 45;
  grid-template-rows: 80% 20%;
  align-content: normal;
  align-self: start;
}

.lesson-side-list .side-card-main img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}

.lesson-side-list .side-card-main strong {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  padding: 4px 10px 12px;
  align-content: center;
}

.lesson-side-list .lesson-stamp-strip {
  height: 100%;
  max-height: none;
  overflow: hidden;
}

@media (max-width: 820px) {
  .lesson-side-list .side-lesson-card {
    grid-template-columns: minmax(0, 82%) minmax(64px, 18%);
  }
}
/* Give Lessons the same visual priority as Android instead of squeezing it into 290px */
@media (min-width: 821px) {
  .workspace.lessons-open {
    grid-template-columns: minmax(230px, 290px) minmax(460px, 1fr) minmax(420px, 480px);
  }
}

.workspace.lessons-open .lesson-side-list .side-lesson-card {
  grid-template-columns: minmax(0, 85%) minmax(58px, 15%);
}

.workspace.lessons-open .lesson-side-list .lesson-stamp-strip {
  padding-inline: 3px;
}

.workspace.lessons-open .lesson-side-list .side-card-main strong {
  font-size: 14px;
  line-height: 17px;
  padding: 6px 12px 16px;
}

.workspace.lessons-open .lesson-side-list .side-card-main > span {
  left: 12px;
  bottom: 4px;
  font-size: 9px;
}


@media (max-width: 820px) {
  .workspace.lessons-open .lesson-side-list .side-lesson-card {
    grid-template-columns: minmax(0, 85%) minmax(58px, 15%);
  }
}
/* Lesson assets are 1536x1024 (3:2), so use their native ratio with no side bars */
.lesson-side-list .side-card-main {
  aspect-ratio: 6 / 5;
  grid-template-rows: 80% 20%;
}

.lesson-side-list .side-card-main img {
  aspect-ratio: 3 / 2;
  object-fit: contain;
}
/* Restore the exact Android WaxLessonStamp canvas size and ribbon geometry */
.wax-stamp,
.side-lesson-card .wax-stamp,
.drawer-card .wax-stamp {
  width: 50px;
  height: 58px;
  flex-basis: 58px;
  margin: 0;
  transform: none;
}

.wax-stamp svg {
  width: 50px;
  height: 58px;
}
/* Android Text overlays: number at 10dp, SPEAK at 30dp */
.wax-stamp {
  position: relative;
  font-family: Roboto, Arial, sans-serif;
}

.wax-stamp .stamp-number-label,
.wax-stamp .stamp-word-label {
  position: absolute;
  left: 0;
  width: 50px;
  margin: 0;
  padding: 0;
  color: #9f8f80;
  text-align: center;
  font-style: normal;
  pointer-events: none;
}

.wax-stamp .stamp-number-label {
  top: 10px;
  font-size: 15px;
  line-height: 18px;
  font-weight: 800;
}

.wax-stamp .stamp-word-label {
  top: 30px;
  font-size: 6px;
  line-height: 7px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

.wax-stamp.filled .stamp-number-label,
.wax-stamp.filled .stamp-word-label {
  color: #fff;
}
/* Narrower Lessons panel while preserving the card proportions */
@media (min-width: 821px) {
  .workspace.lessons-open {
    grid-template-columns: minmax(230px, 290px) minmax(520px, 1fr) minmax(350px, 390px);
  }
}

/* Lock stamps to the same fixed 50x58 cells used by Android */
.lesson-side-list .lesson-stamp-strip {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 58px);
  align-content: space-evenly;
  justify-items: center;
  align-items: start;
  gap: 0;
}

.lesson-side-list .wax-stamp {
  position: relative;
  inset: auto;
  width: 50px;
  height: 58px;
  min-width: 50px;
  min-height: 58px;
  margin: 0;
  padding: 0;
  transform: none;
  align-self: start;
  justify-self: center;
}

.lesson-side-list .wax-stamp svg {
  position: absolute;
  inset: 0;
  width: 50px;
  height: 58px;
  margin: 0;
}

.lesson-side-list .wax-stamp .stamp-number-label,
.lesson-side-list .wax-stamp .stamp-word-label {
  left: 0;
  right: auto;
  width: 50px;
  transform: none;
}
/* SPEAK belongs on the ribbons, below the wax seal */
.lesson-side-list .wax-stamp .stamp-word-label {
  top: 39px;
  line-height: 7px;
}
/* Long lesson titles: reserve a separate row for the lesson number */
.lesson-side-list .side-card-main {
  grid-template-rows: 80% 15% 5%;
}

.lesson-side-list .side-card-main strong,
.workspace.lessons-open .lesson-side-list .side-card-main strong {
  grid-row: 2;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 3px 10px 0;
  color: #211f20;
  font-size: 13px;
  line-height: 15px;
  font-weight: 500;
  -webkit-line-clamp: 2;
}

.lesson-side-list .side-card-main > span,
.workspace.lessons-open .lesson-side-list .side-card-main > span {
  position: static;
  grid-row: 3;
  align-self: center;
  width: 100%;
  padding: 0 10px 2px;
  color: var(--side-accent);
  font-size: 8px;
  line-height: 10px;
  font-weight: 800;
}
/* Android level-row content inside the existing web Levels block */
.level-row {
  grid-template-columns: 58px minmax(0, 1fr) 48px 30px;
  gap: 10px;
  padding-block: 10px;
}

.level-row .level-row-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.level-row .level-row-copy strong {
  overflow: hidden;
  color: var(--level);
  font-size: 16px;
  line-height: 19px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-row .level-row-copy em {
  color: #6d6685;
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
}

.level-progress-line,
.overall-progress-line {
  height: 4px;
  display: block;
  overflow: hidden;
  margin-top: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--level) 16%, #fff);
}

.level-progress-line i,
.overall-progress-line i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--level);
}

.level-progress-meta {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.level-progress-meta mark {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--level);
  background: color-mix(in srgb, var(--level) 10%, #fff);
  font-size: 11px;
  line-height: 14px;
  font-weight: 800;
}

.level-progress-meta small {
  color: #6d6685;
  font-size: 11px;
  font-weight: 700;
}

.level-arrow {
  width: 30px;
  height: 30px;
  display: grid !important;
  place-items: center;
  border-radius: 999px;
  color: #5b35a8;
  background: rgba(109, 66, 199, 0.1);
  font-size: 25px;
  line-height: 1;
  font-weight: 500;
}

.overall-progress-footer {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 38px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(90deg, #efe2ff, #f7f0ff, #fff6ea);
}

.homework-compact-shortcut {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  border: 1px solid rgba(73,164,232,.32);
  border-radius: 15px;
  color: #253b63;
  background: linear-gradient(135deg,#fff,#edf8ff);
  text-align: left;
  box-shadow: 0 4px 12px rgba(49,143,213,.08);
}

.homework-compact-shortcut:hover {
  background: #fff;
  box-shadow: 0 6px 14px rgba(49,143,213,.1);
}

.homework-compact-shortcut > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.homework-compact-shortcut strong {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.homework-compact-shortcut small {
  overflow: hidden;
  color: #718096;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homework-compact-shortcut .homework-shortcut-arrow {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin-right: 3%;
}

.homework-image-shortcut {
  position: relative;
  aspect-ratio: 4.72 / 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(49,143,213,.11);
}

.homework-image-shortcut::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 13%;
  right: 19%;
  bottom: 13%;
  left: 32%;
  background: linear-gradient(90deg, #f7fbff 0%, #f3f8fd 58%, #eef6fc 100%);
}

.homework-image-shortcut img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  transition: transform .2s ease;
}

.homework-banner-label {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 33%;
  width: 47%;
  overflow: hidden;
  color: #19366d;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(13px, 1.25vw, 19px);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.homework-image-shortcut:hover img {
  transform: scale(1.012);
}

.homework-compact-shortcut.homework-image-shortcut {
  height: 82px;
  min-height: 82px;
  max-height: 82px;
  aspect-ratio: auto;
  background: linear-gradient(90deg, #eaf6ff 0%, #dcefff 55%, #cfe8fb 100%);
}

.homework-compact-shortcut.homework-image-shortcut::before {
  inset: 0;
  background: linear-gradient(90deg, #eaf6ff 0%, #dcefff 55%, #cfe8fb 100%);
}

.homework-compact-shortcut.homework-image-shortcut > .homework-button-books {
  position: relative;
  z-index: 2;
  width: 31%;
  height: 100%;
  margin-left: 2.5%;
  padding: 4px 0;
  object-fit: contain;
  object-position: center;
}

.homework-selection-banner.homework-image-shortcut {
  background: linear-gradient(90deg, #eaf6ff 0%, #dcefff 55%, #cfe8fb 100%);
}

.homework-selection-banner.homework-image-shortcut::before {
  inset: 0;
  background: linear-gradient(90deg, #eaf6ff 0%, #dcefff 55%, #cfe8fb 100%);
}

.homework-selection-banner.homework-image-shortcut > .homework-button-books {
  position: relative;
  z-index: 2;
  width: 31%;
  height: 100%;
  margin-left: 2.5%;
  padding: 4px 0;
  object-fit: contain;
  object-position: center;
}

.homework-selection-banner .homework-banner-label {
  z-index: 3;
}

.homework-image-shortcut:focus-visible {
  outline: 3px solid rgba(73,164,232,.34);
  outline-offset: 2px;
}

.homework-selection-state {
  min-height: 560px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--homework-accent) 35%, #d9e6f4);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--homework-accent) 9%, transparent), transparent 42%),
    rgba(255,255,255,.88);
  box-shadow: 0 12px 30px rgba(51,72,106,.08);
}

.homework-selection-card {
  width: min(470px, 88%);
  display: grid;
  justify-items: center;
  gap: 18px;
  color: #53647f;
  text-align: center;
}

.homework-selection-banner {
  width: min(390px, 100%);
  box-shadow: 0 8px 22px rgba(49,143,213,.14);
}

.homework-selection-card h2 {
  margin: 0;
  color: #23395f;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.25;
}

.homework-selection-card p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.homework-selection-card p b {
  padding: 5px 9px;
  border: 1px solid var(--homework-accent);
  border-radius: 8px;
  color: var(--homework-accent);
}

.homework-selection-direction {
  color: var(--homework-accent);
  font-size: 34px;
  line-height: 1;
}

.lesson-return-state {
  min-height: 560px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--return-accent) 30%, #d9e6f4);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--return-accent) 10%, transparent), transparent 44%),
    rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(51,72,106,.08);
}

.lesson-return-card {
  width: min(570px, 90%);
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.lesson-return-brand {
  color: #6c4bb3;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 20px;
  font-weight: 800;
}

.lesson-return-card h2 {
  margin: 0;
  color: #22304c;
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1.15;
}

.lesson-return-card > p {
  max-width: 520px;
  margin: 0;
  color: #72809a;
  font-size: 16px;
  line-height: 1.5;
}

.lesson-return-location {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #31415f;
  font-size: 17px;
}

.lesson-return-location b {
  padding: 6px 10px;
  border: 1px solid var(--return-accent);
  border-radius: 8px;
  color: var(--return-accent);
}

.lesson-return-location span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-return-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.lesson-return-actions button {
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 13px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.lesson-return-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--return-accent);
  background: var(--return-accent);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--return-accent) 25%, transparent);
}

.lesson-return-primary svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.lesson-return-secondary {
  border: 1px solid #cddbeb;
  background: #fff;
  color: #53647f;
}

.overall-progress-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.overall-progress-copy strong {
  color: #5b35a8;
  font-size: 14px;
  font-weight: 800;
}

.overall-progress-copy small {
  color: #72658a;
  font-size: 10px;
  font-weight: 700;
}

.overall-progress-line {
  height: 5px;
  margin: 0;
  background: rgba(109, 66, 199, 0.16);
}

.overall-progress-line i { background: #6d42c7; }

.overall-progress-footer > b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #5b35a8;
  background: rgba(109, 66, 199, 0.12);
  font-size: 11px;
  font-weight: 800;
}

.overall-progress-footer > button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #5b35a8;
  background: rgba(109, 66, 199, 0.12);
  font-size: 20px;
}

@media (max-width: 360px) {
  .level-row { grid-template-columns: 52px minmax(0, 1fr) 42px 26px; gap: 6px; }
  .level-row b { width: 46px; height: 46px; }
}
/* Android level medals, while retaining the existing A1-C2 circles */
.level-row {
  grid-template-columns: 52px minmax(0, 1fr) 40px 44px 28px;
  gap: 6px;
}

.level-row b {
  width: 46px;
  height: 46px;
  font-size: 20px;
  background: color-mix(in srgb, var(--level) 13%, #fff);
}

.level-medal {
  width: 44px;
  height: 62px;
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.level-progress-meta {
  width: 40px;
}

.level-arrow {
  width: 28px;
  height: 28px;
}
/* Keep the original branded Android medals clearly visible */
.level-row {
  grid-template-columns: 52px minmax(0, 1fr) 40px 58px 28px;
}

.level-medal {
  width: 58px;
  height: 78px;
  max-width: none;
  display: block;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  visibility: visible;
  mix-blend-mode: normal;
  filter: none;
}
/* Transparent medals and geometrically centered arrow icons */
.level-medal {
  background: transparent;
}

.level-arrow {
  padding: 0;
  overflow: hidden;
}

.level-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Fit the long B2 name without changing the other level labels */
.level-row:nth-child(4) .level-row-copy strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 14px;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
/* Symmetric side columns when a level is selected */
@media (min-width: 821px) {
  .workspace.lessons-open {
    grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr) minmax(280px, 340px);
  }

  .workspace.lessons-open .library-column,
  .workspace.lessons-open .lesson-side-list {
    width: 100%;
    min-width: 0;
    max-width: 340px;
  }
}
/* Stable desktop grid: Premium and Lessons use the same width, so the player never jumps */
@media (min-width: 821px) {
  .workspace,
  .workspace.lessons-open {
    grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr) minmax(280px, 340px);
  }

  .workspace .library-column,
  .workspace .premium-column {
    width: 100%;
    min-width: 0;
    max-width: 340px;
  }
}
/* Marquee only for long titles in the selected lesson card. */
.lesson-side-list .side-lesson-card.active .side-card-main strong.long-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

.lesson-side-list .side-lesson-card.active .long-title .lesson-title-text {
  display: inline-block;
  min-width: max-content;
  padding-right: 20px;
  animation: selected-lesson-title-marquee 9s ease-in-out infinite;
}

@keyframes selected-lesson-title-marquee {
  0%, 18% { transform: translateX(0); }
  72%, 88% { transform: translateX(calc(-100% + 100cqw - 20px)); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-side-list .side-lesson-card.active .long-title .lesson-title-text {
    animation: none;
  }
}
/* Unselected long lesson titles are clipped cleanly, without an ellipsis. */
.lesson-side-list .side-lesson-card:not(.active) .side-card-main strong.long-title {
  display: block;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}
/* Lesson titles: plain black text; lesson number keeps its accent styling. */
.lesson-side-list .side-card-main strong,
.workspace.lessons-open .lesson-side-list .side-card-main strong {
  color: #000;
  font-weight: 400;
}
/* Match lesson-card titles to the handwritten player typography. */
.lesson-side-list .side-card-main strong,
.workspace.lessons-open .lesson-side-list .side-card-main strong {
  color: #1f2937;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
}
/* Do not let the generic lesson-number span styling affect the title marquee. */
.lesson-side-list .side-lesson-card .lesson-title-text {
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-transform: none;
  letter-spacing: normal;
}
/* Keep titles still by default; marquee starts only while the card is hovered. */
.lesson-side-list .side-lesson-card .side-card-main strong.long-title {
  display: block;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}

.lesson-side-list .side-lesson-card .long-title .lesson-title-text {
  animation: none;
  transform: translateX(0);
}

.lesson-side-list .side-lesson-card:hover .side-card-main strong.long-title {
  white-space: nowrap;
}

.lesson-side-list .side-lesson-card:hover .long-title .lesson-title-text {
  animation: selected-lesson-title-marquee 9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lesson-side-list .side-lesson-card:hover .long-title .lesson-title-text {
    animation: none;
  }
}
/* Long titles rest on one clean clipped line, then reveal fully on hover. */
.lesson-side-list .side-lesson-card .side-card-main strong.long-title {
  white-space: nowrap;
  text-overflow: clip;
}

/* Actual overflow controls every lesson marquee; selection has no priority. */
.lesson-side-list .side-lesson-card .side-card-main strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}

.lesson-side-list .side-lesson-card .lesson-title-text {
  display: inline-block;
  min-width: max-content;
  animation: none;
  transform: translateX(0);
}

.lesson-side-list .side-lesson-card.active .long-title .lesson-title-text {
  animation: none;
}

.lesson-side-list .side-lesson-card:hover .long-title .lesson-title-text,
.lesson-side-list .side-lesson-card.active:hover .long-title .lesson-title-text {
  animation: selected-lesson-title-marquee 9s ease-in-out infinite;
}


/* Overflowing titles always scroll; hover and selection do not affect playback. */
.lesson-side-list .side-lesson-card .side-card-main strong.long-title .lesson-title-text,
.lesson-side-list .side-lesson-card.active .side-card-main strong.long-title .lesson-title-text,
.lesson-side-list .side-lesson-card:hover .side-card-main strong.long-title .lesson-title-text,
.lesson-side-list .side-lesson-card.active:hover .side-card-main strong.long-title .lesson-title-text {
  animation: selected-lesson-title-marquee 9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lesson-side-list .side-lesson-card .side-card-main strong.long-title .lesson-title-text {
    animation: none;
  }
}


/* Immediate marquee on any part of the card; no hover delay or selection priority. */
.lesson-side-list .side-lesson-card .side-card-main strong.long-title .lesson-title-text,
.lesson-side-list .side-lesson-card.active .side-card-main strong.long-title .lesson-title-text {
  animation: none;
  transform: translateX(0);
}

.lesson-side-list .side-lesson-card:hover .side-card-main strong.long-title .lesson-title-text,
.lesson-side-list .side-lesson-card.active:hover .side-card-main strong.long-title .lesson-title-text {
  animation: lesson-title-hover-marquee 7s linear infinite;
}

@keyframes lesson-title-hover-marquee {
  0% { transform: translateX(0); }
  50% { transform: translateX(calc(-100% + 100cqw - 20px)); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-side-list .side-lesson-card:hover .side-card-main strong.long-title .lesson-title-text {
    animation: none;
  }
}


/* Separate level tiles from the Levels panel with subtle level-tinted surfaces. */
.library-column .level-list {
  gap: 7px;
  margin-top: 4px;
}

.library-column .level-row {
  padding: 10px 8px;
  border-top: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--level) 5%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--level) 12%, transparent);
}

.library-column .level-row:hover,
.library-column .level-row.active {
  background: color-mix(in srgb, var(--level) 9%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--level) 22%, transparent);
}


/* Reserve enough width for B1 Intermediate by tightening decorative columns. */
.library-column .level-row {
  grid-template-columns: 46px minmax(76px, 1fr) 34px 44px 24px;
  gap: 5px;
}

.library-column .level-row > b {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.library-column .level-progress-meta {
  width: 34px;
}

.library-column .level-progress-meta mark {
  padding-inline: 5px;
}

.library-column .level-medal {
  width: 44px;
  height: 62px;
}

.library-column .level-arrow {
  width: 24px;
  height: 24px;
}


/* Subtle price-colored Premium card backgrounds. */
.premium-column:not(.lesson-side-list) .price-card.green {
  background: color-mix(in srgb, var(--green) 7%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 10%, transparent);
}

.premium-column:not(.lesson-side-list) .price-card.gold {
  background: color-mix(in srgb, var(--gold) 8%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 11%, transparent);
}

.premium-column:not(.lesson-side-list) .price-card.red {
  background: color-mix(in srgb, var(--red) 6%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 9%, transparent);
}


/* Business header, authentication, and account area. */
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-login-btn,
.auth-register-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.auth-login-btn {
  border: 1px solid rgba(103, 80, 164, 0.28);
  color: #59458f;
  background: rgba(255, 255, 255, 0.88);
}

.auth-register-btn,
.auth-submit,
.account-primary {
  color: #fff;
  background: linear-gradient(135deg, #6750a4, #8067bd);
  box-shadow: 0 8px 20px rgba(103, 80, 164, 0.22);
}

.auth-login-btn:hover,
.auth-register-btn:hover,
.user-trigger:hover { transform: translateY(-1px); }

.user-control { position: relative; }

.user-trigger {
  min-width: 176px;
  min-height: 48px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(103, 80, 164, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 16px rgba(54, 69, 96, 0.08);
  text-align: left;
}

.user-avatar,
.account-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #4aa7f0, #6750a4);
  font-weight: 900;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(103, 80, 164, 0.26);
  color: #6750a4;
  background: rgba(103, 80, 164, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 3px 9px rgba(103, 80, 164, 0.08);
}
.user-identity { min-width: 0; display: grid; }
.user-identity strong { overflow: hidden; color: #26334a; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { color: #7a869b; font-size: 10px; font-weight: 700; }
.user-chevron { color: #6750a4; font-size: 18px; }

.user-dropdown {
  position: absolute;
  z-index: 950;
  top: calc(100% + 7px);
  right: 0;
  width: 176px;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(103, 80, 164, 0.17);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(32, 42, 65, 0.18);
}
.user-dropdown button { padding: 10px 12px; border-radius: 8px; color: #33415c; text-align: left; font-size: 13px; font-weight: 750; }
.user-dropdown button:hover { background: #f1edfb; color: #5b4494; }

.auth-backdrop {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 29, 44, 0.62);
  backdrop-filter: blur(7px);
}

.auth-dialog,
.account-dialog,
.feedback-dialog,
.support-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(103, 80, 164, 0.2);
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: 0 30px 90px rgba(18, 25, 43, 0.32);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #64748b;
  background: #f2f4f8;
  font-size: 24px;
}
.auth-dialog-brand { display: flex; align-items: center; justify-content: center; gap: 8px; color: #6750a4; font-family: "Segoe Print", cursive; font-weight: 800; }
.auth-dialog-brand img { width: 44px; height: 44px; object-fit: contain; }
.auth-dialog h2 { margin: 16px 0 6px; color: #26334a; font-size: 28px; text-align: center; }
.auth-dialog > p { margin: 0 auto 20px; color: #718096; line-height: 1.45; text-align: center; }
.mic-consent-dialog {
  width: min(560px,100%);
  border-color: rgba(73,164,232,.3);
  background: linear-gradient(145deg,#fff 30%,#f2f9fe);
  text-align: center;
}
.mic-consent-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; color: #318fd5; background: #e8f5ff; font-size: 30px; }
.mic-consent-icon svg { width: 30px; height: 30px; }
.mic-consent-dialog > small { display: block; margin: -7px auto 20px; color: #8290a6; font-size: 12px; line-height: 1.45; }
.mic-consent-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mic-consent-actions button {
  min-height: 86px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 2px solid transparent;
  border-radius: 15px;
  font-weight: 850;
  text-align: left;
}
.mic-consent-choice-icon { display:grid;place-items:center;width:34px;height:34px;border-radius:50%; }
.mic-consent-choice-icon svg { width:20px;height:20px;fill:currentColor; }
.mic-consent-primary { color: #fff; border-color:#318fd5; background: linear-gradient(135deg,#49a7f0,#318fd5); box-shadow:0 8px 20px rgba(49,143,213,.22); }
.mic-consent-primary .mic-consent-choice-icon { background:rgba(255,255,255,.18); }
.mic-consent-secondary { color: #253b63; border-color:rgba(73,164,232,.42); background:#fff; }
.mic-consent-secondary .mic-consent-choice-icon { color:#318fd5;background:#e8f5ff; }
.mic-consent-secondary:hover { border-color:#318fd5;background:#f4faff; }
@media (max-width:560px) {
  .mic-consent-actions { grid-template-columns:1fr; }
  .mic-consent-actions button { min-height:64px; }
}
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 6px; color: #42516a; font-size: 13px; font-weight: 800; }
.auth-form input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(103, 116, 142, 0.25);
  border-radius: 10px;
  color: #1f2937;
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 46px;
  letter-spacing: normal;
  transition: none;
  animation: none;
  outline: none;
}
.auth-form input:focus { border-color: #6750a4; box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.12); }
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1f2937;
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  caret-color: #1f2937;
  transition: none;
  animation: none;
}
.password-field {
  position: relative;
  display: block;
}
.password-field input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 40px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #6750a4;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible { background: rgba(103, 80, 164, 0.1); }
.auth-submit { min-height: 48px; margin-top: 3px; border-radius: 11px; font-weight: 850; }
.forgot-password { justify-self: start; padding: 0; color: #6750a4; background: transparent; font-size: 13px; font-weight: 800; }
.forgot-password:hover,
.forgot-password:focus-visible { color: #48348a; text-decoration: underline; }
.auth-notice { padding: 10px 12px; border-radius: 9px; color: #276749; background: #edf9f0; font-size: 13px; line-height: 1.35; }
.lesson-complete .intro-actions { gap: 10px; }
.registration-legal {
  margin: 0;
  color: #7a869b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}
.registration-legal a { color: #6750a4; font-weight: 750; }
.auth-switch { width: 100%; margin-top: 15px; color: #6750a4; font-size: 13px; font-weight: 800; text-align: center; }
.auth-error { padding: 10px 12px; border-radius: 9px; color: #a43d35; background: #fff0ed; font-size: 13px; line-height: 1.35; }

.feedback-dialog { position: relative; width: min(500px, 100%); text-align: center; }
.feedback-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; color: #d99a20; background: #fff4cf; }
.feedback-icon svg { width: 30px; height: 30px; fill: currentColor; }
.feedback-dialog h2 { margin: 14px 34px 6px; color: #26334a; font-size: 27px; }
.feedback-dialog > p { margin: 0 auto 18px; color: #718096; line-height: 1.45; }
.feedback-form { display: grid; gap: 15px; text-align: left; }
.feedback-form label { display: grid; gap: 7px; color: #42516a; font-size: 13px; font-weight: 800; }
.feedback-stars { display: flex; justify-content: center; gap: 6px; }
.feedback-star { padding: 0; color: #d5d9e2; background: transparent; font-size: 40px; line-height: 1; transition: color .15s ease, transform .15s ease; }
.feedback-star:hover, .feedback-star:focus-visible, .feedback-star.selected { color: #f2b632; transform: translateY(-1px); }
.feedback-form textarea { width: 100%; min-height: 120px; resize: vertical; padding: 12px 13px; border: 1px solid rgba(103,116,142,.25); border-radius: 10px; color: #1f2937; background: #fff; font: inherit; line-height: 1.45; outline: none; }
.feedback-form textarea:focus { border-color: #6750a4; box-shadow: 0 0 0 3px rgba(103,80,164,.12); }
.feedback-submit { min-height: 48px; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#6750a4,#8067bd); font-weight: 850; }
.feedback-submit:disabled { opacity: .65; cursor: wait; }
.feedback-success { padding: 24px; border-radius: 14px; color: #2f7b4b; background: #edf9f1; font-size: 17px; font-weight: 850; }

.support-dialog { width: min(520px, 100%); display: grid; gap: 14px; overflow: hidden; }
.support-heading { display: flex; align-items: center; gap: 11px; padding-right: 38px; }
.support-heading > span { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 50%; color: #6750a4; background: #f0ebfa; }
.support-heading > span svg { width: 24px; height: 24px; fill: currentColor; }
.support-heading > div { min-width: 0; flex: 1; }
.support-heading h2 { margin: 0; color: #26334a; font-size: 24px; }
.support-heading p { margin: 2px 0 0; color: #718096; font-size: 13px; }
.support-refresh { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; color: #6750a4; background: #f0ebfa; font-size: 21px; }
.support-messages { min-height: 230px; max-height: min(46dvh, 410px); display: flex; flex-direction: column; gap: 9px; overflow-y: auto; padding: 14px; border: 1px solid rgba(103,80,164,.14); border-radius: 14px; background: #f8f7fb; }
.support-empty { margin: auto; padding: 18px; color: #7a8496; text-align: center; line-height: 1.45; }
.support-day-divider { align-self: stretch; display: flex; align-items: center; gap: 9px; margin: 3px 0 1px; color: #8a93a4; font-size: 10px; font-weight: 800; }
.support-day-divider::before, .support-day-divider::after { content: ''; height: 1px; flex: 1; background: rgba(103,80,164,.14); }
.support-day-divider time { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: #f8f7fb; white-space: nowrap; }
.support-message { max-width: 82%; padding: 9px 12px; border-radius: 14px; }
.support-message.from-support { align-self: flex-start; color: #34415a; background: #fff; border-bottom-left-radius: 4px; }
.support-message.from-user { align-self: flex-end; color: #392a65; background: #e9e1f8; border-bottom-right-radius: 4px; }
.support-message small { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 3px; opacity: .68; font-size: 10px; font-weight: 800; }
.support-message small time { font-weight: 650; white-space: nowrap; }
.support-message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.4; }
.support-form { display: flex; align-items: stretch; gap: 8px; }
.support-form textarea { min-width: 0; min-height: 48px; max-height: 130px; flex: 1; resize: vertical; padding: 12px 13px; border: 1px solid rgba(103,116,142,.25); border-radius: 11px; color: #1f2937; background: #fff; font: inherit; line-height: 1.4; outline: none; }
.support-form textarea:focus { border-color: #6750a4; box-shadow: 0 0 0 3px rgba(103,80,164,.12); }
.support-form button { min-width: 112px; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#6750a4,#8067bd); font-weight: 850; }
.support-form button:disabled { opacity: .65; cursor: wait; }

.account-dialog { width: min(680px, 100%); }
.account-profile { display: flex; align-items: center; gap: 14px; padding-right: 38px; }
.account-avatar { width: 58px; height: 58px; flex: 0 0 58px; font-size: 24px; }
.account-profile h2 { margin: 0; color: #26334a; font-size: 25px; }
.account-profile p { margin: 3px 0 0; color: #718096; }
.account-name-editor { display: grid; gap: 7px; margin-top: 16px; padding: 13px 14px; border: 1px solid rgba(103, 80, 164, 0.16); border-radius: 12px; background: #faf9fe; }
.account-name-editor > label { color: #42516a; font-size: 13px; font-weight: 800; }
.account-name-editor > div { display: flex; gap: 8px; }
.account-name-editor input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; border: 1px solid #d8d2e9; border-radius: 9px; color: #26334a; background: #fff; font: inherit; }
.account-name-editor input:focus { outline: 0; border-color: #6750a4; box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.12); }
.account-name-editor button { min-width: 112px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: #6750a4; font-weight: 800; cursor: pointer; }
.account-name-editor button:disabled { cursor: wait; opacity: .65; }
.account-name-message { font-size: 12px; font-weight: 750; }
.account-name-message.error { color: #b64a42; }
.account-name-message.success { color: #39864c; }
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.account-stats article { display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: #f4f1fb; text-align: center; }
.account-stats strong { color: #6750a4; font-size: 24px; }
.account-stats span { color: #718096; font-size: 12px; font-weight: 750; }
.account-progress { display: grid; gap: 8px; margin-top: 18px; }
.account-progress > span { display: flex; justify-content: space-between; color: #42516a; }
.account-progress em { color: #6750a4; font-style: normal; font-weight: 800; }
.account-progress > i { height: 9px; overflow: hidden; border-radius: 99px; background: #ebe7f5; }
.account-progress > i b { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #4aa7f0, #6750a4); }
.account-settings { display: grid; gap: 8px; margin-top: 18px; }
.account-settings > div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid rgba(103, 116, 142, 0.15); border-radius: 10px; color: #718096; }
.account-language-control { min-width: 180px; display: flex; align-items: center; gap: 8px; }
.account-language-control select { min-width: 0; width: 100%; border: 0; color: #33415c; background: transparent; font: inherit; font-weight: 800; cursor: pointer; outline: none; }
.account-language-control:focus-within { border-radius: 7px; box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.12); }
.account-legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; padding-top: 15px; border-top: 1px dashed rgba(103, 116, 142, 0.2); }
.account-legal-links a { color: #6750a4; font-size: 13px; font-weight: 750; text-decoration: none; }
.account-legal-links a:hover, .account-legal-links a:focus-visible { text-decoration: underline; }
.account-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.account-actions button { min-height: 42px; padding: 0 15px; border-radius: 10px; font-weight: 800; }
.account-actions button:first-child { color: #a43d35; background: #fff0ed; }

@media (min-width: 821px) {
  .top-brand { grid-template-columns: 128px minmax(250px, 1fr) auto; }
}

@media (max-width: 820px) {
  .header-tools { grid-column: 2; grid-row: 1; justify-self: end; }
  .header-tools .language-switcher { grid-column: auto; grid-row: auto; }
}

@media (max-width: 820px) {
  .header-tools { grid-column: 1; grid-row: auto; width: 100%; justify-content: stretch; flex-wrap: wrap; }
  .header-tools .language-switcher { width: auto; flex: 1 1 150px; }
  .auth-actions { flex: 1 1 auto; justify-content: flex-end; }
  .auth-login-btn, .auth-register-btn { padding-inline: 12px; }
  .user-control { margin-left: auto; }
  .account-stats { grid-template-columns: 1fr; }
  .account-name-editor > div { flex-direction: column; }
  .account-name-editor button { min-height: 42px; }
  .account-settings > div { align-items: center; }
  .account-language-control { min-width: min(180px, 56vw); }
  .account-actions { flex-direction: column-reverse; }
  .account-actions button { width: 100%; }
}

/* Compact account cabinet mirrors the Android account sheet. */
.account-dialog-compact {
  width: min(470px, 100%);
  padding: 18px;
  border-radius: 16px;
  background: #fffdf9;
}
.account-profile-compact { min-width: 0; gap: 12px; padding: 0 36px 8px 0; }
.account-profile-compact .account-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 18px; background: rgba(103,80,164,.09); border: 1.5px solid rgba(103,80,164,.26); }
.account-profile-compact > div { min-width: 0; flex: 1; }
.account-profile-compact h2 { overflow: hidden; font-size: 15px; line-height: 19px; white-space: nowrap; text-overflow: ellipsis; }
.account-profile-compact p { overflow: hidden; margin-top: 1px; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.account-profile-compact > small { color: #8b94a3; font-size: 11px; }
.account-compact-list { display: grid; gap: 3px; margin-top: 4px; }
.account-compact-row,
.account-compact-details > summary {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  border: 0;
  border-radius: 8px;
  color: #26334a;
  background: transparent;
  font: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.account-compact-row:hover,
.account-compact-details > summary:hover { background: rgba(103,80,164,.055); }
.account-compact-row.static { cursor: default; }
.account-compact-row.static:hover { background: transparent; }
.account-row-icon { width: 18px; height: 18px; display: grid; place-items: center; color: #6750a4; }
.account-row-icon svg { width: 18px; height: 18px; fill: currentColor; }
.account-row-copy { min-width: 0; display: grid; gap: 1px; }
.account-row-copy strong { overflow: hidden; color: inherit; font-size: 13px; font-weight: 650; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.account-row-copy small { overflow: hidden; color: #7b8490; font-size: 11px; line-height: 14px; white-space: nowrap; text-overflow: ellipsis; }
.account-row-chevron { color: #9aa1ad; font-size: 22px; line-height: 1; }
.account-compact-row.destructive { color: #ba3f3f; }
.account-compact-row.destructive .account-row-icon { color: #ba3f3f; }
.account-compact-details { min-width: 0; }
.account-compact-details > summary { list-style: none; }
.account-compact-details > summary::-webkit-details-marker { display: none; }
.account-compact-details[open] > summary .account-row-chevron { transform: rotate(90deg); }
.account-name-editor-compact { margin: 0 0 4px 27px; padding: 9px; grid-template-columns: minmax(0,1fr) auto; background: rgba(103,80,164,.05); }
.account-name-editor-compact input { height: 36px; }
.account-name-editor-compact button { min-width: 86px; min-height: 36px; }
.account-name-editor-compact .account-name-message { grid-column: 1 / -1; }
.account-purchases-compact { margin: 0 0 4px 27px; padding: 8px; border-radius: 9px; }
.account-purchases-compact .account-purchase-item { padding: 8px 9px; }
.account-purchases-compact .account-purchase-item > span { display: none; }
.account-language-control { min-width: 132px; justify-content: flex-end; }
.account-language-control select { max-width: 90px; font-size: 11px; }
.account-compact-divider { height: 1px; margin: 2px 4px; background: rgba(103,80,164,.12); }
.account-legal-links-compact { gap: 6px 14px; margin-top: 7px; padding-top: 8px; }
.account-legal-links-compact a { font-size: 11px; }
.account-dialog-compact .account-payment-status { margin: 4px 0 6px; padding: 7px 9px; font-size: 11px; }
@media (max-width: 820px) {
  .account-backdrop { align-items: center; padding: 8px; }
  .account-dialog-compact { width: 100%; max-height: calc(100dvh - 16px); padding: 14px; }
  .account-profile-compact { padding-bottom: 5px; }
  .account-name-editor-compact { margin-left: 27px; }
  .account-name-editor-compact > div { flex-direction: row; }
  .account-name-editor-compact button { width: auto; }
  .account-language-control { min-width: 118px; }
}
/* Owner-only customer dashboard. */
.admin-dialog {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  padding: 26px;
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: 0 30px 90px rgba(18, 25, 43, 0.34);
}
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-right: 42px; }
.admin-heading span { color: #6750a4; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.admin-heading h2 { margin: 2px 0; color: #26334a; font-size: 28px; }
.admin-heading p { margin: 0; color: #718096; }
.admin-heading > button { min-height: 40px; padding: 0 14px; border-radius: 10px; color: #6750a4; background: #f0ebfa; font-weight: 800; }
.admin-tabs { display: flex; gap: 7px; margin-top: 18px; }
.admin-tabs button { min-height: 38px; padding: 0 14px; border-radius: 9px; color: #65728a; background: #f2f4f8; font-weight: 800; }
.admin-tabs button.active { color: #fff; background: #6750a4; }
.admin-table-wrap { max-height: calc(100dvh - 180px); overflow: auto; margin-top: 18px; border: 1px solid rgba(103,116,142,.16); border-radius: 12px; }
.admin-table-wrap table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.admin-table-wrap th { position: sticky; top: 0; z-index: 1; padding: 11px 12px; color: #526078; background: #f5f3fa; text-align: left; white-space: nowrap; }
.admin-table-wrap td { padding: 11px 12px; border-top: 1px solid #edf0f5; color: #526078; white-space: nowrap; }
.admin-table-wrap td strong { color: #26334a; }
.admin-table-wrap td small { color: #8791a2; }
.admin-table-wrap td.admin-feedback-comment { min-width: 260px; max-width: 460px; white-space: normal; line-height: 1.4; }
.admin-publish-review { display: block; min-height: 32px; margin-top: 9px; padding: 0 11px; border-radius: 8px; color: #fff; background: #6750a4; font-size: 11px; font-weight: 800; }
.admin-publish-review:hover, .admin-publish-review:focus-visible { background: #563f91; }
.admin-rating { color: #e5a526; font-size: 16px; white-space: nowrap; }
.admin-plan { padding: 4px 8px; border-radius: 99px; color: #6750a4; background: #f0ebfa; font-size: 11px; font-weight: 850; }
.admin-loading { margin-top: 18px; padding: 28px; border-radius: 12px; color: #6750a4; background: #f5f1fc; text-align: center; font-weight: 800; }
.admin-support-layout { min-height: 480px; max-height: calc(100dvh - 190px); display: grid; grid-template-columns: minmax(240px, 32%) minmax(0, 1fr); overflow: hidden; margin-top: 18px; border: 1px solid rgba(103,116,142,.16); border-radius: 14px; background: #fff; }
.admin-support-list { overflow-y: auto; padding: 8px; border-right: 1px solid #e8eaf0; background: #f7f6fa; }
.admin-support-ticket { width: 100%; display: grid; gap: 4px; padding: 12px; border-radius: 10px; color: #536079; text-align: left; }
.admin-support-ticket:hover, .admin-support-ticket.active { background: #eae3f7; }
.admin-support-ticket > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-support-ticket strong { min-width: 0; overflow: hidden; color: #26334a; text-overflow: ellipsis; white-space: nowrap; }
.admin-support-ticket small { overflow: hidden; color: #8791a2; text-overflow: ellipsis; white-space: nowrap; }
.admin-support-ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.admin-support-ticket-meta em { flex: 0 0 auto; padding: 3px 7px; border-radius: 99px; font-size: 9px; font-style: normal; font-weight: 900; }
.admin-support-ticket-meta em.unread { color: #9b3f38; background: #ffe5e1; }
.admin-support-ticket-meta em.read { color: #287047; background: #e4f5e9; }
.admin-support-ticket-meta time { overflow: hidden; color: #8791a2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.admin-support-conversation { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.admin-support-conversation > header { display: grid; gap: 2px; padding: 13px 16px; border-bottom: 1px solid #edf0f5; }
.admin-support-conversation > header strong { color: #26334a; }
.admin-support-conversation > header small { color: #8791a2; }
.admin-support-messages { min-height: 0; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; padding: 16px; background: #faf9fc; }
.admin-support-empty { margin: auto; padding: 24px; color: #8791a2; text-align: center; }
.admin-support-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #edf0f5; }
.admin-support-form textarea { min-width: 0; min-height: 52px; max-height: 130px; flex: 1; resize: vertical; padding: 11px 12px; border: 1px solid #d8dce5; border-radius: 10px; font: inherit; }
.admin-support-form textarea:focus { outline: 0; border-color: #6750a4; box-shadow: 0 0 0 3px rgba(103,80,164,.12); }
.admin-support-form button { min-width: 148px; padding: 0 14px; border-radius: 10px; color: #fff; background: #6750a4; font-weight: 850; }
.admin-support-form button:disabled { opacity: .65; cursor: wait; }
@media (max-width: 820px) { .admin-dialog { padding: 18px; } .admin-heading h2 { font-size: 23px; } }
@media (max-width: 700px) { .admin-support-layout { max-height: none; grid-template-columns: 1fr; grid-template-rows: minmax(150px, 34dvh) minmax(330px, 52dvh); overflow: auto; } .admin-support-list { border-right: 0; border-bottom: 1px solid #e8eaf0; } .admin-support-form { flex-direction: column; } .admin-support-form button { min-height: 44px; } }
/* Five-sentence demo and locked-lesson paywall. */
.paywall-dialog { position: relative; width: min(560px,100%); padding: 30px; border-radius: 24px; background: #fffdf9; box-shadow: 0 30px 90px rgba(18,25,43,.34); text-align: center; }
.paywall-lock { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 8px; border-radius: 50%; background: #f1ecfb; font-size: 27px; }
.paywall-level { display: inline-block; padding: 4px 10px; border-radius: 99px; color: var(--paywall-color); background: color-mix(in srgb,var(--paywall-color) 10%,#fff); font-weight: 900; }
.paywall-dialog h2 { margin: 12px 0 7px; color: #26334a; font-size: 27px; }
.paywall-dialog > p { max-width: 460px; margin: 0 auto; color: #718096; line-height: 1.45; }
.paywall-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 20px 0; }
.paywall-options button { display: grid; gap: 3px; padding: 14px 8px; border: 1px solid rgba(103,80,164,.16); border-radius: 13px; background: #f8f5fc; }
.paywall-options strong { display: flex; align-items: baseline; justify-content: center; gap: .2em; color: #6750a4; font-size: 21px; }
.paywall-options strong .price-amount { font: inherit; }
.paywall-options strong .price-currency { font-size: .55em; letter-spacing: .05em; opacity: .7; }
.paywall-options .price-currency { margin-left: .22em; }
.paywall-options button > span { color: #718096; font-size: 11px; font-weight: 750; }
.paywall-primary { width: 100%; min-height: 48px; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#6750a4,#8067bd); box-shadow: 0 8px 20px rgba(103,80,164,.23); font-weight: 850; }
.paywall-dialog > small { display: block; margin-top: 12px; color: #8993a5; }
@media (max-width: 560px) { .paywall-options { grid-template-columns: 1fr; } .paywall-dialog { padding: 24px 18px; } }
/* Purchase controls and personalized upgrade pricing. */
.price-card { width: 100%; border: 0; font: inherit; text-align: inherit; cursor: pointer; }
.price-card:hover, .price-card:focus-visible { transform: translateY(-2px); filter: saturate(1.08); outline: 2px solid currentColor; outline-offset: 2px; }
.price-card:disabled, .paywall-options button:disabled { cursor: default; opacity: .72; transform: none; filter: none; }
.price-card .purchase-list-price,
.paywall-options .purchase-list-price { color: #8a94a6; font-size: 14px; text-decoration: line-through; }
.price-card .purchase-upgrade { font-size: 28px; }
.price-card .purchase-credit,
.paywall-options .purchase-credit { padding: 4px 9px; border-radius: 99px; color: #246858; background: #e8f5f0; font-size: 11px; font-weight: 800; }
.price-card .purchase-owned { color: #246858; font-size: 20px; }
.paywall-options .purchase-upgrade { flex-wrap: wrap; font-size: 17px; }
.paywall-options .purchase-owned { font-size: 16px; }
.price-card .price-amount,
.paywall-options .price-amount {
  font-family: "Segoe UI Variable Display", "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 900;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.055em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72), 0 5px 14px rgba(38, 52, 78, 0.14);
}
.price-card .price-currency,
.paywall-options .price-currency {
  font-family: "Segoe UI Variable Text", "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: none;
}
.paywall-options button { font: inherit; cursor: pointer; text-align: center; transition: transform .16s ease, box-shadow .16s ease; }
.paywall-options button:hover, .paywall-options button:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(103,80,164,.14); outline: 2px solid rgba(103,80,164,.35); outline-offset: 1px; }
.payment-withdrawal {
  display: none !important;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin: -4px auto 12px !important;
  color: #52647e !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.payment-withdrawal span {
  flex: 0 0 auto;
  color: #75b83d;
  font-weight: 900;
}

.payment-preparation {
  width: 100%;
  display: block;
  margin: 0 0 14px;
  color: #718096;
  text-align: center;
}

.payment-security-copy {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.payment-security-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.payment-method-marks {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.payment-method-mark {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.payment-method-blik { width: 36px; height: 24px; }
.payment-method-google-pay,
.payment-method-visa { width: 42px; height: 28px; }
.account-payment-status { margin-top: 14px; padding: 9px 12px; border: 1px solid #d7dce5; border-radius: 10px; color: #647086; background: #f5f7fa; font-size: 13px; font-weight: 800; text-align: center; }
.account-payment-status.success { border-color: #b8dfd4; color: #174f42; background: #f0fbf7; }
.site-legal-footer {
  margin-top: clamp(38px, 7vh, 86px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 18px 12px 4px;
  color: #768197;
  font-size: 12px;
  text-align: center;
}
.site-legal-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
.site-legal-footer a { color: #6750a4; text-decoration: none; }
.site-legal-footer a:hover, .site-legal-footer a:focus-visible { text-decoration: underline; }
@media (max-width: 700px) {
  .site-legal-footer { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .site-legal-footer span, .site-legal-footer nav { width: 100%; }
}
.account-purchases { margin-top: 18px; padding: 14px; border-radius: 14px; background: rgba(103,80,164,.07); }
.account-purchases h3 { margin: 0 0 8px; color: #33415c; font-size: 16px; }
.account-purchases p { margin: 0; color: #718096; font-size: 13px; line-height: 1.45; }
.account-purchases div { display: flex; justify-content: space-between; gap: 12px; }
.account-purchases strong { color: #6750a4; }
.account-purchases span { color: #718096; font-size: 13px; }
.account-purchase-list { display: grid !important; gap: 8px !important; }
.account-purchase-item { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px !important; padding: 11px 12px; border: 1px solid rgba(103,80,164,.13); border-radius: 10px; background: rgba(255,255,255,.72); }
.account-purchase-details { min-width: 0; display: grid !important; gap: 3px !important; }
.account-purchase-details strong { overflow-wrap: anywhere; }
.account-purchase-details small { color: #65728a; line-height: 1.35; }
.account-purchase-item > time { align-self: center; color: #8a6a2f; font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.account-level-code { color: var(--account-level-color) !important; font-weight: 900; text-shadow: 0 1px 0 rgba(255,255,255,.72); }
.account-course-range { display: inline-flex; align-items: baseline; white-space: nowrap; }
.account-course-range-separator, .account-level-separator, .account-level-divider { color: #8a93a5; font-weight: 700; }
.side-lesson-card, .drawer-card { position: relative; }
.lesson-access-status { position: absolute; z-index: 3; top: 0; left: 0; max-width: calc(100% - 12px); padding: 7px 11px; border-radius: 15px 0 12px 0; color: #fff !important; background: rgba(45,56,76,.9); box-shadow: 2px 3px 9px rgba(25,35,53,.16); font-size: 10px !important; font-weight: 900 !important; letter-spacing: .03em !important; line-height: 1.15; text-transform: none !important; }
.lesson-access-status.demo { background: #69758a; }
.lesson-access-status.open { background: #2f8069; }
.lesson-access-status.available { background: #c77b19; }
.lesson-access-status.locked { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border-radius: 15px 0 12px 0; background: rgba(43,50,64,.84); font-size: 15px !important; }
.side-lesson-card.access-locked, .drawer-card.access-locked { cursor: default; opacity: .55; filter: grayscale(.72); }
.side-lesson-card.access-locked:hover, .drawer-card.access-locked:hover { transform: none; border-color: rgba(217,205,191,.95); box-shadow: none; }
.side-lesson-card:not(.access-open) .side-card-main > span,
.drawer-card:not(.access-open) .drawer-card-copy > span {
  color: #8b94a3;
}
.drawer-card:not(.access-open) .drawer-card-copy {
  background: #f1f3f5;
}
/* Android-equivalent lesson access badges: status stays above card dimming. */
.lesson-access-status:not(.locked) {
  min-width: 58px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0 11px;
  border-radius: 15px 0 12px 0;
  background: color-mix(in srgb, color-mix(in srgb, #000 18%, var(--access-accent, #6750a4) 82%) 68%, transparent) !important;
  box-shadow: none;
  font-size: 10px !important;
  line-height: 11px;
  letter-spacing: .03em !important;
}

.lesson-access-status.locked {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 15px 0 12px 0;
  background: rgba(43,50,64,.84) !important;
  box-shadow: 0 3px 6px rgba(25,35,53,.16);
  font-size: 15px !important;
}
.side-lesson-card.access-locked,
.drawer-card.access-locked {
  opacity: 1;
  filter: none;
  background: rgba(255,255,255,.495);
}
.side-lesson-card.access-locked .side-card-main,
.side-lesson-card.access-locked .lesson-stamp-strip,
.drawer-card.access-locked .drawer-card-main,
.drawer-card.access-locked .lesson-stamp-strip {
  opacity: .55;
  filter: grayscale(.72);
}
/* Country flags drawn without emoji, so Windows cannot replace them with letters. */
.country-flag { display:inline-block; width:28px; height:19px; flex:0 0 auto; box-sizing:border-box; border-radius:3px; border:1px solid rgba(30,41,59,.30); box-shadow:0 1px 2px rgba(15,23,42,.14); vertical-align:middle; overflow:hidden; font-size:0; line-height:0; background-size:100% 100%; background-repeat:no-repeat; background-position:center; }
.flag-ru { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Cpath fill='%23f7f7f7' d='M0 0h3v2H0z'/%3E%3Cpath fill='%230039a6' d='M0 .667h3v.666H0z'/%3E%3Cpath fill='%23d52b1e' d='M0 1.333h3V2H0z'/%3E%3C/svg%3E"); }
.flag-uk { background:linear-gradient(to bottom,#005bbb 0 50%,#ffd500 50%); }
.flag-pl { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'%3E%3Cpath fill='%23f7f7f7' d='M0 0h8v2.5H0z'/%3E%3Cpath fill='%23dc143c' d='M0 2.5h8V5H0z'/%3E%3C/svg%3E"); }
.flag-de { background:linear-gradient(to bottom,#111 0 33.33%,#dd0000 33.33% 66.66%,#ffce00 66.66%); }
.flag-fr { background:linear-gradient(to right,#0055a4 0 33.33%,#fff 33.33% 66.66%,#ef4135 66.66%); }
.flag-it { background:linear-gradient(to right,#009246 0 33.33%,#fff 33.33% 66.66%,#ce2b37 66.66%); }
.flag-es { background:linear-gradient(to bottom,#aa151b 0 25%,#f1bf00 25% 75%,#aa151b 75%); }
.flag-pt { background:linear-gradient(to right,#046a38 0 40%,#da291c 40%); }
.language-choice > .country-flag { width:38px; height:25px; }
.language-switcher > .country-flag { width:25px; height:17px; }
.account-language-control > .country-flag { width:25px; height:17px; }
/* Level-colored lesson cards shared by desktop and tablet web layouts. */
.lesson-side-list .side-lesson-card {
  border-color: color-mix(in srgb, var(--side-accent) 30%, #d9cdbf);
  background: color-mix(in srgb, var(--side-accent) 6%, #fff);
}

.lesson-side-list .side-card-main {
  background: color-mix(in srgb, var(--side-accent) 10%, #fff);
}

.lesson-side-list .side-card-main img {
  border-bottom-color: color-mix(in srgb, var(--side-accent) 24%, #d9cdbf);
}

.lesson-side-list .lesson-stamp-strip {
  border-left-color: color-mix(in srgb, var(--side-accent) 30%, #e8d8c8);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--side-accent) 6%, #fffdf9),
    color-mix(in srgb, var(--side-accent) 15%, #fff8ef) 50%,
    color-mix(in srgb, var(--side-accent) 8%, #fffaf3)
  );
}

/* Sequential mobile flow. Desktop layout remains unchanged. */
.mobile-flow-header,
.mobile-lessons-screen {
  display: none;
}

@media (max-width: 820px) {
  html,
  body,
  #app {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .chalk-app {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 0;
  }

  .top-brand,
  .download-bar {
    display: none !important;
  }

  .mobile-flow-header {
    position: relative;
    z-index: 50;
    height: 60px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    padding: max(6px, env(safe-area-inset-top)) 10px 6px;
    border-bottom: 1px solid rgba(103, 116, 142, 0.18);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 16px rgba(35, 50, 74, 0.08);
    backdrop-filter: blur(14px);
  }

  .mobile-flow-header strong {
    min-width: 0;
    overflow: hidden;
    color: var(--accent, #6750a4);
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-flow-back,
  .mobile-back-placeholder,
  .mobile-account-button {
    width: 40px;
    height: 40px;
  }

  .mobile-flow-back {
    display: grid;
    place-items: center;
    border: 1px solid rgba(103, 116, 142, 0.2);
    border-radius: 12px;
    color: var(--accent, #6750a4);
    background: #fff;
    font-size: 25px;
    font-weight: 900;
  }

  .mobile-account-button {
    display: grid;
    place-items: center;
    border: 1px solid rgba(103, 80, 164, 0.22);
    border-radius: 50%;
    color: #6750a4;
    background: #fff;
    box-shadow: 0 3px 10px rgba(54, 69, 96, 0.10);
  }

  .mobile-account-button svg {
    width: 21px;
    height: 21px;
  }

  .mobile-account-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1.5px solid rgba(103, 80, 164, 0.26);
    color: #6750a4;
    background: rgba(103, 80, 164, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 3px 9px rgba(103, 80, 164, 0.08);
    font-size: 14px;
    font-weight: 900;
  }

  .workspace {
    width: 100%;
    height: calc(100dvh - 60px);
    min-height: 0;
    margin: 0;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .mobile-screen-levels .workspace {
    display: block !important;
  }

  .mobile-screen-levels .library-column {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100%;
    display: flex !important;
  }

  .mobile-screen-levels .center-column,
  .mobile-screen-levels .premium-column {
    display: none !important;
  }

  .mobile-screen-levels .library-column.homework-mode .homework-mode-toolbar {
    display: none;
  }

  .mobile-screen-lessons .workspace {
    display: none !important;
  }

  .mobile-homework-lessons-screen {
    width: 100%;
    height: calc(100dvh - 60px);
    min-height: 0;
    padding: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f9ff, #f7fbff);
  }

  .mobile-homework-lessons-screen .homework-lessons-panel {
    position: static;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    display: flex !important;
    border-radius: 18px;
  }

  .mobile-homework-lessons-screen .homework-lesson-list {
    flex: 1;
    max-height: none;
  }

  .mobile-lessons-screen {
    width: 100%;
    height: calc(100dvh - 60px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f9ff, #fffaf4);
  }

  .mobile-lessons-screen .lessons-screen-head {
    display: none;
  }

  .mobile-lessons-screen .drawer-lessons {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 2px 2px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-lessons-screen .drawer-card {
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 78px;
  }

  .mobile-lessons-screen .lesson-stamp-strip {
    width: 78px;
    min-width: 78px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 58px);
    align-content: space-evenly;
    justify-items: center;
    align-items: start;
    gap: 0;
    padding: 8px;
    border-left-color: color-mix(in srgb, var(--drawer-accent) 30%, #e8d8c8);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--drawer-accent) 6%, #fffdf9),
      color-mix(in srgb, var(--drawer-accent) 15%, #fff8ef) 50%,
      color-mix(in srgb, var(--drawer-accent) 8%, #fffaf3)
    );
  }

  .mobile-lessons-screen .drawer-card .wax-stamp,
  .mobile-lessons-screen .drawer-card .wax-stamp svg {
    width: 50px;
    height: 58px;
    min-width: 50px;
    margin: 0;
    transform: none;
  }

  .mobile-lessons-screen .drawer-card .stamp-word-label {
    top: 39px;
    width: 50px;
    line-height: 7px;
  }

  .mobile-lessons-screen .drawer-card-main {
    min-width: 0;
    width: 100%;
    grid-template-rows: auto 52px;
    gap: 0;
    padding-bottom: 0;
  }

  .mobile-lessons-screen .drawer-card .drawer-card-main img {
    aspect-ratio: 3 / 2;
  }

  .mobile-lessons-screen .drawer-card-copy {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 3px 10px;
    margin: 0;
    align-self: stretch;
    overflow: hidden;
    background: color-mix(in srgb, var(--drawer-accent) 10%, #fff);
  }

  .mobile-lessons-screen .drawer-card-copy .drawer-lesson-title {
    width: 100%;
    min-width: 0;
    margin: 0;
    display: block;
    overflow: hidden;
    color: #1f2937;
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    font-size: 15px;
    font-weight: 400;
    line-height: 17px;
    text-align: left;
    white-space: nowrap;
    container-type: inline-size;
  }

  .mobile-lessons-screen .drawer-card-copy > span {
    margin: 0;
    color: var(--drawer-accent);
    font-size: 9px;
    font-weight: 800;
    line-height: 12px;
    letter-spacing: 0.06em;
  }

  .mobile-lessons-screen .drawer-lesson-title .lesson-title-text {
    display: inline-block;
    min-width: max-content;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-transform: none;
    letter-spacing: normal;
  }

  .mobile-lessons-screen .drawer-lesson-title.long-title .lesson-title-text {
    padding-right: 28px;
    animation: mobile-lesson-title-marquee 9s ease-in-out infinite;
  }
  .mobile-screen-player .workspace {
    display: block !important;
    padding: 8px;
  }

  .mobile-screen-player .library-column,
  .mobile-screen-player .premium-column {
    display: none !important;
  }

  .mobile-screen-player .center-column {
    width: 100%;
    max-width: none;
    min-height: 100%;
    display: block !important;
  }

  .mobile-screen-player .practice-board {
    min-height: 0;
  }

  .mobile-screen-player .practice-board.intro-playing,
  .mobile-screen-player .practice-board.lesson-complete {
    min-height: calc(100dvh - 76px);
  }

  .mobile-screen-player .practice-board.active-playing > .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-screen-player .practice-board.active-playing > .section-head strong {
    margin-left: auto;
    text-align: right;
  }

  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    min-height: calc(100dvh - 180px);
    grid-template-rows: minmax(180px, auto) auto minmax(220px, 1fr);
    align-content: stretch;
  }

  .mobile-screen-player .mobile-intro-brand {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding: 12px 0 14px;
    overflow: hidden;
    text-align: center;
  }

  .mobile-screen-player .mobile-intro-brand img {
    position: absolute;
    left: 50%;
    top: calc(50% - 32px);
    width: min(68vw, 280px);
    max-height: 190px;
    margin: 0;
    object-fit: contain;
    filter: drop-shadow(0 9px 13px rgba(72, 57, 118, 0.13));
    transform: translate(-50%, -50%);
  }

  .mobile-screen-player .mobile-intro-brand strong {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin: 0;
    color: #6750a4;
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    font-size: clamp(24px, 7vw, 32px);
    font-weight: 800;
    line-height: 1;
  }

  .mobile-screen-premium .workspace {
    display: none !important;
  }

  .mobile-premium-screen {
    width: 100%;
    height: calc(100dvh - 60px);
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8f9ff, #fffaf4);
  }

  .mobile-premium-screen > .premium-column:not(.lesson-side-list) {
    position: static;
    top: auto;
    width: 100%;
    max-width: none;
    min-height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 14px;
    margin: 0;
    padding: 14px;
    border-radius: 16px;
  }

  .mobile-premium-screen .price-card {
    width: 100%;
    min-height: 112px;
  }

  .mobile-screen-premium .paywall-backdrop {
    top: 60px;
    height: calc(100dvh - 60px);
    align-items: flex-start;
    overflow-y: auto;
  }

  .mobile-screen-premium .paywall-dialog {
    width: 100%;
    min-height: calc(100dvh - 60px);
    margin: 0;
    border-radius: 0;
  }
}
@keyframes mobile-lesson-title-marquee {
  0%, 16% { transform: translateX(0); }
  72%, 88% { transform: translateX(calc(-100% + 100cqw - 28px)); }
  100% { transform: translateX(0); }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .mobile-lessons-screen .drawer-lesson-title.long-title .lesson-title-text {
    animation: none;
  }
}

/* Prevent accidental text selection while navigating the app. */
.chalk-app,
.chalk-app button,
.chalk-app .level-row,
.chalk-app .drawer-card,
.chalk-app .side-lesson-card,
.chalk-app .price-card,
.chalk-app .wax-stamp,
.chalk-app .mobile-flow-header {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Form values remain selectable for editing. */
.chalk-app input,
.chalk-app textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Homework level codes use outlined square markers. */
.library-column.homework-mode .level-row > b {
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.library-column.homework-mode .level-row {
  grid-template-columns: 42px minmax(76px, 1fr) 34px 52px 24px;
  gap: 5px;
  height: 82px;
  min-height: 82px;
  max-height: 82px;
  padding: 10px 6px;
}

.library-column.homework-mode .level-progress-meta {
  width: 34px;
}

.library-column.homework-mode .level-progress-meta small {
  font-size: 9px;
  white-space: nowrap;
}

.library-column.homework-mode .level-row-copy em {
  font-size: 10px;
  white-space: nowrap;
}

.homework-level-book {
  position: relative;
  width: 52px;
  height: 66px;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.homework-level-book::before {
  content: none;
}

.homework-level-book img {
  position: absolute;
  z-index: 1;
  left: -3px;
  top: -2px;
  width: 58px;
  height: 70px;
  max-width: none;
  object-fit: contain;
  mix-blend-mode: normal;
}

.homework-toolbar-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.homework-toolbar-art {
  position: relative;
  width: 38px;
  height: 32px;
  flex: 0 0 38px;
  display: block;
  overflow: visible;
}

.homework-toolbar-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

@media (max-width: 820px) {
  .library-column > .public-reviews-preview {
    flex: 0 0 auto;
    margin-top: 12px;
  }

  .library-column > .public-reviews-preview .public-reviews-scroll {
    max-height: 360px;
  }

  .homework-compact-shortcut.homework-image-shortcut > .homework-button-books {
    width: 34%;
    margin-left: 1%;
    padding: 5px 0;
  }

  .homework-image-shortcut .homework-banner-label {
    left: 34%;
    width: 48%;
    font-size: clamp(14px, 4.1vw, 18px);
  }
}

/* Readable card typography on desktop and mobile web. */
.level-row .level-row-copy strong {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17.5px;
  line-height: 21px;
}

.homework-image-shortcut .homework-banner-label {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 21px;
}

.homework-compact-shortcut .homework-banner-label {
  top: 34%;
  width: 42%;
}

.homework-shortcut-progress {
  position: absolute;
  z-index: 2;
  top: 52%;
  left: 34%;
  width: 40%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3px;
  color: #52688e;
}

.homework-shortcut-progress > span {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(25,54,109,.14);
}

.homework-shortcut-progress i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg,#4f9cdb,#6750a4);
}

.homework-shortcut-progress small {
  color: #314d7c;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
}

.homework-shortcut-percent {
  position: absolute;
  z-index: 3;
  top: 24%;
  right: 12%;
  margin: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 999px;
  color: #6750a4;
  background: rgba(103,80,164,.11);
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
}
.level-row .level-row-copy em {

  font-size: 13px;
  line-height: 16px;
}

.level-progress-meta mark,
.level-progress-meta small {
  font-size: 11px;
}

.lesson-side-list .side-card-main strong,
.workspace.lessons-open .lesson-side-list .side-card-main strong {
  font-size: 14.5px;
  line-height: 18px;
}

.drawer-card-main > strong {
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 18.5px;
  line-height: 1.3;
}

.drawer-card-main > em {
  font-size: 15.5px;
  line-height: 1.35;
}

.homework-selection-card h2 {
  font-family: "Segoe Print", "Comic Sans MS", cursive;
}

.level-row:nth-child(4) .level-row-copy strong {
  font-size: 13px;
  line-height: 15.5px;
}

@media (max-width: 820px) {
  .mobile-flow-header strong {
    font-size: 20px;
  }

  .mobile-lessons-screen .drawer-card-copy .drawer-lesson-title {
    font-size: 16.5px;
    line-height: 19px;
  }

  .mobile-lessons-screen .drawer-card-copy > span {
    font-size: 10px;
    line-height: 13px;
  }

  .homework-selection-card p {
    font-size: 17.5px;
    line-height: 1.45;
  }

  .homework-selection-state {
    border-radius: 22px;
  }

  .mobile-homework-lessons-screen .homework-lessons-panel > header span {
    font-size: 13.5px;
  }

  .mobile-homework-lessons-screen .homework-lessons-panel > header h2 {
    font-size: 20px;
  }

  .mobile-homework-lessons-screen .homework-lesson-list button b {
    font-size: 10px;
  }

  .mobile-homework-lessons-screen .homework-lesson-list button > .homework-lesson-title {
    font-size: 13.5px;
    line-height: 1.4;
  }
}

/* Compact and full transcript modes, matching the Android Full Transcript flow. */
.transcript-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.transcript-expand-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(74, 167, 240, .34);
  border-radius: 999px;
  color: #318fd5;
  background: rgba(238, 248, 255, .92);
  font-size: 12px;
  font-weight: 800;
}

.transcript-expand-toggle > span {
  font-size: 17px;
  line-height: 1;
}

.transcript-expand-toggle > em {
  font-style: normal;
}

.transcript-expand-toggle:hover,
.transcript-expand-toggle:focus-visible {
  border-color: #318fd5;
  background: #fff;
  box-shadow: 0 7px 16px rgba(49, 143, 213, .13);
}

.transcript-board.is-expanded .transcript-panel {
  max-height: none;
  overflow-y: auto;
  padding-right: 0;
}

@media (min-width: 821px) {
  .workspace.lessons-open .transcript-board:not(.is-expanded) > .transcript-panel {
    max-height: 220px;
    overflow-y: auto;
  }

  .workspace.lessons-open .center-column:has(> .transcript-board.is-expanded) {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }



  .workspace.lessons-open .center-column:has(> .shadowing-method-controls) > .transcript-board.is-expanded {
    inset-block-start: 56px;
  }

  .workspace.lessons-open .transcript-board.is-expanded {
    position: absolute;
    z-index: 10;
    inset-block: 16px;
    inset-inline-start: 0;
    inset-inline-end: -32px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(58px, 7%, 78px) clamp(42px, 6.5%, 64px) clamp(116px, 12%, 148px);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent url("./assets/shared-scroll-vertical.webp?v=1") center / 100% 100% no-repeat;
    box-shadow: none;
    filter: drop-shadow(0 16px 22px rgba(55, 43, 30, .22));
  }



  .workspace.lessons-open .center-column.transcript-open > .practice-board,
  .workspace.lessons-open .center-column.transcript-open > .recording-board,
  .workspace.lessons-open .center-column.transcript-open > .assessment-board {
    visibility: hidden !important;
  }
  .workspace.lessons-open .transcript-board.is-expanded > .section-head {
    flex: 0 0 auto;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 0;
  }

  .workspace.lessons-open .transcript-board.is-expanded > .transcript-panel {
    background: transparent;
    scrollbar-color: #a87838 transparent;
  }

  .workspace.lessons-open .transcript-board.is-expanded .transcript-panel button {
    appearance: none;
    border: 1px solid rgba(177, 133, 67, .24);
    border-radius: 10px;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 250, .52),
      rgba(250, 246, 226, .38)
    ) !important;
    box-shadow:
      0 2px 5px rgba(112, 78, 34, .09),
      inset 0 -1px 0 rgba(150, 109, 50, .06);
    filter: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  }

  .workspace.lessons-open .transcript-board.is-expanded .transcript-panel button:hover {
    border-color: rgba(166, 116, 48, .42);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 252, .78),
      rgba(252, 248, 231, .58)
    ) !important;
    transform: translateY(-2px);
    box-shadow:
      0 8px 16px rgba(112, 78, 34, .17),
      inset 0 -1px 0 rgba(150, 109, 50, .08);
  }

  .workspace.lessons-open .transcript-board.is-expanded .transcript-panel button:active {
    transform: translateY(1px) scale(.995);
    box-shadow:
      inset 0 3px 7px rgba(112, 78, 34, .16);
  }

  .workspace.lessons-open .transcript-board.is-expanded .transcript-panel button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .workspace.lessons-open .transcript-board.is-expanded .transcript-panel button.active {
    border-color: color-mix(in srgb, var(--accent) 48%, #b88b49);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 252, .82),
      color-mix(in srgb, var(--accent) 7%, rgba(250, 246, 226, .6))
    ) !important;
    box-shadow:
      inset 4px 0 0 var(--accent),
      0 6px 13px rgba(112, 78, 34, .14);
  }

  .workspace.lessons-open .transcript-board.is-expanded > .transcript-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 820px) {
  .transcript-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .transcript-expand-toggle {
    max-width: 100%;
  }
}
/* Opening a level must not stretch every column to the lesson list height. */
@media (min-width: 821px) {
  .workspace.lessons-open {
    align-items: stretch;
  }
  .workspace.lessons-open.lesson-running {
    height: var(--lesson-workspace-height);
    min-height: var(--lesson-workspace-height);
    max-height: var(--lesson-workspace-height);
  }
  .workspace.lessons-open.lesson-running .center-column {
    grid-auto-rows: max-content;
  }

  .workspace.lessons-open .library-column,
  .workspace.lessons-open .center-column {
    align-self: stretch;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .workspace.lessons-open.lesson-running .center-column {
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-gutter: stable;
  }

  .workspace.lessons-open .library-column {
    position: static;
    top: auto;
  }

  .workspace.lessons-open .lesson-side-list {
    position: static;
    top: auto;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
    contain: size;
  }

  .workspace.lessons-open .side-lessons {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 18px;
  }

  .workspace.lessons-open .side-lessons::after {
    content: "";
    width: 100%;
    height: 18px;
  }
}

/* Scale the desktop composition as one canvas on every non-mobile viewport. */
@media (min-width: 821px) {
  body {
    overflow-x: hidden;
  }

  .chalk-app {
    width: 1480px;
    max-width: none;
    margin-inline: auto;
    transform-origin: top center;
  }
}

/* Fallback scale bands for browsers without typed CSS division. */
@media (min-width: 821px) and (max-width: 920px) {
  .chalk-app { zoom: .68; }
}

@media (min-width: 921px) and (max-width: 1024px) {
  .chalk-app { zoom: .775; }
}

@media (min-width: 1025px) and (max-width: 1200px) {
  .chalk-app { zoom: .84; }
}

@media (min-width: 1201px) and (max-width: 1600px) {
  .chalk-app { zoom: .85; }
}

@media (min-width: 1601px) and (max-width: 2000px) {
  .chalk-app { zoom: .85; }
}

@media (min-width: 2001px) {
  .chalk-app { zoom: .85; }
}

@supports (zoom: calc(100vw / 1480px)) {
  @media (min-width: 821px) {
    .chalk-app {
      zoom: clamp(.62, min(calc(100vw / 1480px), calc(100vh / 900px)), .85);
    }
  }
}


@media (min-width: 821px) {
  .workspace.homework-workspace > .center-column:has(> .homework-selection-state) {
    grid-template-rows: minmax(0, 1fr);
  }

  .workspace.homework-workspace > .center-column > .homework-selection-state {
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
  }
}

/* Homework keeps a stable three-column workspace when switching levels or tasks. */
@media (min-width: 821px) {
  .workspace.homework-workspace {
    min-height:560px;
  }
}


/* Homework columns share one row height in every homework screen. */
@media (min-width: 821px) {
  .workspace.homework-workspace {
    align-items: stretch;
  }

  .workspace.homework-workspace > .library-column,
  .workspace.homework-workspace > .center-column,
  .workspace.homework-workspace > .premium-column {
    align-self: stretch;
    height: 100%;
  }
}


/* Homework grid rows must not grow from inner panel min-content. */
@media (min-width: 821px) {
  .workspace.homework-workspace {
    overflow: hidden;
  }

  .workspace.homework-workspace[style*="height:"] {
    min-height: 0;
  }

  .workspace.homework-workspace > .library-column,
  .workspace.homework-workspace > .center-column,
  .workspace.homework-workspace > .premium-column {
    min-height: 0;
    overflow: hidden;
  }

  .workspace.homework-workspace > .center-column {
    overflow: auto;
    border-radius: 22px;
  }
}


/* Mobile homework player uses the same single-canvas flow as the lesson player. */
@media (max-width: 820px) {
  .mobile-screen-homework-player .workspace {
    display: block !important;
    width: 100%;
    height: calc(100dvh - 60px);
    min-height: 0;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .mobile-screen-homework-player .library-column,
  .mobile-screen-homework-player .premium-column {
    display: none !important;
  }

  .mobile-screen-homework-player .center-column {
    width: 100%;
    max-width: none;
    min-height: 100%;
    display: block !important;
    padding: 0;
    overflow: visible;
  }

  .mobile-screen-homework-player .hw-embedded {
    width: 100%;
    min-height: calc(100dvh - 76px);
    height: auto;
    border-radius: 14px;
  }
}

.player-options-toggle {
  display: none;
}

@media (max-width: 820px) {
  .controls-panel {
    gap: 4px;
  }

  .controls-panel .player-options-toggle {
    width: 52px;
    height: 14px;
    min-height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
  }

  .controls-panel .player-options-toggle span {
    width: 36px;
    height: 4px;
    display: block;
    border-radius: 999px;
    background: rgba(103, 80, 164, 0.34);
    box-shadow: 0 1px 3px rgba(67, 51, 112, 0.16);
    transition: width .18s ease, background .18s ease, transform .18s ease;
  }

  .controls-panel .player-options-toggle:hover span,
  .controls-panel .player-options-toggle[aria-expanded="true"] span {
    width: 44px;
    background: #6750a4;
  }

  .controls-panel .player-options-row {
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
  }

  .controls-panel .player-options-row.is-open {
    display: grid;
  }

  .controls-panel .player-options-row > .speed-row,
  .controls-panel .player-options-row > .voice-row,
  .controls-panel .player-options-row > .pause-row {
    width: 100%;
    box-sizing: border-box;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    height: calc(100dvh - 180px);
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto minmax(140px, .45fr);
    overflow: hidden;
  }

  .mobile-screen-player .practice-board.intro-playing .intro-actions {
    position: relative;
    top: -80px;
    margin-bottom: -80px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand {
    min-height: 140px;
    padding: 8px 0 10px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand img {
    width: min(52vw, 210px);
    max-height: 140px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand strong {
    font-size: clamp(22px, 6vw, 28px);
  }
}
@media (max-width: 820px) {
  .mobile-screen-player:has(.practice-board.intro-playing) .workspace {
    height: calc(100dvh - 60px);
    overflow: hidden;
  }

  .mobile-screen-player:has(.practice-board.intro-playing) .center-column,
  .mobile-screen-player:has(.practice-board.intro-playing) .practice-board.intro-playing {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto minmax(100px, .28fr);
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand {
    min-height: 100px;
    padding: 4px 0 6px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand img {
    width: min(46vw, 180px);
    max-height: 100px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand strong {
    font-size: clamp(20px, 5.5vw, 25px);
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    height: 100%;
    min-height: 0;
    grid-template-rows: 360px auto 150px;
    align-content: start;
  }

  .mobile-screen-player .practice-board.intro-playing .intro-actions {
    top: 0;
    margin-bottom: 0;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand {
    min-height: 150px;
    padding: 4px 0 6px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand img {
    width: min(44vw, 170px);
    max-height: 120px;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    grid-template-rows: 330px auto 220px;
  }

  .mobile-screen-player .practice-board.intro-playing .intro-actions {
    margin-bottom: 32px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand {
    min-height: 220px;
    padding: 8px 0 14px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand img {
    width: min(68vw, 280px);
    max-height: 190px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand strong {
    font-size: clamp(24px, 7vw, 32px);
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .practice-board.intro-playing,
  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    box-sizing: border-box;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand img {
    top: 50%;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    grid-template-rows: 330px auto 250px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand {
    min-height: 250px;
  }

  .mobile-screen-player .practice-board.intro-playing .mobile-intro-brand img {
    top: 38%;
    max-height: 190px;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    height: calc(100% - 14px);
  }
}
@media (max-width: 820px) {
  /* Leave a real bottom strip between the white board and the blue frame. */
  .mobile-screen-player:has(.practice-board.intro-playing) .center-column {
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding-bottom: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #edf5fc, #e8f1f8);
  }

  .mobile-screen-player .practice-board.intro-playing {
    height: calc(100% - 14px) !important;
    max-height: calc(100% - 14px) !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box;
    background: #fff;
  }
}
.player-actions {
  position: relative;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (max-width: 820px) {
  .player-actions {
    width: 100%;
    min-height: 42px;
    flex-wrap: nowrap;
  }

  .player-controls {
    margin: 0 auto;
  }

  .player-actions > .translation-toggle {
    position: absolute;
    right: 0;
    width: 42px;
    flex: 0 0 42px;
    min-height: 42px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }

  .player-actions > .translation-toggle span {
    display: none;
  }

  .player-actions > .translation-toggle svg {
    width: 18px;
    height: 18px;
  }
}
@media (max-width: 820px) {
  .player-actions > .translation-toggle {
    left: 0;
    right: auto;
    width: 31px;
    height: 31px;
    min-height: 31px;
    flex: 0 0 31px;
    border-width: 1px;
    border-radius: 999px;
  }

  .player-actions > .translation-toggle svg {
    width: 14px;
    height: 14px;
  }
}
@media (max-width: 820px) {
  .player-controls {
    position: relative;
  }

  .player-controls > .translation-toggle {
    position: absolute;
    left: -37px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 31px;
    height: 31px;
    min-height: 31px;
    flex: 0 0 31px;
  }

  .player-controls > .translation-toggle:hover {
    transform: translateY(-50%);
  }
}
@media (max-width: 820px) {
  .player-controls {
    width: max-content;
    margin: 0 auto;
  }

  .player-controls > .translation-toggle span {
    display: none;
  }

  .player-controls > .translation-toggle {
    font-size: 0;
  }
}
@media (max-width: 820px) {
  /* Align the Play button itself with the centered options handle. */
  .player-controls {
    transform: translateX(18px);
  }
}
@media (min-width: 821px) {
  /* Keep the transport controls centered; the translation toggle is a compact side action. */
  .player-controls {
    position: relative;
    width: max-content;
    margin: 0 auto;
  }

  .player-controls > .translation-toggle {
    position: absolute;
    left: -37px;
    top: 50%;
    transform: translateY(-50%);
    width: 31px;
    height: 31px;
    min-height: 31px;
    flex: 0 0 31px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }

  .player-controls > .translation-toggle span {
    display: none;
  }

  .player-controls > .translation-toggle svg {
    width: 14px;
    height: 14px;
  }

  .player-controls > .translation-toggle:hover {
    transform: translateY(-50%);
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .recording-board > p {
    display: none;
  }
}
.recording-board .soft-btn.has-audio {
  border: 2px solid var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 167, 240, 0.1);
}
@media (max-width: 820px) {
  /* Mobile transcript: keep the collapsed list compact and scroll only its rows. */
  .mobile-screen-player .transcript-board:not(.is-expanded) > .transcript-panel {
    max-height: 190px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  /* Expanded transcript becomes its own full-screen canvas. */
  .mobile-screen-player .transcript-board.is-expanded {
    position: fixed;
    z-index: 100;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 18px 14px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--panel);
  }

  .mobile-screen-player .transcript-board.is-expanded > .section-head {
    flex: 0 0 auto;
  }

  .mobile-screen-player .transcript-board.is-expanded > .transcript-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
}
@media (max-width: 820px) {
  /* Use the same parchment transcript canvas on mobile when expanded. */
  .mobile-screen-player .transcript-board.is-expanded {
    padding: 58px 18px 96px;
    background: transparent url("./assets/shared-scroll-vertical.webp?v=1") center / 100% 100% no-repeat;
    filter: drop-shadow(0 16px 22px rgba(55, 43, 30, .22));
  }

  .mobile-screen-player .transcript-board.is-expanded > .transcript-panel {
    background: transparent;
    scrollbar-color: #a87838 transparent;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-panel button {
    border: 1px solid rgba(177, 133, 67, .24);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 250, .72), rgba(250, 246, 226, .52));
    box-shadow: 0 2px 5px rgba(112, 78, 34, .09), inset 0 -1px 0 rgba(150, 109, 50, .06);
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded {
    padding-top: 40px;
  }

  .mobile-screen-player .transcript-board.is-expanded > .section-head {
    align-items: flex-start;
  }

  .mobile-screen-player .transcript-board.is-expanded > .section-head > span {
    transform: translateY(-4px);
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-heading-actions {
    align-items: flex-start;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .section-head {
    position: relative;
    padding-right: 148px;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-heading-actions {
    width: auto;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-expand-toggle {
    position: absolute;
    top: 0;
    right: 0;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding-right: 0;
  }

  .mobile-screen-player .transcript-board.is-expanded > .section-head > span {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(20px, 5.8vw, 30px);
    line-height: 1;
    white-space: nowrap;
    text-overflow: clip;
    transform: none;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-heading-actions {
    display: contents;
    width: auto;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-heading-actions > strong {
    white-space: nowrap;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-expand-toggle {
    position: static;
    white-space: nowrap;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .section-head > span {
    font-size: clamp(16px, 4.5vw, 24px);
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-heading-actions > strong {
    font-size: 12px;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-expand-toggle {
    min-height: 28px;
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-expand-toggle > span {
    font-size: 14px;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .section-head > span {
    font-size: clamp(13px, 3.4vw, 18px);
    letter-spacing: -0.02em;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .section-head > span {
    transform: translateX(8px);
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded .transcript-expand-toggle {
    position: relative;
    top: 6px;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .transcript-panel {
    margin-top: 12px;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .transcript-panel {
    min-width: 0;
    overflow-x: hidden;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-panel button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 5px 9px;
    padding: 10px;
  }
}
@media (max-width: 820px) {
  .mobile-screen-player .transcript-board.is-expanded > .transcript-panel {
    width: calc(100% - 10px);
    max-width: calc(100% - 10px);
    box-sizing: border-box;
    padding-right: 10px;
  }

  .mobile-screen-player .transcript-board.is-expanded .transcript-panel button {
    width: 100%;
    max-width: 100%;
    justify-self: start;
  }
}
@media (max-width: 820px) {
  /* The mobile intro must scroll vertically instead of clipping its lower canvas. */
  .mobile-screen-player:has(.practice-board.intro-playing) .workspace {
    height: calc(100dvh - 60px);
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .mobile-screen-player:has(.practice-board.intro-playing) .center-column {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .mobile-screen-player .practice-board.intro-playing {
    height: auto !important;
    max-height: none !important;
    min-height: calc(100dvh - 76px);
    overflow: visible;
  }

  .mobile-screen-player .practice-board.intro-playing .player-canvas {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
}