/*
 * Yeong-Ba-Twi professional learner UI refresh.
 *
 * This layer is intentionally isolated from the legacy stylesheet so the
 * trial design can be removed by deleting one <link> and the two page classes.
 * It does not change the New York day/night training scene.
 */

:root {
  --ybt-navy-950: #07172d;
  --ybt-navy-900: #0b203b;
  --ybt-navy-800: #12345a;
  --ybt-blue-600: #2563eb;
  --ybt-blue-500: #3784f6;
  --ybt-teal-500: #14b8a6;
  --ybt-teal-400: #2dd4bf;
  --ybt-slate-700: #3e526d;
  --ybt-slate-500: #708198;
  --ybt-slate-300: #cbd7e6;
  --ybt-slate-200: #dfe7f1;
  --ybt-slate-100: #edf2f7;
  --ybt-surface: #ffffff;
  --ybt-canvas: #f4f7fb;
  --ybt-radius-sm: 10px;
  --ybt-radius-md: 16px;
  --ybt-radius-lg: 24px;
  --ybt-shadow-sm: 0 6px 18px rgba(11, 32, 59, 0.06);
  --ybt-shadow-md: 0 18px 48px rgba(11, 32, 59, 0.09);
  --ybt-focus: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* --------------------------------------------------------------------------
   Learning room
   -------------------------------------------------------------------------- */

body.page-learning-room {
  background:
    radial-gradient(circle at 14% -8%, rgba(45, 212, 191, 0.13), transparent 30%),
    radial-gradient(circle at 92% 2%, rgba(37, 99, 235, 0.10), transparent 27%),
    var(--ybt-canvas);
  color: var(--ybt-navy-950);
}

body.page-learning-room::before {
  height: 4px;
  background: linear-gradient(90deg, var(--ybt-navy-900), var(--ybt-teal-500) 52%, var(--ybt-blue-600));
}

body.page-learning-room .room-wrap {
  width: min(1160px, calc(100% - 40px));
  padding: 34px 0 72px;
}

body.page-learning-room .room-head {
  align-items: center;
  margin-bottom: 24px;
}

body.page-learning-room .room-eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.035em;
}

body.page-learning-room .room-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 850;
  letter-spacing: -0.045em;
}

body.page-learning-room .room-subtitle--dashboard {
  margin-top: 10px;
  gap: 4px;
}

body.page-learning-room .room-subtitle__learner {
  color: var(--ybt-slate-700);
  font-size: 0.98rem;
}

body.page-learning-room .room-subtitle__meta {
  color: var(--ybt-slate-500);
  font-size: 0.84rem;
}

body.page-learning-room .room-grid {
  gap: 18px;
}

body.page-learning-room .room-overview {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.8fr);
  gap: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--ybt-radius-lg);
  padding: 28px 30px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(45, 212, 191, 0.25), transparent 34%),
    linear-gradient(135deg, var(--ybt-navy-950), var(--ybt-navy-800));
  box-shadow: 0 24px 56px rgba(7, 23, 45, 0.20);
}

body.page-learning-room .room-overview::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -88px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.025), 0 0 0 72px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

body.page-learning-room .room-overview__main,
body.page-learning-room .room-overview__stats {
  position: relative;
  z-index: 1;
}

body.page-learning-room .room-overview__eyebrow {
  margin: 0 0 8px;
  color: #8ce9df;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

body.page-learning-room .room-overview__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.28;
}

body.page-learning-room .room-overview__meta {
  min-height: 1.5em;
  margin: 9px 0 20px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.9rem;
  line-height: 1.6;
}

body.page-learning-room .room-overview__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 0 18px;
  color: var(--ybt-navy-950);
  background: #fff;
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

body.page-learning-room .room-overview__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

body.page-learning-room .room-overview__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

body.page-learning-room .room-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 16px 8px;
  text-align: center;
}

body.page-learning-room .room-stat + .room-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.10);
}

body.page-learning-room .room-stat__value {
  color: #fff;
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

body.page-learning-room .room-stat__label {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.68);
  font-size: 0.72rem;
  font-weight: 650;
}

body.page-learning-room .room-policy {
  border-color: rgba(20, 184, 166, 0.18);
  border-radius: var(--ybt-radius-md);
  padding: 12px 16px;
  color: #496078;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--ybt-shadow-sm);
  backdrop-filter: blur(12px);
}

body.page-learning-room .room-policy strong {
  color: var(--ybt-navy-800);
}

body.page-learning-room .room-policy__button,
body.page-learning-room .room-policy-dialog__button {
  min-height: 38px;
  border-color: var(--ybt-slate-200);
  border-radius: 10px;
  color: var(--ybt-navy-800);
}

body.page-learning-room .room-toolbar {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

body.page-learning-room .room-search {
  position: relative;
  grid-column: auto;
}

body.page-learning-room .room-search::before {
  content: "⌕";
  position: absolute;
  top: 50%;
  left: 17px;
  z-index: 1;
  color: var(--ybt-slate-500);
  font-size: 1.15rem;
  transform: translateY(-52%);
  pointer-events: none;
}

body.page-learning-room .room-search__input {
  min-height: 52px;
  border-color: var(--ybt-slate-200);
  border-radius: 14px;
  padding-left: 46px;
  color: var(--ybt-navy-950);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--ybt-shadow-sm);
}

body.page-learning-room .room-search__input:focus {
  border-color: var(--ybt-blue-500);
  box-shadow: var(--ybt-focus), var(--ybt-shadow-sm);
}

body.page-learning-room .room-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 3px;
  scrollbar-width: none;
}

body.page-learning-room .room-filters::-webkit-scrollbar {
  display: none;
}

body.page-learning-room .room-filter {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--ybt-slate-200);
  border-radius: 11px;
  padding: 0 13px;
  color: #52667f;
  background: rgba(255, 255, 255, 0.84);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

body.page-learning-room .room-filter:hover {
  border-color: #a9c0df;
  color: var(--ybt-blue-600);
}

body.page-learning-room .room-filter[aria-pressed="true"] {
  border-color: var(--ybt-navy-900);
  color: #fff;
  background: var(--ybt-navy-900);
  box-shadow: 0 8px 18px rgba(11, 32, 59, 0.16);
}

body.page-learning-room .room-section,
body.page-learning-room .room-denied,
body.page-learning-room .room-archive {
  border-color: rgba(135, 154, 179, 0.20);
  border-radius: var(--ybt-radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--ybt-shadow-md);
  backdrop-filter: blur(16px);
}

body.page-learning-room .room-section {
  padding: 22px;
}

body.page-learning-room .room-section::before {
  display: none;
}

body.page-learning-room .room-section__title {
  margin-bottom: 18px;
  color: var(--ybt-navy-950);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

body.page-learning-room .room-section__icon {
  color: var(--ybt-blue-600);
  background: #edf4ff;
}

body.page-learning-room .room-learning-list {
  gap: 12px;
}

body.page-learning-room .room-card {
  min-height: 154px;
  border-color: rgba(151, 169, 193, 0.26);
  border-radius: var(--ybt-radius-md);
  padding: 15px;
  background: var(--ybt-surface);
  box-shadow: 0 5px 16px rgba(11, 32, 59, 0.045);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.page-learning-room .room-card::before {
  height: 3px;
  background: linear-gradient(90deg, var(--ybt-blue-500), var(--ybt-teal-400));
  opacity: 0.72;
}

body.page-learning-room .room-card:hover {
  border-color: rgba(37, 99, 235, 0.30);
  box-shadow: 0 14px 30px rgba(11, 32, 59, 0.10);
  transform: translateY(-2px);
}

body.page-learning-room .room-card[class*="card--milestone-"] {
  border-color: rgba(151, 169, 193, 0.26);
  background: var(--ybt-surface);
  box-shadow: 0 5px 16px rgba(11, 32, 59, 0.045);
}

body.page-learning-room .room-card[data-is-favorite="true"] {
  border-color: rgba(214, 158, 46, 0.42);
  box-shadow: 0 7px 20px rgba(133, 89, 10, 0.08);
}

body.page-learning-room .room-card__favorite {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 0 0 31px;
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 50%;
  padding: 0;
  color: #75869c;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.07);
  font: inherit;
  font-size: 1.18rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease,
    box-shadow 0.18s ease, transform 0.16s ease;
}

body.page-learning-room .room-card__favorite:hover {
  color: #a96800;
  background: #fffaf0;
  transform: translateY(-1px);
}

body.page-learning-room .room-card__favorite[aria-pressed="true"] {
  border-color: rgba(226, 164, 34, 0.52);
  color: #df9200;
  background: radial-gradient(circle at 50% 46%, #fffdf3 0 30%, #fff2b8 72%, #ffe58a 100%);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.10), 0 0 13px rgba(245, 158, 11, 0.30);
  text-shadow: 0 0 7px rgba(255, 193, 7, 0.52);
}

body.page-learning-room .room-card__favorite[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.98) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 24%, rgba(255, 255, 255, 0.92) 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 80% 72%, rgba(255, 193, 7, 0.78) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 76%, rgba(255, 255, 255, 0.86) 0 0.9px, transparent 1.9px);
  animation: room-favorite-sparkle 1.8s ease-in-out infinite;
}

body.page-learning-room .room-card__favorite:disabled {
  opacity: 0.55;
  cursor: wait;
}

body.page-learning-room .room-card__favorite[hidden] {
  display: none;
}

body.page-learning-room .room-card__title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-width: 100%;
  gap: 10px;
}

@keyframes room-favorite-sparkle {
  0%, 100% { opacity: 0.48; transform: scale(0.92) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.08) rotate(8deg); }
}

body.page-learning-room .room-card__label {
  color: #52667f;
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}

body.page-learning-room .room-card__label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ybt-teal-500);
}

body.page-learning-room .room-card__milestone-badge,
body.page-learning-room .room-card__status-badge {
  min-height: 20px;
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 0.65rem;
  box-shadow: none;
}

body.page-learning-room .room-card__status-badge--new {
  border-color: #c4b5fd;
  color: #6d28d9;
  background: #f5f3ff;
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.06);
}

body.page-learning-room .room-card__status-badge--best {
  border-color: #fde68a;
  color: #8a5a00;
  background: #fffbeb;
}

body.page-learning-room .room-card__status-badge--warning {
  border-color: #fdba74;
  color: #9a4a08;
  background: #fff7ed;
}

body.page-learning-room .room-card__status-badge--urgent {
  border-color: #fca5a5;
  color: #b42318;
  background: #fff1f2;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.05);
}

body.page-learning-room .room-card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  color: var(--ybt-navy-950);
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.36;
  letter-spacing: -0.025em;
}

body.page-learning-room .room-card__text-main {
  display: -webkit-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.page-learning-room .room-card__text-note {
  display: -webkit-box;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: #667a93;
  font-size: 0.72em;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.page-learning-room .room-card__progress {
  margin-top: 7px;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f6f8fb;
}

body.page-learning-room .room-card__progress span:first-child,
body.page-learning-room .room-card__progress span:last-child {
  font-size: 0.72rem;
}

body.page-learning-room .room-card__levels {
  display: block;
  margin-top: 9px;
}

body.page-learning-room .room-card__levels-desktop {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body.page-learning-room .room-card__mobile-levels {
  display: none;
}

body.page-learning-room .room-card__level-link {
  min-width: 64px;
  min-height: 40px;
  border-color: var(--ybt-slate-200);
  border-radius: var(--ybt-radius-sm);
  padding: 0 11px;
  color: var(--ybt-navy-800);
  background: #fff;
  font-size: 0.78rem;
  box-shadow: none;
}

body.page-learning-room .room-card__level-link:last-child {
  border-color: rgba(37, 99, 235, 0.42);
  color: #fff;
  background: linear-gradient(135deg, #194b78 0%, #2f6fbd 58%, #238b87 100%);
  box-shadow: 0 7px 16px rgba(31, 93, 147, 0.18);
}

body.page-learning-room .room-card__level-link:hover {
  border-color: var(--ybt-blue-600);
  color: var(--ybt-blue-600);
  background: #f5f9ff;
  box-shadow: none;
  transform: translateY(-1px);
}

body.page-learning-room .room-card__level-link:last-child:hover {
  color: #fff;
  background: linear-gradient(135deg, #153f68 0%, #285fa5 58%, #1d7775 100%);
}

body.page-learning-room .room-archive {
  padding: 18px 20px;
}

body.page-learning-room .room-archive > summary {
  color: var(--ybt-slate-700);
  font-size: 0.92rem;
}

body.page-learning-room :is(a, button, input, summary):focus-visible {
  outline: none;
  box-shadow: var(--ybt-focus);
}

/* --------------------------------------------------------------------------
   Pre-start settings. The New York scene remains owned by train.html.
   -------------------------------------------------------------------------- */

body.page-train.prestart-mode .page {
  max-width: 840px;
  padding: 20px 18px 54px;
}

body.page-train.prestart-mode .hero-prestart {
  max-width: 46rem;
  padding-top: 4px;
}

body.page-train.prestart-mode .hero-prestart__eyebrow {
  color: #5eead4;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.38);
}

body.page-train.prestart-mode .hero-prestart__brand {
  color: #f8fbff;
  -webkit-text-fill-color: #f8fbff;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  letter-spacing: 0.055em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
}

body.page-train.prestart-mode .hero-prestart__tagline {
  color: rgba(248, 250, 252, 0.92);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.48);
}

body.page-train.prestart-mode .hero-prestart__hint {
  color: rgba(226, 232, 240, 0.75);
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.48);
}

body.page-train.prestart-mode #global-feedbacks {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px);
}

body.page-train.prestart-mode #global-feedbacks .status-strip {
  border-radius: 12px;
  color: #35516e;
  background: #eefaf6;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  padding: 20px;
  border-color: rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  background: rgba(244, 248, 252, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::before {
  height: 4px;
  background: linear-gradient(90deg, var(--ybt-blue-600), var(--ybt-teal-500));
}

body.page-train.prestart-mode .prestart-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

body.page-train.prestart-mode #word-mode-prestart-extras:not(.hidden),
body.page-train.prestart-mode #word-mode-prestart-extras:not(.hidden) .prestart-advanced {
  display: contents;
}

body.page-train.prestart-mode .prestart-body > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block {
  min-width: 0;
  min-height: 108px;
  padding: 16px;
  border-color: var(--ybt-slate-200);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(11, 32, 59, 0.055);
}

body.page-train.prestart-mode #prestart-training-policy-banner {
  grid-column: 1 / -1;
  min-height: 0;
}

body.page-train.prestart-mode .prestart-body > .opt-block:last-of-type {
  grid-column: 1 / -1;
  min-height: 96px;
}

body.page-train.prestart-mode .opt-label {
  margin-bottom: 11px;
  color: var(--ybt-slate-700);
  font-size: 0.78rem;
  font-weight: 800;
}

body.page-train.prestart-mode .opt-chips {
  gap: 7px;
}

body.page-train.prestart-mode .opt-chip {
  min-width: 46px;
  min-height: 42px;
  border-color: var(--ybt-slate-200);
  border-radius: 11px;
  color: var(--ybt-navy-800);
  background: #fff;
  box-shadow: none;
}

body.page-train.prestart-mode .opt-chip:hover {
  border-color: #9eb7d7;
  color: var(--ybt-blue-600);
  transform: translateY(-1px);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active {
  border-color: var(--ybt-navy-900);
  color: #fff;
  background: linear-gradient(135deg, var(--ybt-navy-900), #18566d);
  box-shadow: 0 9px 20px rgba(11, 32, 59, 0.18);
}

body.page-train.prestart-mode .prestart-footer {
  position: sticky;
  bottom: 12px;
  z-index: 12;
  margin-top: 14px;
  border: 1px solid rgba(203, 215, 230, 0.88);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(11, 32, 59, 0.14);
  backdrop-filter: blur(18px);
}

body.page-train.prestart-mode .prestart-footer__actions {
  gap: 8px;
}

body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  min-height: 48px;
  border-radius: 12px;
  padding-inline: 20px;
}

body.page-train.prestart-mode .btn--prestart-secondary {
  border-color: var(--ybt-slate-200);
  color: var(--ybt-slate-700);
  background: #fff;
}

body.page-train.prestart-mode #btn-prestart-start {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--ybt-blue-600), #167a83);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

body.page-train.prestart-mode :is(a, button):focus-visible {
  outline: none;
  box-shadow: var(--ybt-focus);
}

@media (max-width: 840px) {
  body.page-learning-room .room-overview {
    grid-template-columns: 1fr;
  }

  body.page-learning-room .room-overview__stats {
    min-height: 100px;
  }

  body.page-learning-room .room-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.page-learning-room .room-wrap {
    width: min(100% - 24px, 560px);
    padding-top: 22px;
  }

  body.page-learning-room .room-grid {
    gap: 12px;
  }

  body.page-learning-room .room-head {
    margin-bottom: 18px;
  }

  body.page-learning-room .room-overview {
    gap: 20px;
    border-radius: 20px;
    padding: 22px 20px;
  }

  body.page-learning-room .room-overview__action {
    width: 100%;
  }

  body.page-learning-room .room-policy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    font-size: 0.76rem;
    line-height: 1.35;
  }

  body.page-learning-room .room-policy > span {
    min-width: 0;
  }

  body.page-learning-room .room-policy__button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  body.page-learning-room .room-toolbar {
    gap: 8px;
  }

  body.page-learning-room .room-search::before {
    left: 14px;
    font-size: 1rem;
  }

  body.page-learning-room .room-search__input {
    min-height: 46px;
    border-radius: 12px;
    padding-left: 40px;
    font-size: 0.9rem;
  }

  body.page-learning-room .room-filters {
    margin-right: -12px;
    gap: 5px;
    padding: 1px 12px 1px 1px;
  }

  body.page-learning-room .room-filter {
    min-height: 36px;
    border-radius: 9px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  body.page-learning-room .room-section {
    border-radius: 20px;
    padding: 16px;
  }

  body.page-learning-room .room-card {
    min-height: 0;
  }

  body.page-learning-room .room-card__level-link {
    min-height: 44px;
  }
}

/* Learner level chooser: a focused, branded alternative to the native select menu. */
body.page-learning-room .room-level-dialog {
  width: min(420px, calc(100% - 28px));
  max-width: 420px;
  max-height: min(82vh, 620px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: #102f55;
  background: transparent;
  overflow: visible;
}

body.page-learning-room .room-level-dialog::backdrop {
  background: rgba(7, 22, 47, 0.5);
  -webkit-backdrop-filter: blur(7px) saturate(112%);
  backdrop-filter: blur(7px) saturate(112%);
}

body.page-learning-room .room-level-dialog__panel {
  position: relative;
  overflow: hidden;
  padding: 30px 22px 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 6%, rgba(45, 212, 191, 0.2), transparent 34%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(232, 243, 255, 0.96) 58%, rgba(229, 249, 247, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 28px 70px rgba(5, 27, 58, 0.3),
    0 0 0 1px rgba(93, 164, 224, 0.18);
}

body.page-learning-room .room-level-dialog__panel::before {
  content: "";
  position: absolute;
  inset: 0 28px auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), transparent);
}

body.page-learning-room .room-level-dialog__handle {
  display: none;
  width: 44px;
  height: 5px;
  margin: -16px auto 18px;
  border-radius: 999px;
  background: rgba(77, 113, 151, 0.22);
}

body.page-learning-room .room-level-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(112, 143, 177, 0.2);
  border-radius: 999px;
  padding: 0 0 2px;
  color: #45617f;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgba(21, 61, 105, 0.08);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

body.page-learning-room .room-level-dialog__eyebrow {
  margin: 0 0 7px;
  color: #248d8d;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

body.page-learning-room .room-level-dialog h2 {
  margin: 0;
  color: #0b284a;
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

body.page-learning-room .room-level-dialog__key {
  display: inline-flex;
  max-width: 100%;
  margin: 10px 0 20px;
  border: 1px solid rgba(83, 146, 207, 0.16);
  border-radius: 999px;
  padding: 7px 12px;
  color: #526b86;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.84rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

body.page-learning-room .room-level-dialog__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.page-learning-room .room-level-dialog__option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 70px;
  padding: 0 14px;
  border: 1px solid rgba(73, 143, 210, 0.3);
  border-radius: 17px;
  color: #174d83;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(222, 238, 255, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -2px 5px rgba(48, 106, 164, 0.08),
    0 8px 18px rgba(29, 83, 139, 0.1);
  font: inherit;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body.page-learning-room .room-level-dialog__option strong {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

body.page-learning-room .room-level-dialog__option span {
  color: #66809b;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

body.page-learning-room .room-level-dialog__option:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

body.page-learning-room .room-level-dialog__option:hover,
body.page-learning-room .room-level-dialog__option:focus-visible {
  outline: none;
  border-color: rgba(45, 130, 215, 0.68);
  color: #fff;
  background: linear-gradient(135deg, #2f6fbd 0%, #3d83c4 56%, #32a39e 100%);
  box-shadow: 0 12px 26px rgba(47, 111, 189, 0.24);
  transform: translateY(-1px);
}

body.page-learning-room .room-level-dialog__option:hover span,
body.page-learning-room .room-level-dialog__option:focus-visible span {
  color: rgba(255, 255, 255, 0.84);
}

body.page-learning-room .room-level-dialog__option:active {
  transform: translateY(1px) scale(0.99);
}

body.page-learning-room .room-level-dialog__hint {
  margin: 16px 0 0;
  color: #71859a;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: center;
}

@media (max-width: 560px) {
  body.page-learning-room .room-level-dialog {
    width: min(100% - 20px, 420px);
    margin: auto auto 10px;
  }

  body.page-learning-room .room-level-dialog__panel {
    border-radius: 24px;
    padding: 28px 18px 20px;
  }

  body.page-learning-room .room-level-dialog__handle {
    display: block;
  }
}

/* Keep compact mobile cards stable even when a learner can access five levels. */
@media (max-width: 560px) {
  body.page-learning-room .room-card__levels-desktop {
    display: none;
  }

  body.page-learning-room .room-card__mobile-levels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    gap: 6px;
  }

  body.page-learning-room .room-card__mobile-start,
  body.page-learning-room .room-card__level-chooser {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  body.page-learning-room .room-card__mobile-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.40);
    padding: 0 7px;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, #194b78 0%, #2f6fbd 58%, #238b87 100%);
    box-shadow: 0 8px 18px rgba(31, 93, 147, 0.20);
    transition: filter 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  }

  body.page-learning-room .room-card__mobile-start:hover {
    color: #fff;
    filter: brightness(1.05);
    box-shadow: 0 10px 22px rgba(31, 93, 147, 0.24);
  }

  body.page-learning-room .room-card__mobile-start:active {
    filter: brightness(0.94);
    transform: translateY(1px);
  }

  body.page-learning-room .room-card__level-chooser {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(82, 153, 218, 0.62);
    padding: 0 12px;
    color: #fff;
    background: linear-gradient(135deg, #2f6fbd 0%, #4c8cca 58%, #32a39e 100%);
    box-shadow: 0 9px 20px rgba(47, 111, 189, 0.2);
    text-align: center;
    cursor: pointer;
    transition: filter 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  }

  body.page-learning-room .room-card__level-chooser-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    line-height: 1;
    transform: translateY(-1px);
  }

  body.page-learning-room .room-card__level-chooser:hover {
    filter: brightness(1.05);
    box-shadow: 0 11px 24px rgba(47, 111, 189, 0.25);
  }

  body.page-learning-room .room-card__level-chooser:active {
    filter: brightness(0.94);
    transform: translateY(1px);
  }

  body.page-learning-room .room-card__level-chooser:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.3);
    outline-offset: 2px;
  }

  body.page-learning-room .room-card__mobile-levels > :only-child {
    grid-column: 1 / -1;
  }
}

/* Compact two-column cards for ordinary phone widths. */
@media (min-width: 360px) and (max-width: 560px) {
  body.page-learning-room .room-learning-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.page-learning-room .room-section {
    padding: 12px;
  }

  body.page-learning-room .room-section__title {
    margin-bottom: 12px;
  }

  body.page-learning-room .room-card {
    min-width: 0;
    min-height: 0;
    gap: 6px;
    padding: 10px;
  }

  body.page-learning-room .room-card > div:first-child {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
  }

  body.page-learning-room .room-card__label {
    align-items: flex-start;
    min-height: 36px;
    margin-bottom: 0;
    gap: 4px;
    font-size: 0.68rem;
  }

  body.page-learning-room .room-card__badges {
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
    gap: 3px;
  }

  body.page-learning-room .room-card__milestone-badge,
  body.page-learning-room .room-card__status-badge {
    min-height: 18px;
    padding: 1px 5px;
    font-size: 0.59rem;
  }

  body.page-learning-room .room-card__text {
    display: flex;
    min-height: 2.55em;
    margin-top: 3px;
    font-size: 1.04rem;
    font-weight: 850;
    line-height: 1.28;
  }

  body.page-learning-room .room-card__text--long {
    font-size: 0.96rem;
  }

  body.page-learning-room .room-card__text--very-long {
    font-size: 0.88rem;
  }

  body.page-learning-room .room-card__text-note {
    font-size: 0.7em;
  }

  body.page-learning-room .room-card__favorite {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
    font-size: 1.12rem;
  }

  body.page-learning-room .room-card__title-row {
    grid-template-columns: minmax(0, 1fr) 31px;
    min-height: 31px;
    gap: 7px;
  }

  body.page-learning-room .room-card__progress {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 40px;
    margin-top: 5px;
    gap: 1px;
    padding: 5px 6px;
  }

  body.page-learning-room .room-card__progress span:first-child,
  body.page-learning-room .room-card__progress span:last-child {
    overflow: hidden;
    font-size: 0.64rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.page-learning-room .room-card__levels {
    width: 100%;
    margin-top: auto;
    padding-top: 6px;
  }

  body.page-learning-room .room-card__mobile-start,
  body.page-learning-room .room-card__level-chooser {
    min-height: 40px;
  }
}

/* Protect very narrow and legacy phones from cramped two-column cards. */
@media (max-width: 359px) {
  body.page-learning-room .room-learning-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body.page-train.prestart-mode .page {
    padding: 14px 12px 38px;
  }

  body.page-train.prestart-mode .hero-prestart__hint {
    display: none;
  }

  body.page-train.prestart-mode .prestart-body {
    grid-template-columns: 1fr;
  }

  body.page-train.prestart-mode #phase-prestart.prestart-panel {
    border-radius: 20px;
    padding: 15px;
  }

  body.page-train.prestart-mode .prestart-body > .opt-block,
  body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
  body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block {
    min-height: 0;
    padding: 14px;
  }

  body.page-train.prestart-mode .prestart-footer {
    bottom: 8px;
  }

  body.page-train.prestart-mode .prestart-footer__actions {
    display: grid;
    grid-template-columns: minmax(96px, 0.7fr) minmax(150px, 1.3fr);
    width: 100%;
  }
}

@media (max-width: 430px) {
  body.page-learning-room .room-overview__stats {
    min-height: 88px;
  }

  body.page-learning-room .room-stat {
    padding-inline: 4px;
  }

  body.page-learning-room .room-stat__value {
    font-size: 1.3rem;
  }

  body.page-learning-room .room-stat__label {
    font-size: 0.66rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-learning-room *,
  body.page-train.prestart-mode * {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

/* Canonical review experience: calm New York glass cards with one clear audio state. */
body.page-train.review-mode .review-panel {
  width: min(100%, 800px);
  max-width: 800px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.82), rgba(237, 247, 255, 0.7));
  box-shadow: 0 24px 64px rgba(31, 59, 91, 0.13);
  -webkit-backdrop-filter: blur(24px) saturate(142%);
  backdrop-filter: blur(24px) saturate(142%);
}

body.page-train.review-mode #session-review-list.review-list {
  display: grid;
  width: 100%;
  max-width: 748px;
  margin: 0 auto;
  gap: 14px;
}

body.page-train.review-mode .review-row {
  --review-accent: #197f9e;
  --review-accent-rgb: 25, 127, 158;
  --review-neon-rgb: 60, 211, 235;
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas:
    "num en"
    "num ko"
    "play play"
    "notice notice";
  gap: 6px 16px;
  min-width: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(var(--review-accent-rgb), 0.2);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.84));
  box-shadow: 0 12px 30px rgba(32, 64, 97, 0.085);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.page-train.review-mode .review-row:nth-child(5n + 2) {
  --review-accent: #2f67bd;
  --review-accent-rgb: 47, 103, 189;
  --review-neon-rgb: 84, 158, 255;
}

body.page-train.review-mode .review-row:nth-child(5n + 3) {
  --review-accent: #168c82;
  --review-accent-rgb: 22, 140, 130;
  --review-neon-rgb: 60, 224, 187;
}

body.page-train.review-mode .review-row:nth-child(5n + 4) {
  --review-accent: #b67924;
  --review-accent-rgb: 182, 121, 36;
  --review-neon-rgb: 255, 197, 77;
}

body.page-train.review-mode .review-row:nth-child(5n) {
  --review-accent: #d44d59;
  --review-accent-rgb: 212, 77, 89;
  --review-neon-rgb: 255, 105, 120;
}

body.page-train.review-mode .review-row::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--review-accent-rgb), 0.9), rgba(var(--review-accent-rgb), 0.08));
  pointer-events: none;
}

body.page-train.review-mode .review-row:hover,
body.page-train.review-mode .review-row:focus-visible,
body.page-train.review-mode .review-row.is-playing {
  border-color: rgba(var(--review-accent-rgb), 0.56);
  box-shadow:
    0 16px 36px rgba(32, 64, 97, 0.12),
    0 0 0 3px rgba(var(--review-accent-rgb), 0.1);
  outline: none;
}

body.page-train.review-mode .review-row.is-playing {
  border-color: rgba(var(--review-neon-rgb), 0.92);
  box-shadow:
    inset 0 0 8px rgba(var(--review-neon-rgb), 0.08),
    0 0 0 1px rgba(var(--review-neon-rgb), 0.28),
    0 0 16px rgba(var(--review-neon-rgb), 0.24),
    0 0 28px rgba(var(--review-neon-rgb), 0.1),
    0 12px 30px rgba(32, 64, 97, 0.085);
  transform: translateY(-1px);
}

body.page-train.review-mode .review-row__num {
  grid-area: num;
  display: grid;
  width: 58px;
  height: 52px;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, rgba(var(--review-accent-rgb), 0.82), var(--review-accent));
  box-shadow: 0 8px 18px rgba(var(--review-accent-rgb), 0.2);
  font-family: Arial, "Noto Sans KR", sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

body.page-train.review-mode .review-row__en {
  grid-area: en;
  margin: 0;
  color: #102a43;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  line-height: 1.34;
  font-weight: 850;
  letter-spacing: -0.018em;
  overflow-wrap: anywhere;
}

body.page-train.review-mode .review-row__ko {
  grid-area: ko;
  margin: 2px 0 0;
  color: #60758d;
  font-size: clamp(0.92rem, 2vw, 1.02rem);
  line-height: 1.5;
  font-weight: 620;
  word-break: keep-all;
}

body.page-train.review-mode .review-row__actions {
  grid-area: play;
  display: block;
  width: 100%;
  max-width: none;
  margin: 13px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

body.page-train.review-mode .review-row__actions .review-row__play {
  display: grid;
  grid-template-columns: 48px 70px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  max-width: none;
  min-height: 62px;
  height: auto;
  padding: 7px 17px 7px 8px;
  border: 1px solid rgba(var(--review-accent-rgb), 0.2);
  border-radius: 18px;
  color: #24496d;
  background: linear-gradient(145deg, rgba(248, 253, 255, 0.94), rgba(232, 244, 250, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.page-train.review-mode .review-row__play-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, rgba(var(--review-accent-rgb), 0.78), var(--review-accent));
  box-shadow: 0 8px 18px rgba(var(--review-accent-rgb), 0.2);
  font-size: 0.88rem;
}

body.page-train.review-mode .review-row__wave {
  color: var(--review-accent);
}

body.page-train.review-mode .review-row__wave > span {
  background: currentColor;
}

body.page-train.review-mode .review-row__play-label {
  justify-self: center;
  color: #24496d;
  font-weight: 800;
  text-align: center;
}

body.page-train.review-mode .review-row.is-playing .review-row__play-label,
body.page-train.review-mode .review-row__play[data-playing="true"] .review-row__play-label {
  color: var(--review-accent);
}

body.page-train.review-mode .review-row__actions .review-row__play:hover:not(:disabled),
body.page-train.review-mode .review-row__actions .review-row__play[data-playing="true"] {
  border-color: rgba(var(--review-accent-rgb), 0.48);
  color: var(--review-accent);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(var(--review-accent-rgb), 0.08));
}

body.page-train.review-mode .review-row__notice {
  grid-area: notice;
  margin: 3px 0 0;
  color: #9f3f3f;
  font-size: 0.82rem;
}

body.page-train.review-mode .review-actions {
  max-width: 748px;
  margin-inline: auto;
  padding-top: 18px;
}

/* The focus redo action occupies its own centered row, not half a grid column. */
body.page-train.review-mode .review-actions__secondary #btn-focus-redo {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  min-height: 54px;
  height: auto;
  box-sizing: border-box;
  padding: 14px 18px;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: clamp(0.95rem, 2.6vw, 1.06rem);
  border-color: rgba(71, 137, 147, 0.3);
  background: linear-gradient(145deg, #ffffff, #f0f9fa);
  color: #294760;
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(30, 64, 100, 0.06);
}

@media (max-width: 620px) {
  body.page-train.review-mode .review-panel {
    padding: 14px;
    border-radius: 24px;
  }

  body.page-train.review-mode #session-review-list.review-list {
    gap: 11px;
  }

  body.page-train.review-mode .review-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 5px 12px;
    padding: 18px 15px 15px;
    border-radius: 19px;
  }

  body.page-train.review-mode .review-row__num {
    width: 46px;
    height: 44px;
    border-radius: 15px;
    font-size: 1.06rem;
  }

  body.page-train.review-mode .review-row__actions .review-row__play {
    grid-template-columns: 44px 56px minmax(0, 1fr);
    gap: 8px;
    min-height: 58px;
    padding-right: 10px;
  }

  body.page-train.review-mode .review-row__play-icon {
    width: 42px;
    height: 42px;
  }

  body.page-train.review-mode .review-row__play-label {
    font-size: 0.87rem;
  }
}

/* Give the review heart its own grid cell so long sentences never run beneath it. */
body.page-train.review-mode .review-row.review-row--focusable {
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  grid-template-areas:
    "num en heart"
    "num ko ."
    "play play play"
    "notice notice notice";
}

body.page-train.review-mode .review-row--focusable .review-row__focus-wrap {
  position: relative;
  top: auto;
  right: auto;
  grid-area: heart;
  justify-self: end;
  align-self: start;
  width: 44px;
  height: auto;
}

body.page-train.review-mode .review-row--focusable .review-row__en {
  min-width: 0;
}

@media (max-width: 620px) {
  body.page-train.review-mode .review-row.review-row--focusable {
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    grid-template-areas:
      "num . heart"
      "en en en"
      "ko ko ko"
      "play play play"
      "notice notice notice";
  }

  body.page-train.review-mode .review-row--focusable .review-row__focus-wrap {
    width: 40px;
  }
}

/* --------------------------------------------------------------------------
   Glass UI — training settings and completion recording choice only.
   Interaction hooks, state classes, and layout outside these components remain
   owned by train.html.
   -------------------------------------------------------------------------- */

body.page-train.prestart-mode {
  overflow-x: hidden;
  overflow-y: auto;
}

body.page-train.prestart-mode .hero-prestart {
  position: relative;
  z-index: 1;
}

body.page-train.prestart-mode #global-feedbacks {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.70), rgba(222, 239, 255, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 38px rgba(7, 32, 67, 0.16);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

body.page-train.prestart-mode #global-feedbacks .status-strip {
  border: 1px solid rgba(255, 255, 255, 0.58);
  color: #23496b;
  background: rgba(236, 251, 249, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  background:
    radial-gradient(circle at 7% 0%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(145deg, rgba(240, 249, 255, 0.74), rgba(205, 229, 255, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(123, 180, 232, 0.18),
    0 28px 72px rgba(4, 30, 67, 0.24),
    0 8px 24px rgba(50, 142, 246, 0.12);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  backdrop-filter: blur(30px) saturate(155%);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::before {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98) 22%, #7dd3fc 54%, rgba(255, 255, 255, 0.88) 78%, transparent);
  box-shadow: 0 0 18px rgba(125, 211, 252, 0.7);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::after {
  content: "";
  position: absolute;
  top: -82px;
  left: -68px;
  width: 210px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  filter: blur(22px);
  pointer-events: none;
}

body.page-train.prestart-mode .prestart-body,
body.page-train.prestart-mode .prestart-footer {
  position: relative;
  z-index: 1;
}

body.page-train.prestart-mode .prestart-body > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(226, 241, 255, 0.45));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 9px 24px rgba(20, 73, 125, 0.09);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}

body.page-train.prestart-mode .opt-label {
  color: #284965;
  font-weight: 850;
  letter-spacing: 0.015em;
}

body.page-train.prestart-mode .opt-chip {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  color: #173c60;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(224, 239, 255, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 5px 14px rgba(24, 73, 121, 0.08);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body.page-train.prestart-mode .opt-chip:hover:not(.opt-chip--active):not(.opt-chip--disabled),
body.page-train.prestart-mode .opt-chip:focus-visible:not(.opt-chip--active):not(.opt-chip--disabled) {
  border-color: rgba(96, 165, 250, 0.72);
  color: #0b5db4;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(211, 235, 255, 0.8));
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 3px rgba(56, 139, 253, 0.15),
    0 8px 18px rgba(37, 99, 235, 0.12);
}

body.page-train.prestart-mode .opt-chip:active:not(.opt-chip--disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: inset 0 2px 8px rgba(20, 73, 125, 0.15);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active {
  border-color: rgba(170, 224, 255, 0.92);
  color: #fff;
  background:
    linear-gradient(150deg, rgba(45, 139, 255, 0.98), rgba(20, 112, 229, 0.96) 58%, rgba(20, 184, 166, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 5px rgba(4, 48, 119, 0.2),
    0 9px 23px rgba(37, 99, 235, 0.25),
    0 0 18px rgba(56, 189, 248, 0.16);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.42);
  outline-offset: 2px;
}

body.page-train.prestart-mode .opt-chip.opt-chip--disabled {
  opacity: 0.46;
  box-shadow: none;
}

body.page-train.prestart-mode .prestart-footer {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(215, 234, 253, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 18px 42px rgba(7, 32, 67, 0.18);
  -webkit-backdrop-filter: blur(25px) saturate(145%);
  backdrop-filter: blur(25px) saturate(145%);
}

body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  font-weight: 850;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

body.page-train.prestart-mode .btn--prestart-secondary {
  border-color: rgba(255, 255, 255, 0.9);
  color: #274863;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(222, 236, 250, 0.68));
  box-shadow: inset 0 1px 0 #fff, 0 7px 18px rgba(20, 73, 125, 0.1);
}

body.page-train.prestart-mode #btn-prestart-start {
  border-color: rgba(125, 211, 252, 0.72);
  background: linear-gradient(145deg, #2789ff, #1768df 62%, #12a8b3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 5px rgba(4, 48, 119, 0.25),
    0 11px 26px rgba(37, 99, 235, 0.3),
    0 0 20px rgba(56, 189, 248, 0.2);
}

body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start):active {
  transform: translateY(2px) scale(0.99);
  filter: brightness(0.97);
}

body.page-train .published-completion-overlay {
  background:
    radial-gradient(circle at 50% 34%, rgba(102, 183, 255, 0.16), transparent 42%),
    rgba(7, 25, 52, 0.34);
  -webkit-backdrop-filter: blur(16px) saturate(132%);
  backdrop-filter: blur(16px) saturate(132%);
}

body.page-train .published-completion-overlay--burst-phase {
  background: rgba(5, 20, 43, 0.28);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}

body.page-train .published-completion-card {
  overflow: hidden;
  width: min(100%, 460px);
  max-width: 460px;
  padding: 28px 28px 30px;
  border: 1.5px solid rgba(240, 250, 255, 0.88);
  border-radius: 34px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 2%, rgba(255, 255, 255, 0.88), transparent 21%),
    radial-gradient(circle at 94% 94%, rgba(194, 231, 255, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(220, 239, 255, 0.4), rgba(112, 170, 226, 0.2) 54%, rgba(230, 244, 255, 0.19));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.98),
    inset -1px -1px 0 rgba(181, 226, 255, 0.55),
    inset 0 0 22px rgba(255, 255, 255, 0.12),
    0 30px 80px rgba(0, 15, 42, 0.34),
    0 0 34px rgba(80, 169, 255, 0.16);
  -webkit-backdrop-filter: blur(30px) saturate(168%) brightness(1.08);
  backdrop-filter: blur(30px) saturate(168%) brightness(1.08);
}

body.page-train .published-completion-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 48%;
  border-radius: 32px 32px 48% 48%;
  background:
    radial-gradient(circle at 7% 0, rgba(255, 255, 255, 0.72), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent);
  pointer-events: none;
}

body.page-train .published-completion-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 27px;
  box-shadow: inset 0 0 18px rgba(210, 239, 255, 0.08);
  pointer-events: none;
}

body.page-train .published-completion-card > * {
  position: relative;
  z-index: 1;
}

body.page-train .published-completion-check {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border: 1px solid rgba(216, 244, 255, 0.86);
  border-radius: 50%;
  color: #d8fbff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(145deg, rgba(125, 211, 252, 0.64), rgba(37, 99, 235, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -5px 12px rgba(30, 88, 190, 0.2),
    0 0 26px rgba(82, 188, 255, 0.54),
    0 10px 26px rgba(10, 63, 145, 0.26);
}

body.page-train .published-completion-check svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 7px rgba(255, 255, 255, 0.58));
}

body.page-train .published-completion-card h2,
body.page-train .page--published-train-ui .published-completion-card h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(1.72rem, 6vw, 2.15rem);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.035em;
  text-shadow: 0 3px 14px rgba(0, 31, 72, 0.36);
}

body.page-train .published-recording-choice__question,
body.page-train .page--published-train-ui .published-recording-choice__question {
  margin: 0 0 8px !important;
  color: rgba(255, 255, 255, 0.98) !important;
  font-size: clamp(1rem, 3.7vw, 1.12rem) !important;
  font-weight: 850 !important;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0, 30, 67, 0.3);
}

body.page-train .published-recording-choice__note,
body.page-train .page--published-train-ui .published-recording-choice__note {
  margin: 0 0 18px !important;
  color: rgba(235, 245, 255, 0.78) !important;
  font-size: clamp(0.82rem, 3vw, 0.92rem) !important;
  font-weight: 650 !important;
  line-height: 1.55;
}

body.page-train .published-recording-choice__count-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 58px;
  margin: 0 auto 22px;
  padding: 9px 18px;
  border: 1px solid rgba(238, 250, 255, 0.5);
  border-radius: 999px;
  color: #bceaff;
  background: linear-gradient(145deg, rgba(30, 67, 112, 0.29), rgba(223, 242, 255, 0.15));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(146, 207, 255, 0.18), 0 8px 20px rgba(3, 27, 64, 0.12);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

body.page-train .published-recording-choice__count-pill > svg {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.56));
}

body.page-train .published-recording-choice__count,
body.page-train .page--published-train-ui .published-recording-choice__count {
  margin: 0 !important;
  color: #f4fbff !important;
  font-size: clamp(0.82rem, 3vw, 0.94rem) !important;
  font-weight: 800 !important;
  line-height: 1.35;
}

body.page-train .published-recording-choice__actions {
  gap: 12px;
}

body.page-train .published-recording-choice__actions .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  min-height: 58px;
  border-radius: 19px;
  padding: 10px 12px;
  font-size: clamp(0.84rem, 3.2vw, 0.98rem);
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

body.page-train .published-recording-choice__actions .btn::before {
  content: "";
  position: absolute;
  inset: 1px 8px auto;
  height: 45%;
  border-radius: 16px 16px 50% 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent);
  pointer-events: none;
}

body.page-train .published-recording-choice__actions .btn > * {
  position: relative;
  z-index: 1;
}

body.page-train .published-recording-choice__actions .btn--primary {
  border: 1px solid rgba(169, 228, 255, 0.92);
  color: #fff;
  background: linear-gradient(150deg, #258dff, #1768dc 60%, #18a6d8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -3px 7px rgba(0, 53, 145, 0.3),
    0 11px 24px rgba(0, 74, 210, 0.36),
    0 0 19px rgba(45, 159, 255, 0.4);
}

body.page-train .published-recording-choice__actions .btn--secondary {
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(150deg, rgba(43, 67, 97, 0.78), rgba(22, 38, 61, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -3px 7px rgba(0, 10, 28, 0.23),
    0 10px 22px rgba(0, 14, 38, 0.24);
}

body.page-train .published-recording-choice__actions .btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

body.page-train .published-recording-choice__actions .btn:active:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(2px) scale(0.985);
  box-shadow: inset 0 3px 9px rgba(0, 19, 55, 0.28);
}

body.page-train .published-recording-choice__actions .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(191, 231, 255, 0.35), 0 0 25px rgba(68, 169, 255, 0.5);
}

body.page-train .published-recording-choice__actions .btn:disabled {
  cursor: wait;
  opacity: 0.54;
  filter: saturate(0.55);
}

body.page-train .published-glass-btn__icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

body.page-train .published-completion-menu__message {
  margin: 0 !important;
  color: rgba(244, 251, 255, 0.96) !important;
  font-size: clamp(0.88rem, 3vw, 0.98rem) !important;
  font-weight: 800 !important;
  line-height: 1.45;
  text-align: left;
  text-shadow: 0 2px 10px rgba(0, 44, 48, 0.28);
}

body.page-train .published-completion-menu__message-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  margin: 0 0 20px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  color: #bff8ef;
  background: linear-gradient(145deg, rgba(14, 116, 144, 0.3), rgba(255, 255, 255, 0.13));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 20px rgba(3, 27, 64, 0.12);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

body.page-train .published-completion-menu__message-pill > svg {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 0 8px rgba(94, 234, 212, 0.45));
}

body.page-train .published-completion-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.page-train .published-completion-actions .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  min-width: 0;
  min-height: 60px;
  border-radius: 19px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: #f8fbff;
  background: linear-gradient(145deg, rgba(32, 92, 154, 0.72), rgba(14, 63, 112, 0.64));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -3px 7px rgba(0, 17, 48, 0.18),
    0 8px 20px rgba(0, 20, 52, 0.2);
  font-size: clamp(0.8rem, 2.9vw, 0.94rem);
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
}

body.page-train .published-completion-actions .btn::before {
  content: "";
  position: absolute;
  inset: 1px 7px auto;
  height: 44%;
  border-radius: 16px 16px 48% 48%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

body.page-train .published-completion-actions .btn > * {
  position: relative;
  z-index: 1;
}

body.page-train .published-completion-actions #btn-published-again {
  border-color: rgba(169, 228, 255, 0.9);
  background: linear-gradient(150deg, #258dff, #1768dc 60%, #18a6d8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 7px rgba(0, 53, 145, 0.28),
    0 10px 24px rgba(0, 74, 210, 0.32),
    0 0 16px rgba(45, 159, 255, 0.27);
}

body.page-train .published-completion-actions #btn-published-go-review {
  border-color: rgba(153, 246, 228, 0.62);
  background: linear-gradient(150deg, rgba(17, 145, 160, 0.88), rgba(14, 96, 130, 0.78));
}

body.page-train .published-completion-actions #btn-published-echoing {
  border-color: rgba(196, 181, 253, 0.58);
  background: linear-gradient(150deg, rgba(83, 90, 181, 0.82), rgba(46, 67, 127, 0.76));
}

body.page-train .published-completion-actions #btn-published-new-topic {
  background: linear-gradient(150deg, rgba(50, 69, 94, 0.74), rgba(24, 40, 64, 0.66));
}

body.page-train .published-completion-actions .btn:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

body.page-train .published-completion-actions .btn:active:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(2px) scale(0.985);
  box-shadow: inset 0 3px 9px rgba(0, 19, 55, 0.28);
}

body.page-train .published-completion-actions .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(191, 231, 255, 0.34), 0 0 24px rgba(68, 169, 255, 0.4);
}

body.page-train .published-menu-btn__icon {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
}

body.page-train .published-save-result {
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(246, 251, 255, 0.95);
  background: rgba(5, 30, 65, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

@media (max-width: 620px) {
  body.page-train.prestart-mode #phase-prestart.prestart-panel {
    border-radius: 25px;
    padding: 16px;
  }

  body.page-train.prestart-mode .prestart-body > .opt-block,
  body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
  body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block {
    border-radius: 16px;
  }

  body.page-train .published-completion-overlay {
    padding: 16px;
  }

  body.page-train .published-completion-card,
  body.page-train .page--published-train-ui .published-completion-card {
    padding: 25px 20px 22px;
    border-radius: 29px;
  }

  body.page-train .published-completion-check {
    width: 68px;
    height: 68px;
    margin-bottom: 14px;
  }

  body.page-train .published-completion-check svg {
    width: 42px;
    height: 42px;
  }

  body.page-train .published-completion-actions .btn {
    min-height: 58px;
    padding-inline: 9px;
  }
}

@media (max-width: 370px) {
  body.page-train .published-recording-choice__actions {
    gap: 8px;
  }

  body.page-train .published-recording-choice__actions .btn {
    min-height: 54px;
    padding-inline: 8px;
    font-size: 0.8rem;
  }

  body.page-train .published-glass-btn__icon {
    width: 18px;
    height: 18px;
  }

  body.page-train .published-completion-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body.page-train .published-completion-actions .btn {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-train .published-completion-card,
  body.page-train .published-recording-choice__actions .btn,
  body.page-train.prestart-mode .opt-chip,
  body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start) {
    transition: none !important;
  }
}

/* Keep this final so the mobile modal can scroll over the fixed lesson viewport. */
body.page-train .published-completion-overlay {
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

body.page-train .published-completion-card,
body.page-train .page--published-train-ui .published-completion-card {
  max-height: calc(100dvh - max(32px, calc(env(safe-area-inset-top) + env(safe-area-inset-bottom))));
  margin-block: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

body.page-train .published-completion-card::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Crystal glass polish — settings, recording choice, and completion menu.
   This final layer is intentionally visual-only. Existing state classes,
   element ids, event hooks, layout flow, and the modal scroll safeguard stay
   unchanged.
   -------------------------------------------------------------------------- */

body.page-train {
  --ybt-crystal-white: rgba(255, 255, 255, 0.96);
  --ybt-crystal-rim: rgba(231, 248, 255, 0.94);
  --ybt-crystal-blue: #54c7ff;
  --ybt-crystal-deep: #075ed9;
  --ybt-crystal-ink: #082443;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  isolation: isolate;
  border: 2px solid var(--ybt-crystal-rim);
  background:
    radial-gradient(ellipse at 4% 0%, rgba(255, 255, 255, 0.52) 0 2%, rgba(255, 255, 255, 0.18) 14%, transparent 34%),
    radial-gradient(circle at 94% 96%, rgba(60, 188, 255, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(196, 228, 255, 0.19), rgba(39, 89, 142, 0.13) 52%, rgba(165, 216, 250, 0.12));
  box-shadow:
    inset 2px 2px 1px rgba(255, 255, 255, 0.86),
    inset -2px -2px 1px rgba(120, 198, 255, 0.25),
    inset 0 0 28px rgba(255, 255, 255, 0.08),
    0 28px 72px rgba(3, 25, 58, 0.27),
    0 0 30px rgba(83, 194, 255, 0.16);
  -webkit-backdrop-filter: blur(7px) saturate(152%) brightness(1.02);
  backdrop-filter: blur(7px) saturate(152%) brightness(1.02);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 5px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.34), transparent 18% 76%, rgba(140, 220, 255, 0.11)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 24%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(128, 205, 255, 0.26);
  pointer-events: none;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::after {
  z-index: 0;
  top: -70px;
  left: -52px;
  width: 255px;
  height: 190px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.38), transparent 68%);
  filter: blur(18px);
}

body.page-train.prestart-mode .prestart-body > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block {
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  background:
    radial-gradient(circle at 4% 0%, rgba(255, 255, 255, 0.25), transparent 28%),
    linear-gradient(155deg, rgba(221, 240, 255, 0.18), rgba(67, 119, 169, 0.1));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.72),
    inset -1px -1px 0 rgba(128, 199, 255, 0.14),
    0 12px 28px rgba(3, 32, 67, 0.12);
  -webkit-backdrop-filter: blur(3px) saturate(138%);
  backdrop-filter: blur(3px) saturate(138%);
}

body.page-train.prestart-mode .opt-label {
  color: #f2f9ff;
  text-shadow: 0 2px 8px rgba(2, 27, 56, 0.7);
}

body.page-train.prestart-mode .opt-chip {
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.48), transparent 31%),
    linear-gradient(180deg, rgba(238, 248, 255, 0.44), rgba(155, 201, 237, 0.24));
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.76),
    inset 0 -3px 7px rgba(68, 126, 180, 0.08),
    0 7px 17px rgba(15, 63, 111, 0.11);
  -webkit-backdrop-filter: blur(3px) saturate(150%);
  backdrop-filter: blur(3px) saturate(150%);
}

body.page-train.prestart-mode .opt-chip::before,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start)::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px 7px auto;
  height: 47%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

body.page-train.prestart-mode .opt-chip > *,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start) > * {
  position: relative;
  z-index: 1;
}

body.page-train.prestart-mode .opt-chip.opt-chip--active {
  border-color: rgba(206, 244, 255, 0.98);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.46), transparent 29%),
    linear-gradient(160deg, rgba(206, 236, 255, 0.28), rgba(12, 89, 200, 0.26) 55%, rgba(7, 57, 151, 0.32));
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.8),
    inset -1px -3px 9px rgba(0, 39, 126, 0.26),
    inset 0 -12px 22px rgba(0, 103, 255, 0.22),
    0 9px 22px rgba(0, 63, 172, 0.28),
    0 0 10px rgba(185, 240, 255, 0.52),
    0 0 27px rgba(27, 132, 255, 0.62);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active::after,
body.page-train.prestart-mode #btn-prestart-start::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 12%;
  bottom: -48%;
  left: 12%;
  height: 82%;
  border-radius: 50%;
  background: rgba(0, 105, 255, 0.9);
  filter: blur(10px);
  opacity: 0.9;
  pointer-events: none;
}

body.page-train.prestart-mode .prestart-footer {
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 6% 0%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(145deg, rgba(223, 242, 255, 0.17), rgba(59, 111, 163, 0.11));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.74),
    inset -1px -1px 0 rgba(114, 190, 247, 0.18),
    0 18px 42px rgba(3, 38, 83, 0.2),
    0 0 25px rgba(83, 194, 255, 0.14);
  -webkit-backdrop-filter: blur(4px) saturate(145%);
  backdrop-filter: blur(4px) saturate(145%);
}

body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  border-width: 1.5px;
  border-style: solid;
  border-radius: 18px;
  -webkit-backdrop-filter: blur(4px) saturate(155%);
  backdrop-filter: blur(4px) saturate(155%);
}

body.page-train.prestart-mode .btn--prestart-secondary {
  border-color: rgba(255, 255, 255, 0.98);
  color: #173b5c;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.54), rgba(164, 206, 239, 0.31));
  box-shadow:
    inset 1px 2px 1px #fff,
    inset -1px -3px 8px rgba(36, 89, 138, 0.12),
    0 9px 21px rgba(9, 47, 89, 0.14);
}

body.page-train.prestart-mode #btn-prestart-start {
  border-color: rgba(201, 241, 255, 0.98);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.46), transparent 26%),
    linear-gradient(160deg, rgba(210, 239, 255, 0.28), rgba(10, 82, 188, 0.27) 56%, rgba(5, 52, 139, 0.34));
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.8),
    inset -1px -4px 9px rgba(0, 40, 128, 0.28),
    inset 0 -14px 25px rgba(0, 105, 255, 0.24),
    0 12px 27px rgba(0, 54, 161, 0.3),
    0 0 11px rgba(186, 239, 255, 0.54),
    0 0 31px rgba(24, 133, 255, 0.64);
}

body.page-train .published-completion-overlay {
  background:
    radial-gradient(circle at 50% 36%, rgba(88, 178, 255, 0.07), transparent 44%),
    linear-gradient(180deg, rgba(7, 55, 111, 0.07), rgba(4, 20, 49, 0.15));
  -webkit-backdrop-filter: blur(3px) saturate(126%) brightness(0.97);
  backdrop-filter: blur(3px) saturate(126%) brightness(0.97);
}

body.page-train .published-completion-card,
body.page-train .page--published-train-ui .published-completion-card {
  isolation: isolate;
  border: 1px solid rgba(244, 252, 255, 0.88);
  background:
    radial-gradient(ellipse at 5% 0%, rgba(255, 255, 255, 0.74) 0 2%, rgba(255, 255, 255, 0.15) 16%, transparent 34%),
    radial-gradient(ellipse at 50% 112%, rgba(0, 101, 255, 0.36), transparent 54%),
    radial-gradient(circle at 96% 90%, rgba(91, 194, 255, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(184, 222, 250, 0.16), rgba(21, 68, 117, 0.1) 50%, rgba(164, 210, 243, 0.09));
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.92),
    inset 1px 0 0 rgba(255, 255, 255, 0.34),
    inset -1px -1px 0 rgba(138, 214, 255, 0.28),
    inset 0 0 32px rgba(255, 255, 255, 0.07),
    0 34px 85px rgba(0, 12, 38, 0.42),
    0 28px 68px rgba(0, 83, 230, 0.3),
    0 0 38px rgba(56, 170, 255, 0.32);
  -webkit-backdrop-filter: blur(8px) saturate(158%) brightness(1.03);
  backdrop-filter: blur(8px) saturate(158%) brightness(1.03);
}

body.page-train .published-completion-card::before {
  z-index: 0;
  inset: 3px 5px auto;
  height: 51%;
  border-radius: 29px 29px 48% 48%;
  background:
    radial-gradient(ellipse at 4% 0%, rgba(255, 255, 255, 0.68), transparent 25%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 72%);
  filter: none;
  animation: ybt-crystal-shimmer 5.5s ease-in-out infinite alternate;
}

body.page-train .published-completion-card::after {
  z-index: 0;
  inset: 7px;
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(124, 205, 255, 0.3),
    inset 0 0 23px rgba(214, 242, 255, 0.12);
}

body.page-train .published-completion-check {
  position: relative;
  border: 2px solid rgba(226, 250, 255, 0.96);
  color: #e7fdff;
  background:
    radial-gradient(circle at 28% 17%, rgba(255, 255, 255, 0.98), transparent 25%),
    linear-gradient(145deg, rgba(129, 216, 255, 0.92), rgba(39, 124, 241, 0.78) 66%, rgba(52, 203, 231, 0.7));
  box-shadow:
    inset 2px 2px 2px rgba(255, 255, 255, 0.9),
    inset -3px -5px 12px rgba(0, 49, 148, 0.33),
    0 0 16px rgba(197, 244, 255, 0.62),
    0 0 35px rgba(41, 166, 255, 0.76),
    0 12px 28px rgba(0, 64, 164, 0.34);
  animation: ybt-crystal-check-glow 2.8s ease-in-out infinite alternate;
}

body.page-train .published-completion-card h2,
body.page-train .page--published-train-ui .published-completion-card h2 {
  text-shadow:
    0 2px 1px rgba(255, 255, 255, 0.14),
    0 4px 16px rgba(0, 31, 72, 0.52),
    0 0 20px rgba(150, 222, 255, 0.18);
}

body.page-train .published-recording-choice__count-pill,
body.page-train .published-completion-menu__message-pill {
  border: 1.5px solid rgba(236, 250, 255, 0.72);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(145deg, rgba(32, 77, 126, 0.26), rgba(157, 207, 241, 0.1));
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.48),
    inset -1px -2px 5px rgba(14, 60, 112, 0.2),
    0 10px 24px rgba(0, 23, 60, 0.18),
    0 0 16px rgba(103, 201, 255, 0.14);
  -webkit-backdrop-filter: blur(4px) saturate(144%);
  backdrop-filter: blur(4px) saturate(144%);
}

body.page-train .published-recording-choice__actions .btn,
body.page-train .published-completion-actions .btn {
  border-width: 1.5px;
  border-radius: 22px;
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.55),
    inset -1px -4px 10px rgba(0, 20, 60, 0.3),
    0 11px 26px rgba(0, 16, 48, 0.28);
  -webkit-backdrop-filter: blur(4px) saturate(158%);
  backdrop-filter: blur(4px) saturate(158%);
}

body.page-train .published-recording-choice__actions .btn::before,
body.page-train .published-completion-actions .btn::before {
  inset: 2px 8px auto;
  height: 49%;
  border-radius: 19px 19px 52% 52%;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255, 255, 255, 0.78), transparent 31%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent);
}

body.page-train .published-recording-choice__actions .btn--primary::after,
body.page-train .published-completion-actions #btn-published-again::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 10%;
  bottom: -52%;
  left: 10%;
  height: 88%;
  border-radius: 50%;
  background: rgba(0, 104, 255, 0.94);
  filter: blur(12px);
  opacity: 0.92;
  pointer-events: none;
}

body.page-train .published-recording-choice__actions .btn--primary,
body.page-train .published-completion-actions #btn-published-again {
  border: 1px solid rgba(235, 251, 255, 0.96);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.58), transparent 31%),
    linear-gradient(160deg, rgba(63, 166, 255, 0.9), rgba(5, 91, 232, 0.9) 54%, rgba(0, 57, 174, 0.92));
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.88),
    inset 0 -5px 12px rgba(0, 33, 112, 0.5),
    inset 0 -16px 30px rgba(0, 111, 255, 0.32),
    0 13px 29px rgba(0, 47, 159, 0.4),
    0 0 9px rgba(216, 249, 255, 0.76),
    0 0 24px rgba(27, 139, 255, 0.92),
    0 0 46px rgba(0, 104, 255, 0.65);
}

body.page-train .published-recording-choice__actions .btn--secondary,
body.page-train .published-completion-actions #btn-published-new-topic {
  border-color: rgba(236, 248, 255, 0.82);
  color: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.3), transparent 29%),
    linear-gradient(150deg, rgba(77, 104, 139, 0.62), rgba(24, 43, 71, 0.54) 64%, rgba(16, 32, 57, 0.58));
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.58),
    inset -2px -5px 10px rgba(0, 9, 31, 0.42),
    0 12px 27px rgba(0, 10, 34, 0.35),
    0 0 15px rgba(212, 241, 255, 0.18);
}

body.page-train .published-completion-actions #btn-published-go-review {
  border-color: rgba(197, 255, 246, 0.9);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.42), transparent 27%),
    linear-gradient(145deg, rgba(69, 214, 209, 0.78), rgba(12, 157, 170, 0.7) 49%, rgba(8, 119, 143, 0.72) 76%, rgba(25, 111, 165, 0.68));
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.74),
    inset -2px -5px 10px rgba(0, 63, 84, 0.36),
    0 12px 27px rgba(0, 90, 119, 0.3),
    0 0 25px rgba(45, 212, 191, 0.36);
}

body.page-train .published-completion-actions #btn-published-echoing {
  border-color: rgba(228, 218, 255, 0.9);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.42), transparent 27%),
    linear-gradient(145deg, rgba(141, 157, 255, 0.78), rgba(86, 107, 213, 0.7) 49%, rgba(60, 75, 159, 0.72) 77%, rgba(49, 80, 140, 0.68));
  box-shadow:
    inset 1px 2px 1px rgba(255, 255, 255, 0.72),
    inset -2px -5px 10px rgba(36, 31, 101, 0.36),
    0 12px 27px rgba(29, 31, 101, 0.31),
    0 0 25px rgba(139, 151, 255, 0.34);
}

@keyframes ybt-crystal-shimmer {
  from { opacity: 0.72; transform: translate3d(-1.5%, -1%, 0); }
  to { opacity: 1; transform: translate3d(1.5%, 1%, 0); }
}

@keyframes ybt-crystal-check-glow {
  from { filter: brightness(0.98); }
  to { filter: brightness(1.09); }
}

@media (max-width: 620px) {
  body.page-train.prestart-mode #phase-prestart.prestart-panel {
    border-width: 1.5px;
  }

  body.page-train .published-completion-card,
  body.page-train .page--published-train-ui .published-completion-card {
    border-width: 1.5px;
    box-shadow:
      inset 1px 1px 1px rgba(255, 255, 255, 0.98),
      inset -1px -1px 1px rgba(138, 214, 255, 0.48),
      inset 0 0 28px rgba(255, 255, 255, 0.14),
      0 28px 64px rgba(0, 12, 38, 0.42),
      0 0 28px rgba(56, 170, 255, 0.26);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-train .published-completion-card::before,
  body.page-train .published-completion-check {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Crystal glass v8 — clearer ice-blue planes, edge refraction, and backlight.
   The previous wide highlights made the controls read as plastic or jelly.
   This final visual-only layer keeps the surfaces nearly clear and moves the
   visual weight to the rim, inset edge light, background blur, and outer glow.
   -------------------------------------------------------------------------- */

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.1)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.05)) border-box;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.38),
    inset 0 -1px 2px rgba(8, 39, 78, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(24px) saturate(132%);
  backdrop-filter: blur(24px) saturate(132%);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::before {
  inset: 1px 22px auto;
  width: auto;
  height: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9) 24%, rgba(255, 255, 255, 0.36) 72%, transparent);
  box-shadow: none;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::after {
  top: auto;
  right: 15%;
  bottom: -92px;
  left: 15%;
  width: auto;
  height: 126px;
  border-radius: 50%;
  background: rgba(0, 112, 255, 0.18);
  filter: blur(28px);
  opacity: 0.55;
}

body.page-train.prestart-mode .prestart-body > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block,
body.page-train.prestart-mode .prestart-footer {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    0 8px 24px rgba(3, 25, 58, 0.1);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
  backdrop-filter: blur(10px) saturate(125%);
}

body.page-train.prestart-mode .opt-chip,
body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  border: 1px solid rgba(226, 245, 255, 0.34);
  background: rgba(214, 239, 255, 0.025);
  box-shadow:
    inset 0 3px 6px rgba(255, 255, 255, 0.46),
    inset 0 -3px 6px rgba(8, 54, 91, 0.16),
    0 7px 18px rgba(0, 18, 48, 0.12);
  -webkit-backdrop-filter: blur(7px) saturate(142%);
  backdrop-filter: blur(7px) saturate(142%);
}

body.page-train.prestart-mode .opt-chip::before,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start)::before {
  inset: 1px 12px auto;
  height: 1px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.86), transparent);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active,
body.page-train.prestart-mode #btn-prestart-start {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  background: rgba(0, 110, 255, 0.2);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.5),
    inset 0 3px 6px rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(0, 24, 74, 0.18),
    0 0 20px rgba(0, 120, 255, 0.7),
    0 8px 24px rgba(0, 52, 148, 0.2);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active::after,
body.page-train.prestart-mode #btn-prestart-start::after {
  display: none;
}

body.page-train.prestart-mode .btn--prestart-secondary {
  color: rgba(245, 251, 255, 0.96);
  text-shadow: 0 1px 5px rgba(3, 26, 58, 0.38);
}

body.page-train .published-completion-overlay {
  background: rgba(4, 20, 49, 0.1);
  -webkit-backdrop-filter: blur(3px) saturate(118%);
  backdrop-filter: blur(3px) saturate(118%);
}

body.page-train .published-completion-card,
body.page-train .page--published-train-ui .published-completion-card {
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.1)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.05)) border-box;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 26, 70, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 18px 50px rgba(0, 92, 230, 0.18);
  -webkit-backdrop-filter: blur(24px) saturate(132%);
  backdrop-filter: blur(24px) saturate(132%);
}

body.page-train .published-completion-card::before {
  inset: 1px 24px auto;
  height: 1px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.94) 25%, rgba(255, 255, 255, 0.34) 74%, transparent);
  filter: none;
  animation: none;
}

body.page-train .published-completion-card::after {
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.28),
    inset 0 -1px 2px rgba(0, 20, 52, 0.08);
}

body.page-train .published-recording-choice__count-pill,
body.page-train .published-completion-menu__message-pill {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.36),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(0, 20, 52, 0.12);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
  backdrop-filter: blur(10px) saturate(125%);
}

body.page-train .published-recording-choice__actions .btn,
body.page-train .published-completion-actions .btn {
  border: 1px solid rgba(226, 245, 255, 0.34);
  color: rgba(255, 255, 255, 0.97);
  background: rgba(214, 239, 255, 0.025);
  box-shadow:
    inset 0 3px 6px rgba(255, 255, 255, 0.46),
    inset 0 -3px 6px rgba(8, 54, 91, 0.16),
    0 8px 20px rgba(0, 15, 42, 0.16);
  text-shadow: 0 1px 5px rgba(0, 18, 48, 0.42);
  -webkit-backdrop-filter: blur(7px) saturate(142%);
  backdrop-filter: blur(7px) saturate(142%);
}

body.page-train .published-recording-choice__actions .btn::before,
body.page-train .published-completion-actions .btn::before {
  inset: 1px 12px auto;
  height: 1px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

body.page-train .published-recording-choice__actions .btn--primary::after,
body.page-train .published-completion-actions #btn-published-again::after {
  display: none;
}

body.page-train .published-recording-choice__actions .btn--primary,
body.page-train .published-completion-actions #btn-published-again {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 110, 255, 0.2);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.5),
    inset 0 3px 6px rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(0, 24, 74, 0.18),
    0 0 20px rgba(0, 120, 255, 0.7),
    0 8px 24px rgba(0, 52, 148, 0.22);
}

body.page-train .published-recording-choice__actions .btn--secondary,
body.page-train .published-completion-actions #btn-published-new-topic {
  border: 1px solid rgba(229, 247, 255, 0.38);
  background: rgba(211, 238, 255, 0.02);
  box-shadow:
    inset 0 3px 7px rgba(255, 255, 255, 0.52),
    inset 0 -3px 7px rgba(5, 48, 86, 0.19),
    inset 1px 0 2px rgba(222, 246, 255, 0.18),
    0 8px 20px rgba(0, 15, 42, 0.16);
}

body.page-train .published-completion-actions #btn-published-go-review {
  border-color: rgba(207, 255, 249, 0.42);
  background: rgba(103, 238, 229, 0.045);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.42),
    inset 0 -2px 4px rgba(0, 58, 70, 0.13),
    0 0 18px rgba(45, 212, 191, 0.22);
}

body.page-train .published-completion-actions #btn-published-echoing {
  border-color: rgba(235, 229, 255, 0.42);
  background: rgba(167, 178, 255, 0.045);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.42),
    inset 0 -2px 4px rgba(35, 32, 94, 0.13),
    0 0 18px rgba(139, 151, 255, 0.2);
}

body.page-train .published-recording-choice__actions .btn:hover:not(:disabled),
body.page-train .published-completion-actions .btn:hover:not(:disabled),
body.page-train.prestart-mode .opt-chip:hover,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

body.page-train .published-recording-choice__actions .btn:active:not(:disabled),
body.page-train .published-completion-actions .btn:active:not(:disabled),
body.page-train.prestart-mode .opt-chip:active,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start):active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    inset 0 3px 6px rgba(0, 17, 52, 0.2),
    inset 0 -1px 2px rgba(255, 255, 255, 0.24),
    0 4px 12px rgba(0, 12, 36, 0.12);
}

@media (max-width: 620px) {
  body.page-train.prestart-mode #phase-prestart.prestart-panel,
  body.page-train .published-completion-card,
  body.page-train .page--published-train-ui .published-completion-card {
    border-width: 1px;
  }
}

/* --------------------------------------------------------------------------
   Crystal glass v11 — readable waterdrop glass for the settings panel,
   recording choice, and completion menu. The stronger blur keeps background
   copy from crossing the foreground, while brighter type and icons preserve
   the crisp premium finish. This layer is visual-only.
   -------------------------------------------------------------------------- */

body.page-train {
  --ybt-clear-glass-fill: rgba(255, 255, 255, 0.15);
  --ybt-clear-glass-top: rgba(255, 255, 255, 0.58);
  --ybt-clear-glass-bottom: rgba(255, 255, 255, 0.12);
  --ybt-clear-glass-blue: rgba(0, 122, 255, 0.4);
}

/* Let the daytime skyline retain enough shape to refract through the glass. */
body.page-train.prestart-mode .page.page--ny-shell.page--ny-day {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.18) 42%, rgba(255, 255, 255, 0.03) 82%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(236, 246, 255, 0.56) 82%, rgba(241, 248, 255, 0.72)),
    url("/static/images/train-bg-day.png") center / cover no-repeat;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel,
body.page-train .published-completion-card,
body.page-train .page--published-train-ui .published-completion-card {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--ybt-clear-glass-fill);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.42),
    inset 0 -1px 2px rgba(0, 23, 63, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::before,
body.page-train .published-completion-card::before {
  inset: 1px 24px auto;
  width: auto;
  height: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.86) 24%, rgba(255, 255, 255, 0.2) 76%, transparent);
  box-shadow: none;
  filter: none;
  animation: none;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::after {
  top: auto;
  right: 16%;
  bottom: -96px;
  left: 16%;
  width: auto;
  height: 132px;
  border-radius: 50%;
  background: rgba(0, 105, 255, 0.2);
  filter: blur(30px);
  opacity: 0.62;
}

body.page-train .published-completion-card::after {
  display: none;
}

body.page-train .published-celebrate-burst {
  position: absolute;
  z-index: 0;
  top: calc(50% - 100px);
  left: calc(50% - 100px);
  width: 200px;
  height: 200px;
  pointer-events: none;
}

body.page-train .published-celebrate-burst {
  position: absolute;
  z-index: 0;
  top: calc(50% - 100px);
  left: calc(50% - 100px);
  width: 200px;
  height: 200px;
  pointer-events: none;
}

body.page-train .published-completion-overlay {
  background: rgba(4, 20, 49, 0.18);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
}

/* Nested panes use the same clear material at a smaller blur radius. */
body.page-train.prestart-mode #global-feedbacks,
body.page-train.prestart-mode .prestart-body > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block,
body.page-train.prestart-mode .prestart-footer,
body.page-train .published-recording-choice__count-pill,
body.page-train .published-completion-menu__message-pill {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.page-train.prestart-mode #global-feedbacks .status-strip {
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.28);
}

/* Avoid double frosting inside the already blurred settings glass. */
body.page-train.prestart-mode .prestart-body > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras > .opt-block,
body.page-train.prestart-mode .prestart-body #word-mode-prestart-extras .prestart-advanced .opt-block,
body.page-train.prestart-mode .prestart-footer {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Clear cut-glass controls: no full-face radial or milky gradient. */
body.page-train.prestart-mode .opt-chip,
body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start,
body.page-train .published-recording-choice__actions .btn,
body.page-train .published-completion-actions .btn,
body.page-train .published-completion-actions #btn-published-go-review,
body.page-train .published-completion-actions #btn-published-echoing,
body.page-train .published-completion-actions #btn-published-new-topic {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.75),
    inset 0 -1px 2px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.page-train.prestart-mode .opt-chip::before,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start)::before,
body.page-train .published-recording-choice__actions .btn::before,
body.page-train .published-completion-actions .btn::before {
  inset: 1px 12px auto;
  height: 1px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active,
body.page-train.prestart-mode #btn-prestart-start,
body.page-train .published-recording-choice__actions .btn--primary,
body.page-train .published-completion-actions #btn-published-again {
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #fff;
  background: var(--ybt-clear-glass-blue);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(0, 0, 0, 0.12),
    0 0 16px rgba(0, 122, 255, 0.5),
    0 5px 14px rgba(0, 42, 112, 0.18);
}

body.page-train.prestart-mode .opt-chip.opt-chip--active::after,
body.page-train.prestart-mode #btn-prestart-start::after,
body.page-train .published-recording-choice__actions .btn--primary::after,
body.page-train .published-completion-actions #btn-published-again::after {
  display: none;
}

/* The completion emblem now reads as a thin illuminated glass badge. */
body.page-train .published-completion-check {
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #fff;
  background: rgba(0, 122, 255, 0.4);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(0, 35, 93, 0.14),
    0 0 16px rgba(0, 122, 255, 0.5);
  animation: none;
}

body.page-train .published-completion-check svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 5px rgba(126, 222, 255, 0.72));
}

body.page-train :is(
  .published-recording-choice__actions,
  .published-completion-actions
) .btn svg,
body.page-train .published-glass-btn__icon,
body.page-train .published-menu-btn__icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

body.page-train .published-completion-card h2,
body.page-train .published-recording-choice__question,
body.page-train .published-recording-choice__count,
body.page-train .published-completion-menu__message {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.48);
}

body.page-train .published-recording-choice__note {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.42);
}

body.page-train .published-completion-actions #btn-published-go-review svg {
  color: #63ffe0;
}

body.page-train .published-completion-actions #btn-published-echoing svg {
  color: #bdc8ff;
}

body.page-train .published-completion-actions #btn-published-new-topic svg {
  color: #fff;
}

/* Day/night contrast follows the scene without changing the glass material. */
body.page-train.prestart-mode .page--ny-day :is(.opt-chip, .btn--prestart-secondary) {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

body.page-train.prestart-mode .page--ny-day .opt-label {
  color: #123b62;
  text-shadow: 0 1px 7px rgba(255, 255, 255, 0.82);
}

body.page-train.prestart-mode .page--ny-day .opt-chip.opt-chip--active,
body.page-train.prestart-mode .page--ny-day #btn-prestart-start {
  color: #fff;
  text-shadow: 0 1px 5px rgba(0, 34, 88, 0.48);
}

body.page-train.prestart-mode .page--ny-night :is(.opt-label, .opt-chip, .btn--prestart-secondary) {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

body.page-train .published-recording-choice__actions .btn:hover:not(:disabled),
body.page-train .published-completion-actions .btn:hover:not(:disabled),
body.page-train.prestart-mode .opt-chip:hover:not(.opt-chip--disabled),
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start):hover {
  border-color: rgba(255, 255, 255, 0.68);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

body.page-train .published-recording-choice__actions .btn:active:not(:disabled),
body.page-train .published-completion-actions .btn:active:not(:disabled),
body.page-train.prestart-mode .opt-chip:active:not(.opt-chip--disabled),
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start):active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    inset 0 3px 6px rgba(0, 17, 52, 0.2),
    inset 0 -1px 2px rgba(255, 255, 255, 0.24),
    0 4px 12px rgba(0, 12, 36, 0.12),
    0 0 12px rgba(0, 122, 255, 0.35);
}

body.page-train .published-recording-choice__actions .btn:focus-visible,
body.page-train .published-completion-actions .btn:focus-visible,
body.page-train.prestart-mode .opt-chip:focus-visible,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start):focus-visible {
  outline: 2px solid rgba(191, 235, 255, 0.86);
  outline-offset: 3px;
}

@media (max-width: 620px) {
  body.page-train.prestart-mode #phase-prestart.prestart-panel,
  body.page-train .published-completion-card,
  body.page-train .page--published-train-ui .published-completion-card {
    border-width: 1px;
    box-shadow:
      inset 0 2px 3px rgba(255, 255, 255, 0.42),
      inset 0 -1px 2px rgba(0, 23, 63, 0.1),
      0 16px 40px rgba(0, 0, 0, 0.15);
  }
}

/* Training depth: keep the sentence dominant over the New York scene. */
body.page-train .page.page--published-train-ui.page--ny-trainer .published-progress-svg {
  opacity: 0.78;
}
body.page-train .page.page--published-train-ui.page--ny-trainer #pattern-label:not(.hidden) {
  background: rgba(231, 240, 249, 0.88) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 12px rgba(5, 20, 42, 0.08) !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer .published-ko-zone {
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), 0 14px 32px rgba(3, 15, 36, 0.2) !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer.page--ny-night .published-ko-zone {
  background: linear-gradient(180deg, rgba(15, 32, 59, 0.9), rgba(7, 20, 43, 0.86)) !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer.page--ny-answer .published-ko-slot .prompt-ko {
  animation: training-answer-reveal 160ms ease-out;
}
@keyframes training-answer-reveal {
  from { filter: opacity(0.65); }
  to { filter: opacity(1); }
}

/* Recording light belongs to the active microphone, with a quiet outer disc. */
body.page-train .page.page--published-train-ui.page--ny-trainer
  #published-action-slot-host.learner-state-and-answer > #card-state.card-state {
  width: clamp(232px, 23vh, 258px) !important;
  max-width: 100% !important;
  background: linear-gradient(160deg, rgba(25, 46, 73, 0.86), rgba(7, 20, 39, 0.9)) !important;
  border-color: rgba(170, 207, 238, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(221, 243, 255, 0.2), 0 12px 28px rgba(3, 14, 31, 0.18) !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer #card-state .state-layer-label,
body.page-train .page.page--published-train-ui.page--ny-trainer #card-state .pub-recording-pill__label {
  color: #c4f2f8 !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer .recording-circle::before {
  box-shadow: inset 0 0 0 6px rgba(122, 166, 214, 0.14), 0 0 0 1px rgba(211, 238, 255, 0.22);
}
body.page-train .page.page--published-train-ui.page--ny-trainer .recording-inner::before {
  box-shadow: none;
}
body.page-train .page.page--published-train-ui.page--ny-trainer .recording-ring circle {
  stroke: #7499ae !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer #card-state[data-state="recording"] .recording-ring circle {
  stroke: #54dfeb !important;
  filter: drop-shadow(0 0 4px rgba(52, 220, 235, 0.45)) !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer #card-state:not([data-state="recording"]) .pub-recording-pill__dot {
  opacity: 0;
  animation: none;
}
body.page-train .page.page--published-train-ui.page--ny-trainer .train-controls-cluster.ring-controls .btn {
  align-self: stretch;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 5px 14px rgba(3, 15, 36, 0.12) !important;
}
body.page-train .page.page--published-train-ui.page--ny-trainer .train-controls-cluster.ring-controls .btn::before,
body.page-train .page.page--published-train-ui.page--ny-trainer .train-controls-cluster.ring-controls .btn::after {
  opacity: 0.2;
}

/* Local contrast behind copy leaves the glass panel rim translucent. */
body.page-train .published-completion-card h2,
body.page-train .published-recording-choice__question,
body.page-train .published-recording-choice__note,
body.page-train .published-completion-menu__message,
body.page-train.prestart-mode .prestart-panel__title,
body.page-train.prestart-mode .page :is(.opt-label) {
  color: #fff;
  background: linear-gradient(90deg, transparent, rgba(7, 24, 50, 0.32) 18%, rgba(7, 24, 50, 0.32) 82%, transparent);
  border-radius: 12px;
  text-shadow: 0 1px 3px rgba(0, 12, 32, 0.65);
}
body.page-train.prestart-mode .page .opt-label {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 12, 32, 0.65);
}
body.page-train.review-mode .review-row__en,
body.page-train.review-mode .review-row__ko {
  overflow-wrap: anywhere;
}
@media (max-width: 620px) and (max-height: 740px) {
  body.page-train .page.page--published-train-ui.page--ny-trainer .ring-container {
    --ny-ring-size: 108px;
  }
  body.page-train .page.page--published-train-ui.page--ny-trainer #pattern-label:not(.hidden) {
    min-height: 38px !important;
  }
}
@media (max-width: 900px) and (orientation: portrait) {
  body.page-train .page.page--published-train-ui.page--ny-trainer
    #published-action-slot-host.learner-state-and-answer > #card-state.card-state {
    width: auto !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.page-train .page.page--published-train-ui.page--ny-trainer.page--ny-answer .published-ko-slot .prompt-ko {
    animation: none;
  }
}



/* ==========================================================================
   YBT 3D Smoked Glass & Brushed Metal Unification (Learning Room + Review)
   ========================================================================== */

/* --- Fixed New York Day/Night Scene for Learning Room --- */
body.page-learning-room {
  position: relative;
  min-height: 100vh;
  background: #060d1b !important;
  color: #f1f5f9 !important;
}

body.page-learning-room::before {
  z-index: 3;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #2dd4bf 50%, #f59e0b);
}

.ybt-room-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ybt-room-bg__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) saturate(1.08);
  transform: scale(1.03);
}

.ybt-room-bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(15, 23, 42, 0.22), rgba(4, 10, 24, 0.72) 82%),
    linear-gradient(180deg, rgba(5, 12, 26, 0.56) 0%, rgba(5, 12, 26, 0.34) 40%, rgba(4, 10, 22, 0.74) 100%);
}

body.page-learning-room.page-learning-room--day .ybt-room-bg__vignette {
  background:
    radial-gradient(circle at 50% 12%, rgba(12, 26, 48, 0.26), rgba(6, 17, 36, 0.58) 85%),
    linear-gradient(180deg, rgba(6, 18, 38, 0.52) 0%, rgba(8, 22, 44, 0.28) 45%, rgba(5, 14, 30, 0.64) 100%);
}

body.page-learning-room .room-wrap {
  position: relative;
  z-index: 2;
}

body.page-learning-room .room-eyebrow {
  color: #67e8f9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

body.page-learning-room .room-title {
  color: #f8fafc;
  text-shadow: 0 4px 20px rgba(2, 6, 23, 0.55);
}

body.page-learning-room .room-subtitle__learner {
  color: #e2e8f0;
}

body.page-learning-room .room-subtitle__meta {
  color: #cbd5e1;
}

/* --- 3D Smoked Glass Hero Card (1-Tap Resume + Mini Brushed Metal Orb) --- */
body.page-learning-room .room-overview {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle at 86% 12%, rgba(56, 189, 248, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.74), rgba(15, 30, 56, 0.66));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 24px 54px rgba(2, 6, 23, 0.46);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}

body.page-learning-room .room-overview__head-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

body.page-learning-room .room-overview__copy {
  min-width: 0;
  flex: 1 1 auto;
}

body.page-learning-room .room-hero-orb {
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
}

body.page-learning-room .room-hero-orb__bezel {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: conic-gradient(from 135deg, #cbd5e1, #475569, #e2e8f0, #334155, #cbd5e1);
  padding: 4px;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.65),
    0 10px 24px rgba(0, 0, 0, 0.48);
}

body.page-learning-room .room-hero-orb__svg {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  transform: rotate(-90deg);
}

body.page-learning-room .room-hero-orb__track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.24);
  stroke-width: 4;
}

body.page-learning-room .room-hero-orb__progress {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.72));
  transition: stroke-dashoffset 0.35s ease;
}

body.page-learning-room .room-hero-orb__dome {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 24%, #1e293b, #090f1d 72%);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.16);
}

body.page-learning-room .room-hero-orb__count {
  color: #67e8f9;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

body.page-learning-room .room-hero-segments {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  margin: 14px 0 18px;
}

body.page-learning-room .room-hero-seg {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

body.page-learning-room .room-hero-seg.is-lit {
  background: linear-gradient(90deg, #38bdf8, #2dd4bf);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.55);
}

body.page-learning-room .room-hero-seg--gold.is-lit {
  background: linear-gradient(90deg, #f59e0b, #fde047);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.62);
}

body.page-learning-room .room-overview__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body.page-learning-room .room-overview__action {
  border-color: rgba(125, 211, 252, 0.62);
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #0ea5e9 56%, #14b8a6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 26px rgba(14, 165, 233, 0.34);
}

body.page-learning-room .room-overview__main .room-learning-link {
  margin: 0;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.58);
}

body.page-learning-room .room-overview__main .room-learning-link:hover {
  color: #fff;
}

/* --- Policy Banner, Search Bar, Integrated ★ Favorite Toggle & L1-L5 Chips --- */
body.page-learning-room .room-policy {
  border-color: rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.28);
}

body.page-learning-room .room-policy strong {
  color: #f8fafc;
}

body.page-learning-room .room-policy__button {
  border-color: rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.72);
}

body.page-learning-room .room-toolbar {
  grid-template-columns: minmax(240px, 1fr) auto;
  row-gap: 10px;
}

body.page-learning-room .room-search__input {
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 26px rgba(2, 6, 23, 0.3);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.page-learning-room .room-search__input::placeholder {
  color: #94a3b8;
}

body.page-learning-room .room-search::before {
  color: #94a3b8;
}

body.page-learning-room .room-filter {
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.66);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body.page-learning-room .room-filter:hover {
  border-color: rgba(56, 189, 248, 0.52);
  color: #fff;
}

body.page-learning-room .room-filter[aria-pressed="true"] {
  border-color: rgba(56, 189, 248, 0.74);
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #0f766e);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.32);
}

body.page-learning-room .room-filter--favorite[aria-pressed="true"] {
  border-color: rgba(250, 204, 21, 0.78);
  color: #1e1b0a;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.38);
}

body.page-learning-room .room-level-filters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.page-learning-room .room-level-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.58);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

body.page-learning-room .room-level-chip[aria-pressed="true"] {
  border-color: rgba(103, 232, 249, 0.65);
  color: #082f49;
  background: linear-gradient(135deg, #67e8f9, #38bdf8);
}

/* --- Smoked Glass Section & 3D Unit Cards --- */
body.page-learning-room .room-section,
body.page-learning-room .room-denied,
body.page-learning-room .room-archive {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 19, 36, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 22px 54px rgba(2, 6, 23, 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

body.page-learning-room .room-section__title,
body.page-learning-room .room-archive > summary {
  color: #f8fafc;
}

body.page-learning-room .room-section__icon {
  color: #67e8f9;
  background: rgba(14, 165, 233, 0.18);
}

body.page-learning-room .room-empty {
  color: #94a3b8;
}

body.page-learning-room .room-card,
body.page-learning-room .room-card[class*="card--milestone-"] {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(150deg, rgba(22, 34, 58, 0.82), rgba(12, 21, 38, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(2, 6, 23, 0.34);
}

body.page-learning-room .room-card:hover {
  border-color: rgba(56, 189, 248, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 34px rgba(2, 6, 23, 0.46),
    0 0 0 1px rgba(56, 189, 248, 0.18);
}

body.page-learning-room .room-card.room-card--silver-ring {
  border-color: rgba(203, 213, 225, 0.42);
}

body.page-learning-room .room-card.room-card--gold-ring {
  border-color: rgba(250, 204, 21, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(254, 240, 138, 0.26),
    0 12px 28px rgba(2, 6, 23, 0.38),
    0 0 18px rgba(245, 158, 11, 0.16);
}

body.page-learning-room .room-card.room-card--gold-ring::before {
  background: linear-gradient(90deg, #f59e0b, #fde047, #f59e0b);
  opacity: 0.95;
}

body.page-learning-room .room-card[data-is-favorite="true"] {
  border-color: rgba(250, 204, 21, 0.66);
}

body.page-learning-room .room-card__label {
  color: #94a3b8;
}

body.page-learning-room .room-card__text {
  color: #f8fafc;
}

body.page-learning-room .room-card__text-note {
  color: #94a3b8;
}

body.page-learning-room .room-card__preview {
  margin: 4px 0 0;
  color: rgba(203, 213, 225, 0.72);
  font-size: 0.76rem;
  font-weight: 550;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-learning-room .room-card__rep-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

body.page-learning-room .room-card__rep-badge--silver {
  border: 1px solid rgba(203, 213, 225, 0.42);
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.28), rgba(71, 85, 105, 0.35));
}

body.page-learning-room .room-card__rep-badge--gold,
body.page-learning-room .room-card__rep-badge--master {
  border: 1px solid rgba(250, 204, 21, 0.58);
  color: #fef08a;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.32), rgba(161, 98, 7, 0.38));
}

body.page-learning-room .room-card__progress {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.56);
}

body.page-learning-room .room-card__progress span:first-child {
  color: #94a3b8;
}

body.page-learning-room .room-card__progress span:last-child {
  color: #e2e8f0;
}

body.page-learning-room .room-card__favorite {
  border-color: rgba(148, 163, 184, 0.32);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.72);
}

body.page-learning-room .room-card__level-link {
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.72);
}

body.page-learning-room .room-card__level-link:hover {
  border-color: #38bdf8;
  color: #fff;
  background: rgba(14, 165, 233, 0.24);
}

/* --- 4-Slot Favorite Replacement 3D Dialog --- */
body.page-learning-room .room-fav-dialog__panel {
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #f8fafc;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.96), rgba(12, 24, 46, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 28px 70px rgba(2, 6, 23, 0.65);
}

body.page-learning-room .room-fav-dialog__panel h2 {
  color: #f8fafc;
}

body.page-learning-room .room-fav-dialog__desc {
  margin: 8px 0 14px;
  color: #94a3b8;
  font-size: 0.84rem;
  line-height: 1.5;
}

body.page-learning-room .room-fav-dialog__candidate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.14);
}

body.page-learning-room .room-fav-dialog__candidate-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 850;
}

body.page-learning-room .room-fav-dialog__candidate-title {
  color: #f8fafc;
  font-size: 0.92rem;
}

body.page-learning-room .room-fav-dialog__list {
  display: grid;
  gap: 8px;
}

body.page-learning-room .room-fav-dialog__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.66);
}

body.page-learning-room .room-fav-dialog__row-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

body.page-learning-room .room-fav-dialog__row-track {
  color: #67e8f9;
  font-size: 0.68rem;
  font-weight: 800;
}

body.page-learning-room .room-fav-dialog__row-title {
  color: #f8fafc;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-learning-room .room-fav-dialog__replace-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(250, 204, 21, 0.56);
  border-radius: 9px;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.22);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

body.page-learning-room .room-fav-dialog__replace-btn:hover:not(:disabled) {
  color: #1e1b0a;
  background: linear-gradient(135deg, #fde047, #f59e0b);
}

/* ==========================================================================
   Review Mode 3D Smoked Glass + Continuous Shadowing + Karaoke Sync
   ========================================================================== */

body.page-train.review-mode .review-panel {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(155deg, rgba(11, 19, 36, 0.74), rgba(15, 28, 52, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 24px 60px rgba(2, 6, 23, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

body.page-train.review-mode .ybt-review-toolbar {
  display: grid;
  gap: 10px;
  max-width: 748px;
  margin: 0 auto 16px;
}

body.page-train.review-mode .ybt-review-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.page-train.review-mode .ybt-rev-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.14s ease;
}

body.page-train.review-mode .ybt-rev-btn:hover {
  border-color: rgba(56, 189, 248, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

body.page-train.review-mode .ybt-rev-btn--primary {
  border-color: rgba(56, 189, 248, 0.65);
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #0ea5e9 55%, #14b8a6);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

body.page-train.review-mode .ybt-rev-btn[aria-pressed="true"]:not(.ybt-rev-btn--primary) {
  border-color: rgba(250, 204, 21, 0.72);
  color: #fef08a;
  background: rgba(245, 158, 11, 0.24);
}

body.page-train.review-mode .ybt-rev-btn--primary[aria-pressed="true"] {
  border-color: rgba(248, 113, 113, 0.75);
  background: linear-gradient(135deg, #dc2626, #f97316);
}

body.page-train.review-mode .ybt-shadowing-status {
  margin: 0;
  padding: 9px 14px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 12px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.16);
  font-size: 0.84rem;
  font-weight: 750;
}

body.page-train.review-mode .review-row {
  border-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(145deg, rgba(18, 29, 52, 0.86), rgba(11, 19, 36, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 32px rgba(2, 6, 23, 0.36);
}

body.page-train.review-mode .review-row.is-shadowing {
  border-color: rgba(56, 189, 248, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 2px rgba(56, 189, 248, 0.26),
    0 18px 40px rgba(14, 165, 233, 0.24);
}

body.page-train.review-mode .review-row[hidden] {
  display: none !important;
}

body.page-train.review-mode .review-row__en {
  color: #f8fafc;
  transition: filter 0.22s ease, opacity 0.22s ease;
}

body.page-train.review-mode .review-list--hide-en .review-row:not(.is-playing):not(.is-shadowing-en) .review-row__en {
  filter: blur(8px);
  opacity: 0.55;
  user-select: none;
}

body.page-train.review-mode .review-row__en.review-row__en--karaoke {
  background-image: linear-gradient(
    90deg,
    #67e8f9 0%,
    #67e8f9 calc(var(--review-karaoke-pct, 0%) - 3%),
    rgba(226, 232, 240, 0.38) calc(var(--review-karaoke-pct, 0%) + 3%),
    rgba(226, 232, 240, 0.38) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

body.page-train.review-mode .review-row__ko {
  color: #cbd5e1;
}

body.page-train.review-mode .review-row__actions {
  border-top-color: rgba(148, 163, 184, 0.18);
}

body.page-train.review-mode .review-row__actions .review-row__play {
  border-color: rgba(148, 163, 184, 0.26);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.page-train.review-mode .review-row__play-label {
  color: #e2e8f0;
}

body.page-train.review-mode .review-row__confused-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.76);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

body.page-train.review-mode .review-row__confused-btn[aria-pressed="true"] {
  border-color: rgba(250, 204, 21, 0.72);
  color: #fde047;
  background: rgba(245, 158, 11, 0.24);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

body.page-train.review-mode .review-row__shadow-stage {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 4;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

body.page-train.review-mode .ybt-review-filter-empty {
  margin: 8px 0;
  color: #cbd5e1;
  text-align: center;
}


/* ==========================================================================
   1_4.html YBT STUDIO Exact Layout Polish (Study Room + Review Mode)
   ========================================================================== */

body.page-learning-room .room-head--studio {
  display: block !important;
  margin-bottom: 18px;
}

body.page-learning-room .room-studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(7, 12, 26, 0.78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.page-learning-room .room-studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.page-learning-room .room-studio-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #020617;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.35);
}

body.page-learning-room .room-studio-brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

body.page-learning-room .room-studio-brand-ko {
  color: #fff;
  font-size: 1rem;
  font-weight: 850;
}

body.page-learning-room .room-studio-brand-en {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

body.page-learning-room .room-studio-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
}

body.page-learning-room .room-studio-tab {
  padding: 6px 14px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

body.page-learning-room .room-studio-tab--active {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.22);
  color: #bae6fd;
}

body.page-learning-room .room-theme-toggle {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

body.page-learning-room .room-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 0 4px;
}

body.page-learning-room .room-head-meta .room-title {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
}

/* --- 1_4.html Hero Card (Single Column Full-Width Cyan CTA) --- */
body.page-learning-room .room-overview--studio {
  grid-template-columns: 1fr !important;
  gap: 0;
  padding: 20px 22px;
}

body.page-learning-room .room-overview--studio::before {
  content: "";
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8 25%, #67e8f9 50%, #38bdf8 75%, transparent);
}

body.page-learning-room .room-overview--studio .room-hero-orb {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
}

body.page-learning-room .room-overview--studio .room-hero-orb__bezel {
  width: 88px;
  height: 88px;
  padding: 5px;
}

body.page-learning-room .room-overview--studio .room-hero-orb__well {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #132036 0%, #09101f 70%, #040812 100%);
  display: grid;
  place-items: center;
}

body.page-learning-room .room-overview--studio .room-hero-orb__dome {
  position: absolute;
  inset: 11px;
  width: auto;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.page-learning-room .room-overview--studio .room-hero-orb__sub {
  color: #94a3b8;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

body.page-learning-room .room-overview__eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

body.page-learning-room .room-overview__live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 7px;
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
  font-size: 0.7rem;
  font-weight: 800;
}

body.page-learning-room .room-overview__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67e8f9;
}

body.page-learning-room .room-overview__track-meta {
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
}

body.page-learning-room .room-overview--studio .room-overview__action {
  width: 100%;
  min-height: 48px;
  border-radius: 13px;
  color: #020617;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  font-size: 0.94rem;
  font-weight: 850;
  box-shadow: 0 10px 24px -4px rgba(56, 189, 248, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

body.page-learning-room .room-overview__stats--compact {
  margin-top: 12px;
  min-height: 54px;
  border-radius: 12px;
  background: rgba(7, 12, 24, 0.46);
}

body.page-learning-room .room-overview__stats--compact .room-stat {
  flex-direction: row;
  gap: 6px;
  padding: 8px 6px;
}

body.page-learning-room .room-overview__stats--compact .room-stat__value {
  font-size: 1rem;
}

body.page-learning-room .room-overview__stats--compact .room-stat__label {
  margin-top: 0;
  font-size: 0.72rem;
}

/* --- 1_4.html 3-Row Search & 2-Split Quick Filter Toolbar --- */
body.page-learning-room .room-toolbar--studio {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(18, 28, 49, 0.78), rgba(8, 13, 26, 0.82));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

body.page-learning-room .room-quick-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.page-learning-room .room-quick-split .room-filter {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

body.page-learning-room .room-quick-split .room-filter--favorite {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

body.page-learning-room .room-tier-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- 1_4.html Unit Card Mini Silver/Gold Circular Ring --- */
body.page-learning-room .room-card__ring-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

body.page-learning-room .room-card__ring-row .room-card__progress {
  flex: 1 1 auto;
  margin-top: 0;
}

body.page-learning-room .room-card__mini-ring {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 2.5px;
  display: grid;
  place-items: center;
}

body.page-learning-room .room-card__mini-ring--silver {
  background: conic-gradient(from 210deg, #475569, #cbd5e1, #38bdf8, #e2e8f0, #334155);
}

body.page-learning-room .room-card__mini-ring--gold {
  background: conic-gradient(from 210deg, #b45309, #fde68a, #f59e0b, #fef08a, #92400e);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.32);
}

body.page-learning-room .room-card__mini-ring > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0a1222;
  color: #e2e8f0;
  font-size: 0.6rem;
  font-weight: 850;
}

body.page-learning-room .room-card__mini-ring--gold > span {
  color: #fde68a;
}

/* --- 1_4.html Review Toolbar (Full-Width CTA + Switch Toggle + Side-by-Side Card Buttons) --- */
body.page-train.review-mode .ybt-review-toolbar--studio {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(18, 28, 49, 0.8), rgba(8, 13, 26, 0.86));
}

body.page-train.review-mode .ybt-rev-btn--full {
  width: 100%;
  min-height: 46px;
  border-radius: 13px;
  color: #020617;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  font-size: 0.92rem;
  font-weight: 850;
}

body.page-train.review-mode .ybt-review-toolbar__row2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.page-train.review-mode .ybt-rev-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

body.page-train.review-mode .ybt-rev-switch__track {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.2s ease, border-color 0.2s ease;
}

body.page-train.review-mode .ybt-rev-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.2s ease, background 0.2s ease;
}

body.page-train.review-mode .ybt-rev-switch.is-active .ybt-rev-switch__track {
  background: rgba(14, 165, 233, 0.45);
  border-color: rgba(56, 189, 248, 0.72);
}

body.page-train.review-mode .ybt-rev-switch.is-active .ybt-rev-switch__thumb {
  transform: translateX(18px);
  background: #67e8f9;
}

@media (max-width: 600px) {
  body.page-learning-room .room-studio-brand-en {
    display: none;
  }
  body.page-learning-room .room-studio-bar {
    padding: 10px 12px;
  }
}


/* v4 Mobile Studio Header Single-Line Precision Fix */
body.page-learning-room .room-studio-bar {
  flex-wrap: nowrap;
  gap: 8px;
}

body.page-learning-room .room-studio-brand,
body.page-learning-room .room-studio-brand-text,
body.page-learning-room .room-studio-brand-ko,
body.page-learning-room .room-studio-nav,
body.page-learning-room .room-studio-tab,
body.page-learning-room .room-theme-toggle {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

@media (max-width: 480px) {
  body.page-learning-room .room-studio-bar {
    padding: 8px 10px;
    gap: 6px;
  }
  body.page-learning-room .room-studio-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.64rem;
  }
  body.page-learning-room .room-studio-brand {
    gap: 6px;
  }
  body.page-learning-room .room-studio-brand-ko {
    font-size: 0.88rem;
  }
  body.page-learning-room .room-studio-nav {
    padding: 3px;
    gap: 2px;
  }
  body.page-learning-room .room-studio-tab {
    padding: 5px 9px;
    font-size: 0.74rem;
  }
  body.page-learning-room .room-theme-toggle {
    padding: 5px 8px;
    font-size: 0.70rem;
  }
}


/* ==========================================================================
   v6 Review Mode Complete Harmonized 3D Smoke-Glass Redesign
   (Replaces Autumn Photo Banner + Fixes Blurry Focus Training Text)
   ========================================================================== */
body.page-train.review-mode {
  background-color: #050a15 !important;
  color: #f8fafc !important;
}

body.page-train.review-mode .ybt-bg-scene {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -2 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  filter: blur(2px) brightness(0.68) saturate(1.04) !important;
  transform: scale(1.02) !important;
}

body.page-train.review-mode .ybt-bg-vignette {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  background:
    radial-gradient(circle at 50% 25%, rgba(15, 23, 42, 0.14) 0%, rgba(5, 10, 22, 0.56) 70%, rgba(3, 7, 16, 0.84) 100%) !important;
}

/* Replace Autumn Photo Banner with Sleek Unified 3D Smoke-Glass Header Card */
body.page-train.review-mode .hero-review {
  position: relative !important;
  background: linear-gradient(165deg, rgba(20, 32, 58, 0.84) 0%, rgba(10, 17, 34, 0.90) 60%, rgba(7, 12, 24, 0.94) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.34) !important;
  border-top: 1.5px solid rgba(125, 211, 252, 0.65) !important;
  border-radius: 22px !important;
  box-shadow:
    0 22px 44px -14px rgba(2, 6, 23, 0.78),
    0 0 24px rgba(56, 189, 248, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  backdrop-filter: blur(18px) !important;
  overflow: hidden !important;
}

body.page-train.review-mode .hero-review::before {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.12) 50%, transparent) !important;
}

body.page-train.review-mode .hero-review h1,
body.page-train.review-mode .hero-review h2,
body.page-train.review-mode .hero-review .hero-title {
  color: #ffffff !important;
  text-shadow: none !important;
  letter-spacing: -0.02em !important;
}

body.page-train.review-mode .hero-review p,
body.page-train.review-mode .hero-review .hero-sub {
  color: #cbd5e1 !important;
  text-shadow: none !important;
}

/* Crisp, Zero-Blur Focus Training Button ('집중 훈련 시작하기') */
body.page-train.review-mode #btn-focus-training.review-focus-launch {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  border: 1px solid rgba(186, 230, 253, 0.65) !important;
  border-radius: 15px !important;
  font-size: 0.96rem !important;
  font-weight: 850 !important;
  letter-spacing: -0.01em !important;
  text-shadow: none !important;
  box-shadow: 0 10px 26px -4px rgba(56, 189, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  -webkit-font-smoothing: antialiased !important;
}

body.page-train.review-mode #btn-focus-training.review-focus-launch:disabled {
  background: rgba(15, 23, 42, 0.72) !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  opacity: 0.88 !important;
}

body.page-train.review-mode #btn-focus-training .review-focus-launch__count {
  background: rgba(2, 6, 23, 0.16) !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

body.page-train.review-mode #btn-focus-training:disabled .review-focus-launch__count {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

body.page-train.review-mode #review-focus-launch-hint.review-focus-launch-hint {
  color: #cbd5e1 !important;
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  text-shadow: none !important;
  margin-top: 8px !important;
}

/* Harmonized Secondary Action Buttons in Review Mode */
body.page-train.review-mode .review-actions .btn--secondary {
  background: rgba(15, 23, 42, 0.72) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 13px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

body.page-train.review-mode .review-actions .btn--secondary:hover {
  background: rgba(30, 41, 59, 0.86) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #ffffff !important;
}


/* ==========================================================================
   v7 Prestart / Settings Screen Complete 3D Smoke-Glass Redesign
   (Eliminates Old Light-Theme Look & Matches Study/Training/Review Theme)
   ========================================================================== */
body.page-train.prestart-mode {
  background-color: #050a15 !important;
  color: #f8fafc !important;
}

body.page-train.prestart-mode .ybt-bg-scene {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -2 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  filter: blur(1.8px) brightness(0.76) saturate(1.05) !important;
  transform: scale(1.02) !important;
}

body.page-train.prestart-mode.prestart-day .ybt-bg-scene {
  filter: blur(1.8px) brightness(0.88) saturate(1.04) !important;
}

body.page-train.prestart-mode .ybt-bg-vignette {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  background:
    radial-gradient(circle at 50% 25%, rgba(15, 23, 42, 0.14) 0%, rgba(5, 10, 22, 0.56) 68%, rgba(3, 7, 16, 0.86) 100%) !important;
}

body.page-train.prestart-mode .page {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

body.page-train.prestart-mode .hero-default,
body.page-train.prestart-mode .hero-review {
  display: none !important;
}

body.page-train.prestart-mode .hero-prestart {
  display: block !important;
  text-align: center !important;
  padding: 18px 16px 10px !important;
  margin: 0 auto 10px !important;
  max-width: 640px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode .hero-prestart__eyebrow {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
  margin: 0 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(56, 189, 248, 0.42) !important;
  background: rgba(14, 165, 233, 0.18) !important;
  color: #7dd3fc !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
}

body.page-train.prestart-mode .hero-prestart__brand {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(1.55rem, 4.5vw, 2.05rem) !important;
  font-weight: 850 !important;
  letter-spacing: 0.04em !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55) !important;
}

body.page-train.prestart-mode .hero-prestart__tagline {
  margin: 6px 0 0 !important;
  color: #e2e8f0 !important;
  font-size: 0.94rem !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5) !important;
}

body.page-train.prestart-mode .hero-prestart__hint {
  margin: 4px 0 0 !important;
  color: #94a3b8 !important;
  font-size: 0.8rem !important;
}

/* Status Strip in Prestart Mode */
body.page-train.prestart-mode #global-feedbacks.top-panel {
  max-width: 640px !important;
  margin: 0 auto 10px !important;
  padding: 0 4px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode #status-box.status-strip {
  padding: 9px 14px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  background: rgba(11, 18, 34, 0.72) !important;
  color: #bae6fd !important;
  font-size: 0.82rem !important;
  font-weight: 650 !important;
  text-align: center !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}

/* Main Prestart Settings Card: 3D Smoke-Glass Surface */
body.page-train.prestart-mode #phase-prestart.prestart-panel {
  position: relative !important;
  max-width: 640px !important;
  margin: 0 auto 24px !important;
  padding: 22px 20px 20px !important;
  border-radius: 24px !important;
  background: linear-gradient(165deg, rgba(20, 32, 58, 0.84) 0%, rgba(11, 18, 34, 0.88) 58%, rgba(7, 12, 24, 0.94) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.36) !important;
  border-top: 1.5px solid rgba(125, 211, 252, 0.68) !important;
  box-shadow:
    0 26px 54px -14px rgba(2, 6, 23, 0.82),
    0 0 28px rgba(56, 189, 248, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  backdrop-filter: blur(18px) !important;
  color: #f8fafc !important;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 8% !important;
  right: 8% !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, #38bdf8 30%, #67e8f9 50%, #38bdf8 70%, transparent) !important;
  pointer-events: none !important;
}

body.page-train.prestart-mode .prestart-head {
  padding-bottom: 14px !important;
  margin-bottom: 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.page-train.prestart-mode .prestart-panel__title {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: 1.08rem !important;
  font-weight: 800 !important;
}

body.page-train.prestart-mode .prestart-panel__sub {
  margin: 4px 0 0 !important;
  color: #94a3b8 !important;
  font-size: 0.82rem !important;
}

body.page-train.prestart-mode .opt-block {
  margin-bottom: 16px !important;
}

body.page-train.prestart-mode .opt-label {
  color: #cbd5e1 !important;
  font-size: 0.82rem !important;
  font-weight: 750 !important;
  margin-bottom: 8px !important;
  letter-spacing: 0.01em !important;
}

body.page-train.prestart-mode .prestart-range-hint {
  color: #7dd3fc !important;
  font-weight: 600 !important;
}

body.page-train.prestart-mode .opt-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.page-train.prestart-mode .opt-chip {
  min-height: 40px !important;
  padding: 0 15px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(15, 23, 42, 0.72) !important;
  color: #cbd5e1 !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 10px rgba(2, 6, 23, 0.4) !important;
  transition: all 0.18s ease !important;
}

body.page-train.prestart-mode .opt-chip:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.48) !important;
  color: #ffffff !important;
  background: rgba(30, 41, 59, 0.86) !important;
}

body.page-train.prestart-mode .opt-chip.opt-chip--active {
  border: 1.5px solid #67e8f9 !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.30) 0%, rgba(2, 132, 199, 0.42) 100%) !important;
  color: #ffffff !important;
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.38) !important;
}

body.page-train.prestart-mode .prestart-footer {
  margin-top: 20px !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.page-train.prestart-mode .prestart-footer__actions {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  gap: 10px !important;
  width: 100% !important;
}

body.page-train.prestart-mode .btn--prestart-secondary {
  min-height: 48px !important;
  padding: 0 18px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: rgba(15, 23, 42, 0.78) !important;
  color: #e2e8f0 !important;
  font-size: 0.88rem !important;
  font-weight: 750 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
}

body.page-train.prestart-mode #btn-prestart-start {
  min-height: 48px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(186, 230, 253, 0.65) !important;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  font-size: 0.96rem !important;
  font-weight: 850 !important;
  text-shadow: none !important;
  box-shadow: 0 10px 26px -4px rgba(56, 189, 248, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.52) !important;
}

body.page-train.prestart-mode #btn-prestart-start:hover:not(:disabled) {
  filter: brightness(1.06) !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   v7 Review List Compact Card Spacing & Clean Proportions
   ========================================================================== */
body.page-train.review-mode .review-panel {
  padding: 12px !important;
  border-radius: 22px !important;
}

body.page-train.review-mode .ybt-review-toolbar--studio {
  padding: 12px 14px !important;
  margin-bottom: 10px !important;
  gap: 8px !important;
  border-radius: 16px !important;
}

body.page-train.review-mode #session-review-list.review-list {
  gap: 8px !important;
}

body.page-train.review-mode .review-row {
  padding: 12px 14px 11px !important;
  gap: 3px 10px !important;
  border-radius: 16px !important;
}

body.page-train.review-mode .review-row__num {
  width: 44px !important;
  height: 42px !important;
  border-radius: 13px !important;
  font-size: 0.85rem !important;
}

body.page-train.review-mode .review-row__en {
  font-size: clamp(1.02rem, 2.6vw, 1.24rem) !important;
  line-height: 1.3 !important;
}

body.page-train.review-mode .review-row__ko {
  margin-top: 2px !important;
  font-size: 0.86rem !important;
  line-height: 1.38 !important;
}

body.page-train.review-mode .review-row__actions {
  margin-top: 8px !important;
  padding-top: 8px !important;
}

body.page-train.review-mode .review-row__actions .review-row__play {
  min-height: 44px !important;
  padding: 5px 12px 5px 6px !important;
  border-radius: 12px !important;
}

@media (max-width: 600px) {
  body.page-train.review-mode .review-row {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    padding: 11px 12px 10px !important;
  }
  body.page-train.review-mode .review-row__num {
    width: 38px !important;
    height: 36px !important;
    border-radius: 11px !important;
  }
}


/* ==========================================================================
   v8 Single-Line TTS Gender Bar (한국어 여/남 · 원어민 여/남) + Core Words Gate
   ========================================================================== */
body.page-train.prestart-mode .voice-gender-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(56, 189, 248, 0.24) !important;
  background: rgba(8, 14, 28, 0.68) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.page-train.prestart-mode .voice-gender-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

body.page-train.prestart-mode .voice-gender-group__label {
  color: #cbd5e1 !important;
  font-size: 0.80rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

body.page-train.prestart-mode .opt-chips--inline {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
}

body.page-train.prestart-mode .opt-chips--inline .opt-chip {
  min-height: 34px !important;
  padding: 0 12px !important;
  font-size: 0.82rem !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
}

body.page-train.prestart-mode .voice-gender-bar__divider {
  width: 1px !important;
  height: 24px !important;
  background: rgba(148, 163, 184, 0.28) !important;
  flex-shrink: 0 !important;
}

@media (max-width: 480px) {
  body.page-train.prestart-mode .voice-gender-bar {
    padding: 7px 8px !important;
    gap: 6px !important;
  }
  body.page-train.prestart-mode .voice-gender-group {
    gap: 5px !important;
  }
  body.page-train.prestart-mode .voice-gender-group__label {
    font-size: 0.74rem !important;
  }
  body.page-train.prestart-mode .opt-chips--inline .opt-chip {
    min-height: 32px !important;
    padding: 0 9px !important;
    font-size: 0.76rem !important;
  }
}

/* 3D Smoke-Glass Pre-Training Core Words Gate */
.ybt-cw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ybt-cw-gate.hidden {
  display: none !important;
}

.ybt-cw-gate__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ybt-cw-gate__card {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(20, 32, 58, 0.92), rgba(8, 14, 28, 0.96));
  border: 1.5px solid rgba(56, 189, 248, 0.48);
  border-top-color: rgba(165, 243, 252, 0.78);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.85), 0 0 32px rgba(56, 189, 248, 0.22);
  color: #f8fafc;
}

.ybt-cw-gate__head {
  text-align: center;
  margin-bottom: 12px;
}

.ybt-cw-gate__eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ybt-cw-gate__title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 850;
  color: #ffffff;
}

.ybt-cw-gate__sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.ybt-cw-gate__top-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.ybt-cw-list {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.ybt-cw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ybt-cw-item__en {
  font-size: 1.02rem;
  font-weight: 800;
  color: #e0f2fe;
}

.ybt-cw-item__ko {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 2px;
}

.ybt-cw-item__play {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.48);
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ybt-cw-item__play.is-playing {
  background: #38bdf8;
  color: #020617;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.75);
  transform: scale(1.06);
}

.ybt-cw-gate__footer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ybt-cw-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.90rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
}

.ybt-cw-btn--outline {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

.ybt-cw-btn--ghost {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
}

.ybt-cw-btn--primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  border-color: rgba(186, 230, 253, 0.65);
  color: #020617;
  box-shadow: 0 10px 24px -4px rgba(56, 189, 248, 0.46);
}


/* ==========================================================================
   v9.2 Settings (50:50 Mini-Cards + High-Contrast Active) & Review Refinements
   ========================================================================== */
body.page-train.prestart-mode .opt-chip {
  background: rgba(15, 23, 42, 0.74) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

body.page-train.prestart-mode .opt-chip.opt-chip--active,
body.page-train.prestart-mode .opt-chips--inline .opt-chip.opt-chip--active {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  border: 1.5px solid #e0f2fe !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  font-weight: 850 !important;
  text-shadow: none !important;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.58),
    0 4px 12px rgba(2, 132, 199, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
  transform: translateY(-1px) !important;
}

body.page-train.prestart-mode .voice-gender-bar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode .voice-gender-bar__divider {
  display: none !important;
}

body.page-train.prestart-mode .voice-gender-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 10px 10px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(56, 189, 248, 0.24) !important;
  background: rgba(8, 14, 28, 0.68) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.page-train.prestart-mode .voice-gender-group__label {
  color: #cbd5e1 !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
}

body.page-train.prestart-mode .opt-chips--inline {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: 100% !important;
  gap: 5px !important;
  padding: 3px !important;
  border-radius: 999px !important;
  background: rgba(2, 6, 23, 0.65) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

body.page-train.prestart-mode .opt-chips--inline .opt-chip {
  min-height: 32px !important;
  width: 100% !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  justify-content: center !important;
}

body.page-train.review-mode .hero-review {
  padding: 10px 14px !important;
  margin-bottom: 10px !important;
  border-radius: 18px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 4px 10px !important;
}

body.page-train.review-mode .hero-review .hero-brand,
body.page-train.review-mode .hero-review h1 {
  font-size: 1.08rem !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

body.page-train.review-mode .hero-review .review-title {
  font-size: 0.96rem !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

body.page-train.review-mode .hero-review .review-sub {
  width: 100% !important;
  font-size: 0.78rem !important;
  margin: 2px 0 0 !important;
  opacity: 0.82 !important;
}

body.page-train.review-mode .ybt-review-toolbar__row1 {
  display: flex !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
}

body.page-train.review-mode .ybt-review-toolbar__row1 #btn-review-shadowing {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 44px !important;
  font-size: 0.88rem !important;
}

body.page-train.review-mode .flow-review-controls--inline {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
}

body.page-train.review-mode .flow-review-controls--inline[hidden] {
  display: none !important;
}

body.page-train.review-mode .ybt-rev-btn--recommend {
  width: 100% !important;
  min-height: 44px !important;
  padding: 0 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(15, 23, 42, 0.85)) !important;
  color: #e0f2fe !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

body.page-train.review-mode .ybt-flow-review-status:empty {
  display: none !important;
}

body.page-train.review-mode .ybt-review-toolbar__row2 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding-top: 8px !important;
}

body.page-train.review-mode .review-row__confused-btn {
  display: none !important;
}


/* ==========================================================================
   v9.3 Unify All Prestart Option Chips (생각할 시간, 문제 수, 원어민 재생 횟수)
   with TTS Voice Gender High-Contrast Active Styling
   ========================================================================== */
body.page-train.prestart-mode #chips-think {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}

body.page-train.prestart-mode #chips-sentence-count {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
}

body.page-train.prestart-mode #chips-repeat {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
}

body.page-train.prestart-mode #chips-think .opt-chip,
body.page-train.prestart-mode #chips-sentence-count .opt-chip,
body.page-train.prestart-mode #chips-repeat .opt-chip,
body.page-train.prestart-mode #chips-word-level .opt-chip,
body.page-train.prestart-mode #chips-word-set .opt-chip {
  min-width: 0 !important;
  width: 100% !important;
  min-height: 40px !important;
  padding: 0 6px !important;
  border-radius: 12px !important;
  justify-content: center !important;
  white-space: nowrap !important;
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 10px rgba(2, 6, 23, 0.36) !important;
  transform: none !important;
}

body.page-train.prestart-mode #chips-think .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-sentence-count .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-repeat .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-level .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-set .opt-chip.opt-chip--active {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  border: 1.5px solid #e0f2fe !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  font-weight: 850 !important;
  text-shadow: none !important;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.58),
    0 4px 12px rgba(2, 132, 199, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 375px) {
  body.page-train.prestart-mode #chips-think {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}


/* ==========================================================================
   v9.4 Fixes:
   1. Completely hide '세트' (#prestart-set-block) in prestart
   2. Slim down .hero-review height & spacing (override min-height: 180px~250px)
   3. Crisp high-contrast '집중 학습' badge when heart is tapped
   ========================================================================== */
body.page-train #prestart-set-block,
body.page-train.prestart-mode #prestart-set-block {
  display: none !important;
}

body.page-train.review-mode .hero-review,
body.page-train.review-mode .page .hero-review,
body.page-train.review-mode .page--published-train-ui .hero-review {
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 14px !important;
  margin: 0 0 10px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 2px 10px !important;
  background: linear-gradient(165deg, rgba(20, 32, 58, 0.88), rgba(9, 15, 30, 0.94)) !important;
  border: 1px solid rgba(56, 189, 248, 0.34) !important;
  box-shadow: 0 10px 24px -10px rgba(2, 6, 23, 0.72) !important;
}

body.page-train.review-mode .hero-review::before,
body.page-train.review-mode .hero-review::after {
  display: none !important;
  content: none !important;
}

body.page-train.review-mode .hero-review .review-brand,
body.page-train.review-mode .hero-review h1 {
  font-size: 1.02rem !important;
  font-weight: 900 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  text-shadow: none !important;
}

body.page-train.review-mode .hero-review .review-title {
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  color: #7dd3fc !important;
  -webkit-text-fill-color: #7dd3fc !important;
  text-shadow: none !important;
}

body.page-train.review-mode .hero-review .review-sub {
  width: 100% !important;
  max-width: none !important;
  font-size: 0.76rem !important;
  font-weight: 500 !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  text-shadow: none !important;
}

body.page-train.review-mode .review-row__focus-pop {
  background: #f43f5e !important;
  border: 1px solid rgba(255, 228, 230, 0.75) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 0.78rem !important;
  font-weight: 850 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  text-shadow: none !important;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.48) !important;
}


/* ==========================================================================
   v9.9 Polish:
   1) Focus review bottom buttons (#btn-focus-redo + #btn-focus-echoing) 2-col row
   2) Redesigned celebratory & clean '훈련 완료!' completion card
   ========================================================================== */
body.page-train.review-mode .review-actions__secondary {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100%;
}

body.page-train.review-mode .review-actions__secondary #btn-focus-redo,
body.page-train.review-mode .review-actions__secondary #btn-focus-echoing {
  grid-column: auto !important;
  justify-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 54px !important;
  padding: 12px 10px !important;
  border-radius: 15px !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  background: linear-gradient(155deg, rgba(67, 79, 98, 0.94), rgba(50, 60, 77, 0.96)) !important;
  color: #f8fafc !important;
  font-size: clamp(0.84rem, 3.2vw, 0.96rem) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

body.page-train.review-mode .review-actions__secondary #btn-focus-redo.hidden,
body.page-train.review-mode .review-actions__secondary #btn-focus-echoing.hidden {
  display: none !important;
}

body.page-train.review-mode .review-actions__secondary #btn-focus-echoing.is-active {
  border-color: rgba(56, 189, 248, 0.72) !important;
  background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
  color: #ffffff !important;
}

/* Redesigned '훈련 완료!' completion card (v9.9) */
body.page-train .published-completion-card,
body.page-train .page--published-train-ui .published-completion-card {
  width: min(100%, 410px) !important;
  max-width: 410px !important;
  padding: 30px 22px 24px !important;
  border-radius: 30px !important;
  border: 1px solid rgba(125, 211, 252, 0.42) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.26) 0%, rgba(15, 23, 42, 0.9) 46%, rgba(8, 14, 28, 0.96) 100%) !important;
  box-shadow:
    0 24px 64px rgba(2, 6, 23, 0.72),
    0 0 36px rgba(14, 165, 233, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
  -webkit-backdrop-filter: blur(28px) saturate(150%) !important;
  backdrop-filter: blur(28px) saturate(150%) !important;
}

body.page-train .published-completion-check {
  width: 74px !important;
  height: 74px !important;
  margin: 0 auto 14px !important;
  border: 2px solid rgba(125, 211, 252, 0.85) !important;
  background: radial-gradient(circle at 30% 25%, #38bdf8 0%, #0284c7 55%, #0f172a 100%) !important;
  color: #ffffff !important;
  box-shadow:
    0 0 28px rgba(56, 189, 248, 0.55),
    0 10px 24px rgba(2, 6, 23, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.42) !important;
}

body.page-train .published-completion-card h2,
body.page-train .page--published-train-ui .published-completion-card h2 {
  margin: 0 0 8px !important;
  background: none !important;
  font-size: clamp(1.65rem, 6vw, 2rem) !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  color: #ffffff !important;
  text-shadow: 0 4px 18px rgba(56, 189, 248, 0.36) !important;
}

.published-completion-summary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 22px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.published-completion-summary-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

body.page-train .published-completion-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-top: 4px !important;
}

body.page-train .published-completion-actions .btn {
  min-height: 54px !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
  font-size: 0.94rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

/* Primary action: 내 녹음 들어보기 (full width hero button) */
body.page-train .published-completion-actions #btn-published-go-review {
  grid-column: 1 / -1 !important;
  min-height: 58px !important;
  font-size: 1.02rem !important;
  border: 1px solid rgba(125, 211, 252, 0.65) !important;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 55%, #0369a1 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 26px rgba(14, 165, 233, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.32) !important;
}

/* Secondary pair: 다시 연습하기 | 에코잉 훈련 */
body.page-train .published-completion-actions #btn-published-again,
body.page-train .published-completion-actions #btn-published-echoing {
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  background: rgba(30, 41, 59, 0.82) !important;
  color: #f1f5f9 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Bottom subtle button: 홈으로 */
body.page-train .published-completion-actions #btn-published-new-topic {
  grid-column: 1 / -1 !important;
  min-height: 48px !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  background: rgba(15, 23, 42, 0.65) !important;
  color: #cbd5e1 !important;
}

body.page-train #published-save-result,
body.page-train #flow-results,
body.page-train #btn-flow-completion-review,
body.page-train .published-completion-menu__message-pill {
  display: none !important;
}


/* ==========================================================================
   v9.10 Polish:
   - Place learning room favorite star button at top-right corner of each card
   - Free full horizontal width for card title text
   ========================================================================== */
.room-card {
  position: relative !important;
}

.room-card > .room-card__favorite {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 4 !important;
  margin: 0 !important;
}

.room-card__label {
  width: 100% !important;
  min-width: 0 !important;
}

.room-card__badges,
.room-card__track-pill,
.room-card__type-row {
  padding-right: 36px !important;
}

.room-card__title-row {
  display: block !important;
  width: 100% !important;
  padding-right: 0 !important;
}

.room-card__text-main {
  display: block !important;
  width: 100% !important;
}


/* ==========================================================================
   v9.11 Polish:
   1) Remove circular mini-ring badge on learning room cards
   2) Pin progress meta & level button uniformly to card bottom
   3) Eliminate rectangular tap highlight & focus outline on pill/rounded buttons
   ========================================================================== */
body.page-learning-room .room-learning-list {
  align-items: stretch !important;
}

body.page-learning-room .room-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

body.page-learning-room .room-card > .room-card__content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
}

body.page-learning-room .room-card__mini-ring {
  display: none !important;
}

body.page-learning-room .room-card__ring-row {
  display: block !important;
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 10px !important;
}

body.page-learning-room .room-card__ring-row .room-card__progress {
  width: 100% !important;
  margin-top: 0 !important;
  box-sizing: border-box !important;
}

body.page-learning-room .room-card__levels {
  width: 100% !important;
  margin-top: 8px !important;
  padding-top: 0 !important;
}

/* Global anti-square tap highlight & focus outline fix for rounded/pill controls */
button,
a,
input,
select,
summary,
[role="button"] {
  -webkit-tap-highlight-color: transparent !important;
}

button:focus,
a:focus,
[role="button"]:focus,
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: none !important;
}


/* ==========================================================================
   v9.12 Polish:
   - Spaced Reminding toast message ('7일 동안의 학습 기록이 없습니다')
   - Spaced Reminding dedicated completion card ([더 하기] | [학습방])
   - Ensure level-chooser circle icon stays hidden
   ========================================================================== */
.room-card__level-chooser-icon {
  display: none !important;
}

.ybt-remind-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 9999;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  max-width: min(90vw, 340px);
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.65), 0 0 20px rgba(56, 189, 248, 0.22);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.ybt-remind-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Dedicated 2-button layout for Spaced Reminding completion card */
body.page-train .published-completion-card--remind .published-completion-actions #btn-published-go-review,
body.page-train .published-completion-card--remind .published-completion-actions #btn-published-echoing {
  display: none !important;
}

body.page-train .published-completion-card--remind .published-completion-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body.page-train .published-completion-card--remind .published-completion-actions #btn-published-again {
  grid-column: auto !important;
  min-height: 56px !important;
  border: 1px solid rgba(125, 211, 252, 0.68) !important;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 60%, #0369a1 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.32) !important;
}

body.page-train .published-completion-card--remind .published-completion-actions #btn-published-new-topic {
  grid-column: auto !important;
  min-height: 56px !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  background: rgba(30, 41, 59, 0.88) !important;
  color: #f1f5f9 !important;
}


/* ==========================================================================
   v9.15 Polish:
   - Bright blue active state for '녹음 시작 진동 알림' (#chips-record-vibrate)
   ========================================================================== */
body.page-train.prestart-mode #chips-record-vibrate {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
}

body.page-train.prestart-mode #chips-record-vibrate .opt-chip {
  width: 100% !important;
  min-height: 40px !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-weight: 700 !important;
}

body.page-train.prestart-mode #chips-record-vibrate .opt-chip.opt-chip--active {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
  border: 1.5px solid #e0f2fe !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  font-weight: 850 !important;
  text-shadow: none !important;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.58),
    0 4px 12px rgba(2, 132, 199, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
  transform: translateY(-1px) !important;
}


/* ==========================================================================
   v9.17 Polish:
   - Prevent mobile GPU paint-drop on #chips-record-vibrate when settings open
   ========================================================================== */
body.page-train.prestart-mode #chips-record-vibrate {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 44px !important;
  position: relative !important;
  z-index: 2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  isolation: isolate !important;
}

body.page-train.prestart-mode #chips-record-vibrate .opt-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
}

body.page-train.prestart-mode #chips-record-vibrate .opt-chip.opt-chip--active {
  transform: none !important;
}


/* ==========================================================================
   v9.21 Final Polish:
   - Guarantee '녹음 시작 진동 알림' block (#prestart-record-vibrate-block)
     is never clipped or dropped by mobile GPU backdrop-filter compositing
   ========================================================================== */
body.page-train.prestart-mode #phase-prestart.prestart-panel {
  overflow: visible !important;
  contain: none !important;
}

body.page-train.prestart-mode #prestart-record-vibrate-block {
  display: block !important;
  grid-column: 1 / -1 !important;
  position: relative !important;
  z-index: 4 !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-height: 96px !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transform: none !important;
  will-change: auto !important;
}


/* ==========================================================================
   v9.23 Polish:
   - Fix mobile 2-swipe scroll snag on prestart settings screen
     (Eliminate nested scroll container caused by overflow-x: hidden on body/.page)
   ========================================================================== */
html:has(body.page-train.prestart-mode) {
  overflow-x: clip !important;
  overflow-y: auto !important;
  height: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body.page-train.prestart-mode {
  overflow-x: clip !important;
  overflow-y: visible !important;
  height: auto !important;
  min-height: 100dvh !important;
  touch-action: pan-y !important;
}

body.page-train.prestart-mode .page {
  overflow: visible !important;
  height: auto !important;
  touch-action: pan-y !important;
}


/* ==========================================================================
   v9.28 Settings UI Upgrade:
   - Remove heavy box-in-box outer border & redundant status strip
   - 1-row 5-column layout for '생각할 시간' (1초~5초)
   - Compact 1-screen fit so '시작하기' button is visible without scrolling
   ========================================================================== */
body.page-train.prestart-mode .page {
  padding-top: max(10px, env(safe-area-inset-top)) !important;
  padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
}

body.page-train.prestart-mode .hero-prestart {
  margin-bottom: 10px !important;
  padding-top: 2px !important;
  gap: 4px !important;
}

body.page-train.prestart-mode .hero-prestart__eyebrow {
  margin-bottom: 2px !important;
  padding: 3px 11px !important;
  font-size: 0.68rem !important;
}

body.page-train.prestart-mode .hero-prestart__brand {
  font-size: clamp(1.32rem, 5.2vw, 1.62rem) !important;
  line-height: 1.15 !important;
  margin: 0 !important;
}

body.page-train.prestart-mode .hero-prestart__tagline {
  font-size: 0.80rem !important;
  margin: 2px 0 0 !important;
  opacity: 0.86 !important;
}

body.page-train.prestart-mode .hero-prestart__hint {
  display: none !important;
}

/* Hide redundant default instruction strip while preserving error/warning/device panels */
body.page-train.prestart-mode #global-feedbacks.top-panel {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode #status-box.status-strip {
  display: none !important;
}

/* Remove heavy outer box-in-box border on prestart panel */
body.page-train.prestart-mode #phase-prestart.prestart-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  margin-top: 4px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.page-train.prestart-mode .prestart-head {
  display: none !important;
}

body.page-train.prestart-mode .prestart-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

body.page-train.prestart-mode #word-mode-prestart-extras {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
body.page-train.prestart-mode #word-mode-prestart-extras.hidden {
  display: none !important;
}

/* Sleek, low-contrast individual option cards */
body.page-train.prestart-mode .opt-block {
  padding: 10px 12px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  background: rgba(12, 20, 38, 0.72) !important;
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

body.page-train.prestart-mode .opt-label {
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  color: #cbd5e1 !important;
  margin-bottom: 7px !important;
  letter-spacing: -0.01em !important;
}

/* Single-row 5-column layout for '생각할 시간' (1초~5초) */
body.page-train.prestart-mode #chips-think {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}

body.page-train.prestart-mode #chips-think .opt-chip {
  min-width: 0 !important;
  padding: 0 4px !important;
  min-height: 38px !important;
  font-size: 0.84rem !important;
  border-radius: 11px !important;
}

/* Compact chips for sentence count, repeat, level, vibrate */
body.page-train.prestart-mode #chips-sentence-count,
body.page-train.prestart-mode #chips-record-vibrate {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

body.page-train.prestart-mode #chips-repeat {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

body.page-train.prestart-mode #chips-word-level {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.page-train.prestart-mode .opt-chip {
  min-height: 38px !important;
  border-radius: 11px !important;
  font-size: 0.84rem !important;
  padding: 0 6px !important;
}

body.page-train.prestart-mode #prestart-record-vibrate-block {
  min-height: auto !important;
}

body.page-train.prestart-mode #chips-record-vibrate {
  min-height: 38px !important;
}

body.page-train.prestart-mode #chips-record-vibrate .opt-chip {
  min-height: 38px !important;
}

/* Compact Voice Gender row */
body.page-train.prestart-mode .voice-gender-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 4px 2px 0 !important;
  background: transparent !important;
  border: 0 !important;
}

body.page-train.prestart-mode .voice-gender-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-width: 0 !important;
  width: 100% !important;
  gap: 5px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode .voice-gender-group__label {
  font-size: 0.72rem !important;
  color: #94a3b8 !important;
  text-align: center !important;
}

body.page-train.prestart-mode .voice-gender-bar .opt-chips--inline {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  gap: 5px !important;
}

body.page-train.prestart-mode .voice-gender-bar .opt-chip {
  min-width: 0 !important;
  width: 100% !important;
  min-height: 34px !important;
  font-size: 0.82rem !important;
}

body.page-train.prestart-mode .voice-gender-bar__divider {
  display: block !important;
  width: 1px !important;
  height: 44px !important;
  background: rgba(148, 163, 184, 0.22) !important;
}

/* Compact Footer with prominent Start CTA */
body.page-train.prestart-mode .prestart-footer {
  margin-top: 10px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

body.page-train.prestart-mode .prestart-footer__spacer {
  display: none !important;
}

body.page-train.prestart-mode .prestart-footer__actions {
  display: grid !important;
  grid-template-columns: 0.36fr 0.64fr !important;
  gap: 8px !important;
  width: 100% !important;
}

body.page-train.prestart-mode .prestart-footer__actions .btn {
  min-height: 46px !important;
  border-radius: 14px !important;
  font-size: 0.94rem !important;
  font-weight: 850 !important;
}


/* ==========================================================================
   v9.30 Settings UI Final Polish (4-Point Upgrade):
   1. Visual hierarchy: Calm translucent cyan tint for selected option chips;
      vibrant filled cyan gradient reserved exclusively for '시작하기' CTA
   2. Design consistency: Unify 'TTS 음성 성별' chips with rounded rectangles
      (remove outer capsule/pill border & 999px radius)
   3. True 1-screen fit (No-Scroll): Tighten vertical rhythm ~45px so top title
      never clips on mobile viewports
   4. Matte modern finish: Calm dark background scrim & remove harsh white
      glossy top specular lines (::before) on chips and footer buttons
   ========================================================================== */

/* 4-A) Calm background scrim so upper cards stay evenly legible */
body.page-train.prestart-mode .ybt-bg-scene {
  filter: blur(2.6px) brightness(0.58) saturate(0.95) !important;
}

body.page-train.prestart-mode.prestart-day .ybt-bg-scene {
  filter: blur(2.6px) brightness(0.64) saturate(0.95) !important;
}

body.page-train.prestart-mode .ybt-bg-vignette {
  background: linear-gradient(
    180deg,
    rgba(6, 11, 24, 0.56) 0%,
    rgba(5, 10, 22, 0.68) 55%,
    rgba(3, 7, 16, 0.88) 100%
  ) !important;
}

/* 4-B) Remove dated glossy white top bar (::before) on chips & footer buttons */
body.page-train.prestart-mode .opt-chip::before,
body.page-train.prestart-mode :is(.btn--prestart-secondary, #btn-prestart-start)::before {
  display: none !important;
  content: none !important;
}

/* 3) Tighter vertical rhythm for zero-scroll 1-screen mobile fit */
body.page-train.prestart-mode .page {
  padding-top: max(6px, env(safe-area-inset-top)) !important;
  padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
}

body.page-train.prestart-mode .hero-prestart {
  margin-bottom: 6px !important;
  padding-top: 0 !important;
  gap: 2px !important;
}

body.page-train.prestart-mode .hero-prestart__eyebrow {
  margin-bottom: 1px !important;
  padding: 2px 10px !important;
  font-size: 0.64rem !important;
}

body.page-train.prestart-mode .hero-prestart__brand {
  font-size: clamp(1.22rem, 4.8vw, 1.48rem) !important;
  line-height: 1.12 !important;
}

body.page-train.prestart-mode .hero-prestart__tagline {
  font-size: 0.76rem !important;
  margin: 1px 0 0 !important;
  opacity: 0.82 !important;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  margin-top: 2px !important;
}

body.page-train.prestart-mode .prestart-body,
body.page-train.prestart-mode #word-mode-prestart-extras {
  gap: 6px !important;
}

body.page-train.prestart-mode .opt-block {
  padding: 8px 11px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  background: rgba(10, 18, 34, 0.78) !important;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

body.page-train.prestart-mode .opt-label {
  font-size: 0.74rem !important;
  color: #cbd5e1 !important;
  margin-bottom: 5px !important;
}

/* Unified compact rounded-rectangle chips across all 5 cards */
body.page-train.prestart-mode .opt-chip,
body.page-train.prestart-mode #chips-think .opt-chip,
body.page-train.prestart-mode #chips-record-vibrate .opt-chip,
body.page-train.prestart-mode .voice-gender-bar .opt-chip {
  min-height: 34px !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  background: rgba(15, 23, 42, 0.76) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.page-train.prestart-mode #chips-record-vibrate {
  min-height: 34px !important;
}

/* 1) Visual Hierarchy: Calm cyan-tinted active chips (so Start CTA stands out) */
body.page-train.prestart-mode .opt-chip.opt-chip--active,
body.page-train.prestart-mode .opt-chips--inline .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-think .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-sentence-count .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-repeat .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-level .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-set .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-record-vibrate .opt-chip.opt-chip--active {
  background: rgba(56, 189, 248, 0.22) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.82) !important;
  color: #e0f2fe !important;
  -webkit-text-fill-color: #e0f2fe !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.22),
    inset 0 1px 0 rgba(186, 230, 253, 0.18) !important;
  transform: none !important;
}

/* 2) Unify 'TTS 음성 성별' layout (remove outer capsule border & pill radius) */
body.page-train.prestart-mode .voice-gender-bar {
  padding: 2px 0 0 !important;
  gap: 10px !important;
}

body.page-train.prestart-mode .voice-gender-group {
  gap: 4px !important;
}

body.page-train.prestart-mode .voice-gender-group__label {
  font-size: 0.70rem !important;
}

body.page-train.prestart-mode .voice-gender-bar .opt-chips--inline {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  gap: 6px !important;
}

body.page-train.prestart-mode .voice-gender-bar__divider {
  height: 38px !important;
  background: rgba(148, 163, 184, 0.16) !important;
}

/* 1 + 4) Footer buttons: Matte secondary '홈으로' & Sole vibrant CTA '시작하기' */
body.page-train.prestart-mode .prestart-footer {
  margin-top: 8px !important;
}

body.page-train.prestart-mode .prestart-footer__actions .btn,
body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  min-height: 44px !important;
  border-radius: 13px !important;
  font-size: 0.92rem !important;
  font-weight: 850 !important;
}

body.page-train.prestart-mode .btn--prestart-secondary {
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  background: rgba(15, 23, 42, 0.84) !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  text-shadow: none !important;
  box-shadow:
    0 4px 14px rgba(2, 6, 23, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.page-train.prestart-mode #btn-prestart-start {
  border: 1px solid rgba(125, 211, 252, 0.45) !important;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  text-shadow: none !important;
  box-shadow:
    0 10px 24px -4px rgba(14, 165, 233, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}


/* ==========================================================================
   v9.31 Native App Settings Redesign:
   - Full-height 100dvh flex layout: zero bottom dead space on any mobile height
   - 2 sleek matte glass groups ('훈련 리듬' / '음성 · 알림') + recessed segmented tracks
   - Native sliding toggle switch for '녹음 시작 진동 알림'
   - Live summary pill + 100% flat matte footer buttons (zero glossy/inset top bevels)
   ========================================================================== */
html:has(body.page-train.prestart-mode) {
  min-height: 100dvh !important;
}

body.page-train.prestart-mode {
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
}

body.page-train.prestart-mode .page {
  flex: 1 1 auto !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding-top: max(14px, env(safe-area-inset-top)) !important;
  padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
}

body.page-train.prestart-mode .hero-prestart {
  flex-shrink: 0 !important;
  margin-bottom: 12px !important;
  gap: 4px !important;
}

body.page-train.prestart-mode .hero-prestart__eyebrow {
  padding: 3px 11px !important;
  font-size: 0.65rem !important;
  letter-spacing: 0.14em !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  background: rgba(14, 165, 233, 0.10) !important;
}

body.page-train.prestart-mode .hero-prestart__brand {
  font-size: clamp(1.36rem, 5.2vw, 1.62rem) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
}

body.page-train.prestart-mode .hero-prestart__tagline {
  font-size: 0.80rem !important;
  color: #94a3b8 !important;
  opacity: 1 !important;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  margin-top: 0 !important;
  padding: 0 !important;
}

/* Center settings groups vertically with balanced breathing room; footer anchors to bottom */
body.page-train.prestart-mode .prestart-body {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: 4px 0 14px !important;
}

/* 2 Unified Glass Group Cards */
body.page-train.prestart-mode .ybt-set-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 14px 14px 15px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  background: rgba(10, 17, 32, 0.78) !important;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.42) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
}

body.page-train.prestart-mode .ybt-set-group__hd {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: -2px !important;
}

body.page-train.prestart-mode .ybt-set-group__title {
  font-size: 0.70rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  color: #7dd3fc !important;
  text-transform: uppercase !important;
}

/* Flatten inner opt-blocks inside group cards */
body.page-train.prestart-mode .ybt-set-group .opt-block {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode .ybt-set-group > .opt-block + .opt-block,
body.page-train.prestart-mode .ybt-set-group > #word-mode-prestart-extras:not(.hidden),
body.page-train.prestart-mode .ybt-set-group > #word-mode-prestart-extras:not(.hidden) + .opt-block {
  padding-top: 12px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.10) !important;
}

body.page-train.prestart-mode #word-mode-prestart-extras {
  gap: 12px !important;
}

body.page-train.prestart-mode .ybt-set-group .opt-label {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #cbd5e1 !important;
  margin-bottom: 7px !important;
}

/* Recessed Segmented Tracks (eliminates 20 noisy individual borders) */
body.page-train.prestart-mode #chips-think,
body.page-train.prestart-mode #chips-sentence-count,
body.page-train.prestart-mode #chips-repeat,
body.page-train.prestart-mode #chips-word-level,
body.page-train.prestart-mode #chips-word-set,
body.page-train.prestart-mode .voice-gender-bar .opt-chips--inline {
  background: rgba(2, 6, 23, 0.62) !important;
  border: 1px solid rgba(148, 163, 184, 0.10) !important;
  border-radius: 12px !important;
  padding: 3px !important;
  gap: 3px !important;
}

/* Clean Borderless Inactive Chips */
body.page-train.prestart-mode .opt-chip,
body.page-train.prestart-mode #chips-think .opt-chip,
body.page-train.prestart-mode .voice-gender-bar .opt-chip {
  min-height: 36px !important;
  border-radius: 9px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-size: 0.83rem !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Crisp Elevated Active Segment */
body.page-train.prestart-mode .opt-chip.opt-chip--active,
body.page-train.prestart-mode .opt-chips--inline .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-think .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-sentence-count .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-repeat .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-level .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-set .opt-chip.opt-chip--active {
  background: rgba(56, 189, 248, 0.20) !important;
  border: 1px solid rgba(56, 189, 248, 0.58) !important;
  color: #f0f9ff !important;
  -webkit-text-fill-color: #f0f9ff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.20) !important;
  transform: none !important;
}

/* Voice Gender Row Polish */
body.page-train.prestart-mode .voice-gender-bar {
  padding: 0 !important;
  gap: 10px !important;
}

body.page-train.prestart-mode .voice-gender-group {
  gap: 5px !important;
}

body.page-train.prestart-mode .voice-gender-group__label {
  font-size: 0.72rem !important;
  color: #94a3b8 !important;
  text-align: left !important;
  padding-left: 2px !important;
}

body.page-train.prestart-mode .voice-gender-bar__divider {
  display: block !important;
  width: 1px !important;
  height: 46px !important;
  align-self: end !important;
  margin-bottom: 2px !important;
  background: rgba(148, 163, 184, 0.14) !important;
}

/* Native Toggle Switch Row for '녹음 시작 진동 알림' */
body.page-train.prestart-mode #prestart-record-vibrate-block {
  min-height: auto !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.10) !important;
}

body.page-train.prestart-mode .ybt-vibrate-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

body.page-train.prestart-mode .ybt-vibrate-row__meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
}

body.page-train.prestart-mode .ybt-vibrate-row__meta .opt-label {
  margin: 0 !important;
  font-size: 0.80rem !important;
  color: #e2e8f0 !important;
}

body.page-train.prestart-mode .ybt-vibrate-row__sub {
  margin: 0 !important;
  font-size: 0.70rem !important;
  color: #64748b !important;
  line-height: 1.3 !important;
}

body.page-train.prestart-mode .ybt-native-switch {
  position: relative !important;
  flex-shrink: 0 !important;
  width: 48px !important;
  height: 28px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  background: rgba(15, 23, 42, 0.90) !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

body.page-train.prestart-mode .ybt-native-switch::after {
  content: "" !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #94a3b8 !important;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease !important;
}

body.page-train.prestart-mode .ybt-native-switch.is-on,
body.page-train.prestart-mode .ybt-native-switch[aria-checked="true"] {
  background: #0ea5e9 !important;
  border-color: #38bdf8 !important;
}

body.page-train.prestart-mode .ybt-native-switch.is-on::after,
body.page-train.prestart-mode .ybt-native-switch[aria-checked="true"]::after {
  transform: translateX(20px) !important;
  background: #ffffff !important;
}

/* Visually hide legacy vibrate chips while keeping them in DOM for full JS compatibility */
body.page-train.prestart-mode #chips-record-vibrate.ybt-sr-chips {
  display: none !important;
}

/* Bottom Dock: Anchored cleanly at bottom with zero dead space & flat matte buttons */
body.page-train.prestart-mode .prestart-footer {
  margin-top: auto !important;
  padding: 8px 0 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode .ybt-prestart-summary {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 0.74rem !important;
  font-weight: 650 !important;
  color: #94a3b8 !important;
  letter-spacing: -0.01em !important;
}

body.page-train.prestart-mode .ybt-prestart-summary__dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #38bdf8 !important;
  flex-shrink: 0 !important;
}

body.page-train.prestart-mode .prestart-footer__actions {
  display: grid !important;
  grid-template-columns: 0.32fr 0.68fr !important;
  gap: 9px !important;
  width: 100% !important;
}

/* Completely eliminate glossy/inset top bevels & borders on both footer buttons */
body.page-train.prestart-mode .btn--prestart-secondary::before,
body.page-train.prestart-mode .btn--prestart-secondary::after,
body.page-train.prestart-mode #btn-prestart-start::before,
body.page-train.prestart-mode #btn-prestart-start::after {
  display: none !important;
  content: none !important;
}

body.page-train.prestart-mode .prestart-footer__actions .btn,
body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 0.94rem !important;
  font-weight: 850 !important;
  text-shadow: none !important;
}

body.page-train.prestart-mode .btn--prestart-secondary {
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  background: rgba(15, 23, 42, 0.90) !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  box-shadow: none !important;
}

body.page-train.prestart-mode #btn-prestart-start {
  border: 0 !important;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  box-shadow: 0 10px 26px -6px rgba(14, 165, 233, 0.54) !important;
}


/* ==========================================================================
   v9.32 Settings Final Polish:
   1. Fix narrow card shrink-to-fit & 24px bottom margin on #phase-prestart
   2. Compress vertical spacing (~90px saved) so bottom buttons never clip
   3. Override high-specificity ID rules so inactive chips in #chips-sentence-count
      and #chips-repeat are cleanly borderless like #chips-think
   ========================================================================== */
body.page-train.prestart-mode .page {
  width: 100% !important;
  max-width: 560px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
  padding-top: max(8px, env(safe-area-inset-top)) !important;
  padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  box-sizing: border-box !important;
}

body.page-train.prestart-mode .hero-prestart {
  margin-bottom: 8px !important;
  padding-top: 0 !important;
  gap: 2px !important;
}

body.page-train.prestart-mode .hero-prestart__eyebrow {
  padding: 2px 10px !important;
  font-size: 0.63rem !important;
}

body.page-train.prestart-mode .hero-prestart__brand {
  font-size: clamp(1.24rem, 4.8vw, 1.48rem) !important;
  line-height: 1.12 !important;
}

body.page-train.prestart-mode .hero-prestart__tagline {
  font-size: 0.76rem !important;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

body.page-train.prestart-mode .prestart-body {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 2px 0 8px !important;
  width: 100% !important;
}

body.page-train.prestart-mode .ybt-set-group {
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 8px !important;
  padding: 11px 12px 12px !important;
  border-radius: 18px !important;
}

body.page-train.prestart-mode .ybt-set-group__hd {
  margin-bottom: -3px !important;
}

body.page-train.prestart-mode .ybt-set-group > .opt-block + .opt-block,
body.page-train.prestart-mode .ybt-set-group > #word-mode-prestart-extras:not(.hidden),
body.page-train.prestart-mode .ybt-set-group > #word-mode-prestart-extras:not(.hidden) + .opt-block,
body.page-train.prestart-mode #prestart-record-vibrate-block {
  padding-top: 8px !important;
}

body.page-train.prestart-mode #word-mode-prestart-extras {
  gap: 8px !important;
}

body.page-train.prestart-mode .ybt-set-group .opt-label {
  font-size: 0.73rem !important;
  margin-bottom: 5px !important;
}

/* Override high-specificity ID selectors for ALL inactive segmented chips */
body.page-train.prestart-mode #chips-think .opt-chip,
body.page-train.prestart-mode #chips-sentence-count .opt-chip,
body.page-train.prestart-mode #chips-repeat .opt-chip,
body.page-train.prestart-mode #chips-word-level .opt-chip,
body.page-train.prestart-mode #chips-word-set .opt-chip,
body.page-train.prestart-mode .voice-gender-bar .opt-chip {
  min-height: 33px !important;
  padding: 0 4px !important;
  border-radius: 9px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  transform: none !important;
}

/* Re-apply crisp active state with matching high specificity */
body.page-train.prestart-mode #chips-think .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-sentence-count .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-repeat .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-level .opt-chip.opt-chip--active,
body.page-train.prestart-mode #chips-word-set .opt-chip.opt-chip--active,
body.page-train.prestart-mode .voice-gender-bar .opt-chip.opt-chip--active {
  background: rgba(56, 189, 248, 0.20) !important;
  border: 1px solid rgba(56, 189, 248, 0.58) !important;
  color: #f0f9ff !important;
  -webkit-text-fill-color: #f0f9ff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.20) !important;
  transform: none !important;
}

body.page-train.prestart-mode .voice-gender-bar__divider {
  height: 38px !important;
}

body.page-train.prestart-mode .ybt-vibrate-row__meta .opt-label {
  font-size: 0.78rem !important;
}

body.page-train.prestart-mode .ybt-vibrate-row__sub {
  font-size: 0.68rem !important;
}

body.page-train.prestart-mode .ybt-native-switch {
  width: 44px !important;
  height: 26px !important;
}

body.page-train.prestart-mode .ybt-native-switch::after {
  width: 18px !important;
  height: 18px !important;
}

body.page-train.prestart-mode .ybt-native-switch.is-on::after,
body.page-train.prestart-mode .ybt-native-switch[aria-checked="true"]::after {
  transform: translateX(18px) !important;
}

body.page-train.prestart-mode .prestart-footer {
  margin-top: auto !important;
  padding: 4px 0 0 !important;
  gap: 6px !important;
  width: 100% !important;
}

body.page-train.prestart-mode .ybt-prestart-summary {
  font-size: 0.72rem !important;
}

body.page-train.prestart-mode .prestart-footer__actions .btn,
body.page-train.prestart-mode .btn--prestart-secondary,
body.page-train.prestart-mode #btn-prestart-start {
  min-height: 45px !important;
  border-radius: 13px !important;
  font-size: 0.92rem !important;
}


/* ==========================================================================
   v9.33 Settings Zero-Scroll 100dvh Lock & Footer Gap Fix:
   - Root cause fix: legacy .prestart-footer__actions had `flex: 1 1 220px`
     which became 220px VERTICAL height inside column-flex .prestart-footer!
   - Lock html/body/.page to exact 100dvh with overflow:hidden (zero scroll/bounce)
   - Responsive tightening for compact screens (<= 700px height)
   ========================================================================== */
html:has(body.page-train.prestart-mode),
body.page-train.prestart-mode {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: manipulation !important;
}

body.page-train.prestart-mode .page {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: manipulation !important;
  padding-top: max(10px, env(safe-area-inset-top)) !important;
  padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
}

body.page-train.prestart-mode #phase-prestart.prestart-panel {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.page-train.prestart-mode .prestart-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 0 !important;
}

/* Eliminate legacy sticky & 220px flex-basis gap on footer */
body.page-train.prestart-mode .prestart-footer {
  position: static !important;
  bottom: auto !important;
  flex: 0 0 auto !important;
  margin-top: auto !important;
  padding: 6px 0 0 !important;
  gap: 7px !important;
  width: 100% !important;
}

body.page-train.prestart-mode .ybt-prestart-summary {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

body.page-train.prestart-mode .prestart-footer__actions {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Compact screen safeguard (e.g., iPhone SE / small Android viewports <= 700px tall) */
@media (max-height: 700px) {
  body.page-train.prestart-mode .hero-prestart {
    margin-bottom: 4px !important;
  }
  body.page-train.prestart-mode .hero-prestart__brand {
    font-size: 1.18rem !important;
  }
  body.page-train.prestart-mode .hero-prestart__tagline {
    font-size: 0.72rem !important;
  }
  body.page-train.prestart-mode .prestart-body {
    gap: 6px !important;
  }
  body.page-train.prestart-mode .ybt-set-group {
    padding: 8px 10px 9px !important;
    gap: 6px !important;
    border-radius: 15px !important;
  }
  body.page-train.prestart-mode .ybt-set-group > .opt-block + .opt-block,
  body.page-train.prestart-mode .ybt-set-group > #word-mode-prestart-extras:not(.hidden),
  body.page-train.prestart-mode .ybt-set-group > #word-mode-prestart-extras:not(.hidden) + .opt-block,
  body.page-train.prestart-mode #prestart-record-vibrate-block {
    padding-top: 6px !important;
  }
  body.page-train.prestart-mode .ybt-set-group .opt-label {
    margin-bottom: 4px !important;
  }
  body.page-train.prestart-mode #chips-think .opt-chip,
  body.page-train.prestart-mode #chips-sentence-count .opt-chip,
  body.page-train.prestart-mode #chips-repeat .opt-chip,
  body.page-train.prestart-mode #chips-word-level .opt-chip,
  body.page-train.prestart-mode #chips-word-set .opt-chip,
  body.page-train.prestart-mode .voice-gender-bar .opt-chip {
    min-height: 30px !important;
    font-size: 0.78rem !important;
  }
  body.page-train.prestart-mode .prestart-footer__actions .btn,
  body.page-train.prestart-mode .btn--prestart-secondary,
  body.page-train.prestart-mode #btn-prestart-start {
    min-height: 42px !important;
  }
}
