
/* ═══════════════════════════════════════════════════════════════
   AUDIKUNG NORTH STAR — ALL-ROUNDER ENGLISH OS
   Duolingo Gamification Engine × Prestige Cosmic Aesthetic
   ═══════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'AK Thai';
  src: url('/assets/fonts/noto-sans-thai.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  --aku-font-head: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --aku-font-body: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --aku-font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
  --bg: #030712;
  --surface: #090f20;
  --surface-card: rgba(13, 22, 42, 0.82);
  --surface-raised: rgba(20, 34, 64, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --ink: #f0f0f5;
  --ink-soft: #a3a3b8;
  --muted: #72768d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-gold: rgba(247, 197, 72, 0.35);

  /* Audikung Brand Accents */
  --gold: #F7C548;
  --gold-light: #ffd76b;
  --gold-glow: rgba(247, 197, 72, 0.45);
  --gold-dim: rgba(247, 197, 72, 0.12);
  --gold-shadow: #8d6210;

  --shrimp: #ff6a4d;
  --shrimp-glow: rgba(255, 106, 77, 0.45);
  --shrimp-dim: rgba(255, 106, 77, 0.12);
  --orange: #FF8C42;
  --orange-shadow: #7a3a0e;

  --blue: #6aa9e8;
  --blue-shadow: #194677;
  --blue-dim: rgba(106, 169, 232, 0.12);

  --green: #4DD2A0;
  --green-dark: #ffd76b;
  --green-shadow: #185f43;
  --green-soft: rgba(77, 210, 160, 0.1);

  --red: #f0857a;
  --red-shadow: #731b1b;
  --red-dim: rgba(240, 133, 122, 0.12);

  --focus: #ffd76b;
  --font-en-display: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --font-en-body: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --font-th: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --sans: "AK Thai", "Google Sans", sans-serif;
  --display: "AK Thai", "Google Sans", sans-serif;
  --ease-pop: cubic-bezier(.2, .9, .3, 1.35);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  background: radial-gradient(ellipse at 50% -12%, rgba(247, 197, 72, 0.14) 0%, rgba(255, 106, 77, 0.07) 32%, #030712 68%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(247, 197, 72, 0.22) .65px, transparent .75px);
  background-size: 28px 28px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
  opacity: .5;
  pointer-events: none;
}

.shrimp-wm {
  position: fixed;
  right: -30px;
  bottom: -40px;
  font-size: 240px;
  opacity: 0.04;
  transform: rotate(-12deg);
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

::selection {
  background: var(--gold);
  color: #030712;
}

button, input { font: inherit; }
button { min-height: 44px; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button:disabled {
  cursor: not-allowed;
  filter: grayscale(.65);
  opacity: .45;
}
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 30;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: #030712;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* ── SHELL CONTAINER ── */
.vocab-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 96px 0 100px;
  position: relative;
  z-index: 1;
}

/* ── WORKSPACE HEADER (HERO WITH KUNG-KI MASCOT) ── */
.workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .74fr);
  gap: clamp(32px, 6vw, 76px);
  align-items: center;
  margin-bottom: 28px;
}

.workspace-hero-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.hero-pixel-badge {
  position: relative;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 3px;
  background: radial-gradient(circle at 35% 35%, rgba(247, 197, 72, 0.4), rgba(13, 22, 42, 0.95) 75%);
  border: 2px solid rgba(247, 197, 72, 0.5);
  box-shadow: 0 0 28px rgba(247, 197, 72, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

#heroPixelCanvas,
.hero-pixel-img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
  animation: hero-head-bob 3.2s ease-in-out infinite;
  transform-origin: center bottom;
  transition: transform 220ms var(--ease-pop);
}

@keyframes hero-head-bob {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  35% { transform: translateY(-3px) scale(1.04, 0.98) rotate(-2.5deg); }
  70% { transform: translateY(-1px) scale(0.98, 1.02) rotate(2.5deg); }
}

.hero-pixel-badge:hover .hero-pixel-img {
  transform: scale(1.15) rotate(5deg);
}

.mascot-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px dashed rgba(247, 197, 72, 0.6);
  pointer-events: none;
  animation: ring-spin 18s linear infinite;
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(247, 197, 72, 0.1);
  border: 1px solid rgba(247, 197, 72, 0.3);
  margin-bottom: 6px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--shrimp);
  box-shadow: 0 0 8px var(--shrimp);
}

.eyebrow, .sheet-kicker, .quest-kicker, .challenge-label {
  color: var(--gold-light);
  font-family: var(--font-en-display);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.workspace-title h1 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 4.6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .98;
  color: #fff;
  text-shadow: 0 0 28px rgba(247, 197, 72, 0.25);
  text-wrap: balance;
}

.workspace-title p {
  max-width: 58ch;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: .98rem;
  line-height: 1.65;
  text-wrap: pretty;
}

/* ── PLAYER STATUS HUD (GAMIFIED STATS) ── */
.player-hud {
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 5px solid #cfbf9f;
  border-radius: 26px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 55%, #f6efe0 100%);
  color: #111827;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.65),
    0 0 36px rgba(245, 158, 11, 0.12),
    inset 0 1px 0 #ffffff,
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.hud-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hud-stat {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  border-right: 1px solid #e5dcc7;
}
.hud-stat:last-child { border-right: 0; }
.hud-stat > span {
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 6px rgba(217, 119, 6, 0.25));
}
.hud-stat div, .hud-stat strong, .hud-stat small {
  display: block;
  min-width: 0;
}
.hud-stat strong {
  font-family: var(--font-en-display);
  font-size: 1.25rem;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.hud-stat small {
  margin-top: 3px;
  color: #6b7280;
  font-size: .68rem;
  white-space: nowrap;
}

.hud-goal {
  padding: 14px 18px 16px;
  border-top: 1.5px solid #e5dcc7;
  background: rgba(241, 235, 217, 0.45);
}
.hud-goal > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #4b5563;
  font-size: .78rem;
}
.hud-goal strong {
  color: #92400e;
  font-family: var(--font-en-display);
  font-variant-numeric: tabular-nums;
}
.hud-goal-track {
  height: 10px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2d7c0;
}
.hud-goal-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 480ms var(--ease-pop);
}

/* ── 3D TACTILE TABS & CAROUSEL NAVIGATION ── */
.workspace-tabs-wrapper {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  width: 100%;
  gap: 8px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 6px 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.workspace-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 4px 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  flex: 1 1 0;
  min-width: 0;
}
.workspace-tabs.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}
.workspace-tabs::-webkit-scrollbar { display: none; }

/* Left & Right Smooth Scroll Chevrons */
.tabs-scroll-btn {
  position: relative;
  z-index: 3;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fef3c7;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.tabs-scroll-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(245, 158, 11, 0.6);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 14px rgba(245, 158, 11, 0.3);
}
.tabs-scroll-btn:active {
  transform: translateY(1px) scale(0.96);
}
.tabs-scroll-btn[hidden] {
  display: none !important;
}

/* Base Tab Styling: Luminous Frosted Capsule — ชัดเจน คอนทราสต์สูง อ่านง่าย สบายตา */
.workspace-tab {
  flex: 0 0 auto;
  min-width: 136px;
  min-height: 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-bottom: 3.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 8px 18px 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  cursor: pointer;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .01em;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.workspace-tab:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  border-bottom-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.workspace-tab:active {
  border-bottom-width: 1.5px;
  transform: translateY(2px) scale(0.98);
}

.workspace-tab[data-panel="review"]:hover { border-color: rgba(245, 158, 11, 0.5); }
.workspace-tab[data-panel="phrasal"]:hover { border-color: rgba(168, 85, 247, 0.5); }
.workspace-tab[data-panel="speaking"]:hover { border-color: rgba(14, 165, 233, 0.5); }
.workspace-tab[data-panel="shadowing"]:hover { border-color: rgba(20, 184, 166, 0.5); }
.workspace-tab[data-panel="grammar"]:hover { border-color: rgba(16, 185, 129, 0.5); }
.workspace-tab[data-panel="writing"]:hover { border-color: rgba(249, 115, 22, 0.5); }
.workspace-tab[data-panel="library"]:hover { border-color: rgba(234, 179, 8, 0.5); }
.workspace-tab[data-panel="capture"]:hover { border-color: rgba(236, 72, 153, 0.5); }

/* Category Signature 3D Gamified Active States & Borders (Deep Royal Navy + Crisp White + Signature Rim) */
.workspace-tab[aria-selected="true"] {
  border-color: transparent;
  border-bottom: 3px solid var(--tab-accent, #f59e0b);
  background: rgba(245, 158, 11, 0.12);
  color: #ffffff;
  font-weight: 800;
}

.workspace-tab[data-panel="review"][aria-selected="true"] {
  border-color: #f59e0b;
  border-bottom-color: #b45309;
}

.workspace-tab[data-panel="phrasal"][aria-selected="true"] {
  border-color: #c084fc;
  border-bottom-color: #7e22ce;
}

.workspace-tab[data-panel="speaking"][aria-selected="true"] {
  border-color: #38bdf8;
  border-bottom-color: #0284c7;
}

.workspace-tab[data-panel="shadowing"][aria-selected="true"] {
  border-color: #2dd4bf;
  border-bottom-color: #0f766e;
}

.workspace-tab[data-panel="grammar"][aria-selected="true"] {
  border-color: #34d399;
  border-bottom-color: #047857;
}

.workspace-tab[data-panel="writing"][aria-selected="true"] {
  border-color: #fb923c;
  border-bottom-color: #c2410c;
}

.workspace-tab[data-panel="library"][aria-selected="true"] {
  border-color: #eab308;
  border-bottom-color: #a16207;
}

.workspace-tab[data-panel="capture"][aria-selected="true"] {
  border-color: #f472b6;
  border-bottom-color: #be185d;
}

.workspace-panel { min-width: 0; }

/* ── REVIEW WORKSPACE LAYOUT ── */
.review-layout {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 46px);
  align-items: start;
}
.review-layout::before {
  content: "";
  position: absolute;
  inset: -60px -40px;
  background: radial-gradient(ellipse at 50% 30%, rgba(245, 158, 11, 0.09) 0%, rgba(217, 119, 6, 0.03) 50%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* ── SESSION LEDGER (LEFT PRESTIGE QUEST HUB) ── */
.session-ledger {
  position: sticky;
  top: 90px;
  z-index: 2;
  min-width: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 6px solid #cfbf9f;
  border-radius: 28px;
  padding: 24px 20px 20px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 55%, #f6efe0 100%);
  color: #111827;
  backdrop-filter: blur(14px);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.65),
    0 0 45px rgba(245, 158, 11, 0.12),
    inset 0 1px 0 #ffffff,
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* ── 16-BIT KUNG-KI PIXEL COMPANION STAGE ── */
.pixel-companion-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -6px 0 18px;
  position: relative;
  text-align: center;
}

.pixel-speech-bubble {
  position: relative;
  z-index: 3;
  margin-bottom: 12px;
  padding: 9px 18px;
  border: 1.5px solid #e2d7c0;
  border-radius: 18px;
  background: #ffffff;
  color: #111827;
  font-family: var(--font-en-display);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 #ffffff;
  max-width: 220px;
  text-align: center;
  transition: transform 200ms var(--ease-pop);
}

.pixel-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #e2d7c0;
}

.pixel-speech-bubble.is-pop {
  animation: bubble-pop 340ms var(--ease-pop) both;
}

@keyframes bubble-pop {
  0% { transform: scale(0.85) translateY(4px); opacity: 0; }
  60% { transform: scale(1.08) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.pixel-companion-avatar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  padding: 4px;
  border-radius: 20px;
  transition: transform 220ms var(--ease-pop);
}

.pixel-companion-avatar:hover {
  transform: scale(1.08) translateY(-4px);
}

.pixel-companion-avatar:active {
  transform: scale(0.96) translateY(2px);
}

#pixelMascotCanvas,
.pixel-mascot-img {
  display: block;
  width: 130px;
  height: 130px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 18px rgba(247, 197, 72, 0.32));
  animation: pixel-mascot-idle 2.6s ease-in-out infinite;
  transform-origin: center bottom;
  user-select: none;
  pointer-events: none;
}

/* Pose-specific living motions */
.pixel-companion-avatar.pose-idle .pixel-mascot-img {
  animation: pixel-mascot-idle 2.6s ease-in-out infinite;
}

.pixel-companion-avatar.pose-study .pixel-mascot-img {
  animation: pixel-mascot-study 2.8s ease-in-out infinite;
}

.pixel-companion-avatar.pose-cheer .pixel-mascot-img {
  animation: pixel-mascot-cheer 1.35s ease-in-out infinite;
}

.pixel-companion-avatar.pose-encourage .pixel-mascot-img {
  animation: pixel-mascot-encourage 2.2s ease-in-out infinite;
}

.pixel-companion-avatar.pose-victory .pixel-mascot-img {
  animation: pixel-mascot-victory 1.6s ease-in-out infinite;
}

@keyframes pixel-mascot-idle {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(-7px) scale(1.02, 0.98) rotate(-1.5deg); }
  70% { transform: translateY(-2px) scale(0.99, 1.01) rotate(1.5deg); }
}

@keyframes pixel-mascot-study {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  40% { transform: translateY(-5px) scale(1.02, 0.98) rotate(-2deg); }
  75% { transform: translateY(-1px) scale(0.99, 1.01) rotate(1deg); }
}

@keyframes pixel-mascot-cheer {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  25% { transform: translateY(-14px) scale(1.06, 0.94) rotate(-4deg); }
  50% { transform: translateY(0) scale(0.95, 1.05) rotate(0deg); }
  75% { transform: translateY(-9px) scale(1.03, 0.97) rotate(4deg); }
}

@keyframes pixel-mascot-encourage {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(-8px) scale(1.04, 0.96) rotate(2.5deg); }
  70% { transform: translateY(-2px) scale(0.98, 1.02) rotate(-1deg); }
}

@keyframes pixel-mascot-victory {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  25% { transform: translateY(-11px) scale(1.06, 0.94) rotate(4.5deg); }
  50% { transform: translateY(0) scale(0.96, 1.04) rotate(0deg); }
  75% { transform: translateY(-11px) scale(1.06, 0.94) rotate(-4.5deg); }
}

.pixel-companion-avatar.is-active-pose .pixel-mascot-img {
  animation: mascot-pose-pop 420ms var(--ease-pop) forwards;
}

@keyframes mascot-pose-pop {
  0% { transform: scale(0.85); }
  40% { transform: scale(1.16) translateY(-12px) rotate(-3deg); }
  75% { transform: scale(0.96) translateY(2px) rotate(2deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}

.pixel-shadow {
  width: 54px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75) 0%, transparent 72%);
  margin-top: 2px;
  animation: shadow-pulse 2.4s ease-in-out infinite;
}

@keyframes shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.7; }
  50% { transform: scaleX(0.72); opacity: 0.3; }
}

.pixel-controls {
  margin-top: 8px;
}

.pixel-pose-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 14px;
  border: 1.5px solid #d8cdb7;
  border-bottom: 3px solid #bdae95;
  border-radius: 9999px;
  background: #fbf6ec;
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: filter 140ms ease, transform 140ms ease, background 140ms ease;
}

.pixel-pose-btn:hover {
  background: #f1ebd9;
  color: #78350f;
  transform: translateY(-2px);
}

.pixel-pose-btn:active {
  border-bottom-width: 1px;
  transform: translateY(2px) scale(0.98);
}

.pixel-spark-icon {
  font-size: 0.95rem;
}

.quest-kicker {
  margin: 0;
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.session-ledger h2 {
  margin: 3px 0 0;
  font-family: var(--font-en-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: #111827;
}

.quest-copy {
  margin: 8px 0 16px;
  color: #4b5563;
  font-size: .84rem;
  line-height: 1.55;
}

.session-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.session-vitals span {
  padding: 6px 12px;
  border-radius: 12px;
  background: #f1ebd9;
  border: 1px solid #d8cdb7;
  border-bottom: 2px solid #cfbf9f;
  color: #374151;
  font-size: .74rem;
  font-weight: 700;
}
.session-vitals strong {
  color: #111827;
  font-family: var(--font-en-display);
  font-variant-numeric: tabular-nums;
}

.ledger-list {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1.5px solid #e5dcc7;
}
.ledger-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #eadecb;
}
.ledger-line dt {
  color: #374151;
  font-size: .8rem;
  font-weight: 600;
}
.ledger-line dd {
  margin: 0;
  color: #111827;
  font-family: var(--font-en-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ledger-note {
  margin: 16px 0 10px;
  color: #374151;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.55;
}

.session-ledger .text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: #f1ebd9;
  border: 1.5px solid #d8cdb7;
  border-bottom: 4px solid #bdae95;
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: filter 140ms ease, transform 140ms ease, background 140ms ease;
}
.session-ledger .text-action:hover {
  background: #ece4cd;
  color: #78350f;
  transform: translateY(-2px);
}
.session-ledger .text-action:active {
  border-bottom-width: 1.5px;
  transform: translateY(2px);
}

.text-action, .undo-button, .quiet-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--gold-light);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(247, 197, 72, 0.4);
  text-underline-offset: 5px;
  transition: color 140ms ease;
}
.text-action:hover, .undo-button:hover, .quiet-button:hover {
  color: #fff;
}

/* ── REVIEW STAGE & PATH ── */
.review-stage {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.session-progress { margin: 0 4px 18px; }
.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: .82rem;
}
.progress-copy strong {
  color: var(--gold-light);
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.progress-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--gold), var(--green));
  box-shadow: 0 0 16px rgba(247, 197, 72, 0.4);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 520ms var(--ease-pop);
}

.lesson-path {
  display: flex;
  justify-content: space-between;
  margin: -9px 6px 0;
}
.lesson-path span {
  width: 8px;
  height: 8px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: #252e46;
  box-shadow: 0 0 0 1px #252e46;
  transition: background 220ms ease, transform 220ms var(--ease-pop);
}
.lesson-path span.is-complete {
  background: #fff;
  box-shadow: 0 0 0 1px var(--gold);
}
.lesson-path span.is-current {
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-shadow), 0 0 10px var(--gold);
  transform: scale(1.45);
}

/* ── THE CITATION SLIP (PRESTIGE CREAM FLASHCARD / TRADING CARD) ── */
.citation-slip {
  position: relative;
  height: clamp(480px, 62vh, 560px);
  max-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 6px solid #cfbf9f;
  border-radius: 36px;
  padding: clamp(24px, 4vw, 38px);
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 55%, #f6efe0 100%);
  color: #111827;
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.75),
    0 0 55px rgba(245, 158, 11, 0.15),
    0 0 110px rgba(251, 191, 36, 0.08),
    inset 0 1px 0 #ffffff,
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  scroll-margin-top: 96px;
  animation: card-appear 440ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.citation-slip.is-revealed {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* Custom sleek warm scrollbar for card */
.citation-slip::-webkit-scrollbar {
  width: 6px;
}
.citation-slip::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  margin: 12px;
}
.citation-slip::-webkit-scrollbar-thumb {
  background: #cfbf9f;
  border-radius: 999px;
}
.citation-slip::-webkit-scrollbar-thumb:hover {
  background: #b5a484;
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.citation-slip::before {
  content: none;
}
.citation-slip::after {
  position: absolute;
  right: -34px;
  bottom: -35px;
  width: 130px;
  height: 130px;
  border: 18px solid rgba(217, 119, 6, 0.04);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.slip-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #6b7280;
  font-size: .75rem;
  flex-shrink: 0;
}
.challenge-label {
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.slip-position {
  padding: 5px 12px;
  border-radius: 10px;
  background: #f1ebd9;
  border: 1px solid #d8cdb7;
  color: #4b5563;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.prompt-block {
  padding: 24px 0 20px;
  text-align: center;
  flex-shrink: 0;
}
.prompt-kicker {
  margin: 0 0 12px;
  color: #4b5563;
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: .95rem;
}
.word-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.review-word {
  margin: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-family: var(--font-en-display);
  font-size: clamp(3.2rem, 7.5vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .98;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  text-wrap: balance;
}

.sense-number, .part-of-speech {
  display: inline-block;
  border-radius: 8px;
  font-size: .74rem;
  font-weight: 700;
}
.sense-number {
  padding: 4px 10px;
  white-space: nowrap;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}
.part-of-speech {
  margin-top: 10px;
  padding: 4px 12px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pronunciation-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  color: #4b5563;
}
.pronunciation-row span {
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 1.05rem;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  place-items: center;
  border: 1.5px solid #c7d2fe;
  border-bottom: 4px solid #818cf8;
  border-radius: 12px;
  background: #eef2ff;
  color: #4338ca;
  cursor: pointer;
  transition: transform 140ms ease, border-bottom-width 140ms ease;
}
.icon-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.icon-button:active { border-bottom-width: 1px; transform: translateY(3px); }
.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* ── 3D REVEAL BUTTON (CHUNKY DUOLINGO STYLE × SCULPTED PILL) ── */
.reveal-button, .primary-dark-button, .paper-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-bottom-width: 5px;
  border-radius: 9999px;
  padding: 12px 26px 10px;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reveal-button {
  position: relative;
  display: flex;
  width: min(390px, 100%);
  min-height: 68px;
  flex-direction: column;
  margin: 16px auto 8px;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 2px solid #fcd34d;
  border-bottom: 6px solid #b45309;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.35);
  overflow: hidden;
}
.reveal-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-150%) skewX(-20deg);
  animation: sheen-sweep 3.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen-sweep {
  0% { transform: translateX(-150%) skewX(-20deg); }
  22%, 100% { transform: translateX(350%) skewX(-20deg); }
}
.reveal-button span {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.reveal-button small {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
}
.reveal-button:hover, .primary-dark-button:hover, .paper-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}
.reveal-button:active, .primary-dark-button:active, .paper-button:active {
  border-bottom-width: 2px;
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.2);
}

/* ── ANSWER PANEL (WARM LUXURY MINT/SAGE PARCHMENT INSET) ── */
.answer-panel {
  margin-top: 14px;
  border: 2px solid #bbf7d0;
  border-radius: 26px;
  padding: clamp(20px, 3.5vw, 30px);
  background: linear-gradient(175deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.08), inset 0 1px 0 #ffffff;
  animation: reveal-answer 380ms var(--ease-pop) both;
}
.answer-panel h3 {
  margin: 0 0 6px;
  color: #15803d;
  font-family: var(--display);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.definition-en {
  max-width: 44ch;
  margin: 0;
  font-family: var(--font-en-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.34;
}
.definition-th {
  margin: 8px 0 0;
  color: #047857;
  font-family: var(--font-th, var(--sans));
  font-size: 1.18rem;
  font-weight: 700;
}

.example-block {
  max-width: 68ch;
  margin-top: 18px;
  border-top: 1.5px dashed #cbd5e1;
  padding-top: 16px;
}
.example-block h3 {
  color: #0369a1;
}
.example-en {
  margin: 0;
  font-family: var(--font-en-body);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.6;
  color: #1e3a8a;
}
.example-th {
  margin: 6px 0 0;
  color: #475569;
  font-family: var(--font-th, var(--sans));
  font-size: .92rem;
}
.usage-note {
  margin: 8px 0 0;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
  color: #92400e;
  font-size: .86rem;
}
.proof-note {
  margin: 16px 0 0;
  color: #2563eb;
  font-size: .82rem;
  font-weight: 600;
}

/* ── GAME FEEDBACK TOAST (FLOATS WITHOUT SHIFTING BUTTONS) ── */
.game-feedback {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 110px;
  z-index: 20;
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 14px;
  border: 1.5px solid #10b981;
  border-radius: 18px;
  padding: 8px 18px;
  background: rgba(16, 185, 129, 0.96);
  backdrop-filter: blur(8px);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: feedback-pop 320ms var(--ease-pop) both;
}
.game-feedback.is-miss {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.96);
  color: #ffffff;
}
.feedback-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #ffffff;
  color: #10b981;
  font-size: 1.15rem;
  font-weight: 800;
}
.game-feedback.is-miss .feedback-icon {
  background: #ffffff;
  color: #ef4444;
}
.game-feedback div, .game-feedback strong, .game-feedback small { display: block; }
.game-feedback strong { font-family: var(--display); line-height: 1.2; font-size: 1.02rem; }
.game-feedback small { margin-top: 1px; color: #ffffff; opacity: .92; font-weight: 600; }

/* ── 16-BIT KUNG-KI COMBO PEEK-A-BOO POPUP ── */
.combo-peek-banner {
  position: absolute;
  right: 18px;
  bottom: 108px;
  z-index: 35;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
  cursor: pointer;
  transform: translateY(140%) scale(0.85);
  opacity: 0;
  transition: transform 380ms var(--ease-pop), opacity 300ms ease;
}

.combo-peek-banner.is-peeking {
  transform: translateY(0) scale(1);
  opacity: 1;
  animation: peek-wobble 2.2s ease-in-out;
}

@keyframes peek-wobble {
  0% { transform: translateY(120%) scale(0.8); opacity: 0; }
  18% { transform: translateY(-8px) scale(1.06) rotate(3deg); opacity: 1; }
  35% { transform: translateY(0) scale(1) rotate(-2deg); }
  75% { transform: translateY(-4px) scale(1.02) rotate(1deg); opacity: 1; }
  90% { transform: translateY(20px) scale(0.95); opacity: 0.8; }
  100% { transform: translateY(120%) scale(0.8); opacity: 0; }
}

.combo-peek-img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 12px rgba(247, 197, 72, 0.45));
  transform-origin: center bottom;
  animation: pixel-peek-bounce 1s ease-in-out infinite alternate;
}

@keyframes pixel-peek-bounce {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-6px) rotate(4deg); }
}

.combo-peek-bubble {
  background: #ffffff;
  border: 2px solid #f59e0b;
  border-bottom: 5px solid #d97706;
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.combo-peek-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #d97706;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.combo-peek-bubble strong {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.combo-peek-bubble small {
  font-size: 0.72rem;
  color: #4b5563;
  font-weight: 600;
}

/* ── 3D TACTILE RATING CONTROLS (THE DUOLINGO SCHEDULE BUTTONS) ── */
.rating-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.rating-button {
  min-width: 0;
  min-height: 84px;
  border: 2px solid #e2d8c3;
  border-bottom: 5px solid #cfc4ac;
  border-radius: 20px;
  padding: 12px 10px 10px;
  background: #fbf7ee;
  color: #1f2937;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.rating-button strong, .rating-button > span { display: block; }
.rating-button strong {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #111827;
  line-height: 1.2;
}

.rating-button > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rating-button b {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  color: #1f2937;
  font-size: 0.7rem;
  font-weight: 700;
}

.rating-button [data-schedule] {
  display: inline;
  font-weight: 700;
}

/* Disabled State: elegant neutral cream paper tile */
.rating-button:disabled {
  background: #ece5d6;
  border-color: #d8cebc;
  border-bottom-color: #bfb29c;
  color: #8c8270;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}
.rating-button:disabled strong { color: #6b6352; }
.rating-button:disabled > span { color: #8c8270; }
.rating-button:disabled b { background: rgba(0, 0, 0, 0.05); color: #8c8270; }

/* Enabled State Hover & Active tactile feedback */
.rating-button:not(:disabled):hover {
  filter: brightness(1.03);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.rating-button:not(:disabled):active {
  border-bottom-width: 2px;
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Semantic Tinted Cream Cards */
.rating-button[data-rating="again"]:not(:disabled),
.rating-button[data-phrasal-rating="again"]:not(:disabled) {
  background: linear-gradient(180deg, #fff5f5 0%, #fee2e2 100%);
  border-color: #fca5a5;
  border-bottom-color: #dc2626;
  color: #991b1b;
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.22), inset 0 1px 0 #fff;
}
.rating-button[data-rating="again"]:not(:disabled) strong,
.rating-button[data-phrasal-rating="again"]:not(:disabled) strong { color: #991b1b; }
.rating-button[data-rating="again"]:not(:disabled) > span,
.rating-button[data-phrasal-rating="again"]:not(:disabled) > span { color: #b91c1c; }
.rating-button[data-rating="again"]:not(:disabled) b,
.rating-button[data-phrasal-rating="again"]:not(:disabled) b { background: rgba(220, 38, 38, 0.14); color: #991b1b; }

.rating-button[data-rating="hard"]:not(:disabled),
.rating-button[data-phrasal-rating="hard"]:not(:disabled) {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
  border-bottom-color: #ea580c;
  color: #9a3412;
  box-shadow: 0 10px 26px rgba(234, 88, 12, 0.22), inset 0 1px 0 #fff;
}
.rating-button[data-rating="hard"]:not(:disabled) strong,
.rating-button[data-phrasal-rating="hard"]:not(:disabled) strong { color: #9a3412; }
.rating-button[data-rating="hard"]:not(:disabled) > span,
.rating-button[data-phrasal-rating="hard"]:not(:disabled) > span { color: #c2410c; }
.rating-button[data-rating="hard"]:not(:disabled) b,
.rating-button[data-phrasal-rating="hard"]:not(:disabled) b { background: rgba(234, 88, 12, 0.14); color: #9a3412; }

.rating-button[data-rating="good"]:not(:disabled),
.rating-button[data-phrasal-rating="good"]:not(:disabled) {
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  border-bottom-color: #16a34a;
  color: #14532d;
  box-shadow: 0 10px 26px rgba(22, 163, 74, 0.22), inset 0 1px 0 #fff;
}
.rating-button[data-rating="good"]:not(:disabled) strong,
.rating-button[data-phrasal-rating="good"]:not(:disabled) strong { color: #14532d; }
.rating-button[data-rating="good"]:not(:disabled) > span,
.rating-button[data-phrasal-rating="good"]:not(:disabled) > span { color: #15803d; }
.rating-button[data-rating="good"]:not(:disabled) b,
.rating-button[data-phrasal-rating="good"]:not(:disabled) b { background: rgba(22, 163, 74, 0.14); color: #14532d; }

.rating-button[data-rating="easy"]:not(:disabled),
.rating-button[data-phrasal-rating="easy"]:not(:disabled) {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
  border-bottom-color: #2563eb;
  color: #1e3a8a;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22), inset 0 1px 0 #fff;
}
.rating-button[data-rating="easy"]:not(:disabled) strong,
.rating-button[data-phrasal-rating="easy"]:not(:disabled) strong { color: #1e3a8a; }
.rating-button[data-rating="easy"]:not(:disabled) > span,
.rating-button[data-phrasal-rating="easy"]:not(:disabled) > span { color: #1d4ed8; }
.rating-button[data-rating="easy"]:not(:disabled) b,
.rating-button[data-phrasal-rating="easy"]:not(:disabled) b { background: rgba(37, 99, 235, 0.14); color: #1e3a8a; }

.review-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}
.review-status {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: .78rem;
  overflow-wrap: anywhere;
}
.undo-button {
  flex: 0 0 auto;
  padding-left: 16px;
  font-size: .78rem;
}
.keyboard-help {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .74rem;
  text-align: center;
}
.keyboard-help kbd {
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: .7rem;
}

/* ── SYSTEM STATES (LOADING, ERROR, COMPLETE) ── */
.system-state {
  min-height: 480px;
  border: 1.5px solid var(--line-gold);
  border-bottom: 7px solid rgba(0, 0, 0, 0.6);
  border-radius: 36px;
  padding: clamp(38px, 8vw, 90px);
  background: var(--surface-card);
  color: var(--ink-soft);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.state-mascot {
  margin-bottom: 16px;
  font-size: 4rem;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}
.state-mascot.celebration { animation: mascot-bounce 1.6s ease-in-out infinite; }

#emptyPixelCanvas,
.empty-pixel-img {
  display: inline-block;
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 20px rgba(247, 197, 72, 0.35));
  animation: pixel-mascot-bob 1.8s ease-in-out infinite;
}

.system-state h2, .system-state h3 {
  margin: 0 0 10px;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -.025em;
}
.system-state p { max-width: 55ch; margin-inline: auto; }
.error-state { border-color: rgba(240, 133, 122, 0.5); background: rgba(240, 133, 122, 0.05); }
.primary-dark-button {
  border-color: #ffd76b;
  border-bottom: 5px solid var(--gold-shadow);
  background: var(--gold);
  color: #030712;
  font-weight: 800;
}
.empty-undo-button { display: block; margin: 12px auto 0; }

/* ── WORKSPACE SHEETS (STUDIOS, LIBRARY, CAPTURE) ── */
.workspace-sheet {
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 4px solid rgba(0, 0, 0, 0.4);
  border-radius: 36px;
  padding: clamp(26px, 5vw, 56px);
  background: rgba(13, 20, 36, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(245, 158, 11, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}
.workspace-sheet::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.sheet-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 24px;
}
.sheet-head h2, .capture-sheet h2 {
  margin: 5px 0 0;
  font-family: var(--font-en-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}
.sheet-head p { max-width: 58ch; margin: 12px 0 0; color: var(--ink-soft); font-family: var(--font-en-body); font-size: 1rem; }

.library-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 28px 0 18px;
}
.search-field, #queueInput {
  min-width: 0;
  min-height: 50px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-bottom: 3.5px solid rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-family: var(--font-en-body);
  font-size: .95rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search-field:focus, #queueInput:focus {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), 0 0 14px rgba(245, 158, 11, 0.25);
  outline: none;
}
.scope-controls { display: flex; gap: 8px; }
.ledger-scope-controls { margin: 14px 0 16px; }

.filter-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-bottom: 3.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-en-display);
  font-size: .86rem;
  letter-spacing: .01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.filter-button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}
.filter-button:active {
  border-bottom-width: 1.5px;
  transform: translateY(2px);
}
.filter-button.active,
.filter-button[aria-pressed="true"] {
  border-color: transparent;
  border-bottom: 2.5px solid #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  color: #ffffff;
  font-weight: 800;
}
.paper-button {
  border: 1.5px solid #fde68a;
  border-bottom: 4px solid #b45309;
  border-radius: 9999px;
  padding: 8px 20px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-family: var(--font-en-display);
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ── LIBRARY STAGE BOX & HIGH CONTRAST PALETTE ── */
.library-stage-box {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 6px solid #cfbf9f;
  border-radius: 32px;
  padding: 30px 28px 36px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 50px rgba(234, 179, 8, 0.12), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.library-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0 0 16px;
}

.library-search-input {
  min-width: 0;
  min-height: 50px;
  border: 1.5px solid #cbd5e1 !important;
  border-bottom: 3.5px solid #94a3b8 !important;
  border-radius: 16px;
  padding: 10px 18px;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: var(--font-en-body);
  font-size: .96rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
.library-search-input::placeholder {
  color: #64748b !important;
}
.library-search-input:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
  outline: none;
}

.library-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  margin-bottom: 12px;
  color: #475569;
  font-size: .86rem;
  font-weight: 700;
}
.library-list { border-top: 1.5px solid #e2d8c3; }
.library-entry {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.8fr) auto;
  gap: 24px;
  border-bottom: 1px solid #e8dfcf;
  padding: 20px 10px;
  transition: background 180ms ease, padding 180ms ease;
}
.library-entry:hover {
  padding-inline: 14px;
  background: rgba(245, 158, 11, 0.05);
}
.library-state-button {
  align-self: center;
  min-height: 42px;
  border: 1.5px solid #d8cdb7;
  border-bottom: 3.5px solid #bdae95;
  border-radius: 12px;
  padding: 7px 16px;
  background: #f1ebd9;
  color: #78350f;
  cursor: pointer;
  font-family: var(--font-en-display);
  font-size: .78rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}
.library-state-button:hover {
  background: #ece4cd;
  color: #451a03;
  transform: translateY(-1px);
}
.library-state-button:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}
.library-term h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-family: var(--font-en-display);
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.25;
}
.entry-meta {
  margin: 6px 0 0;
  color: #0284c7;
  font-family: var(--font-en-display);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.library-definition p { margin: 0; }
.library-definition .entry-definition {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #0f172a;
}
.library-definition .entry-thai {
  margin-top: 6px;
  color: #047857;
  font-family: var(--font-th, var(--sans));
  font-size: .96rem;
  font-weight: 700;
}
.library-definition .entry-example {
  margin-top: 6px;
  color: #1e3a8a;
  font-family: var(--font-en-body);
  font-size: .92rem;
  font-style: italic;
  line-height: 1.55;
}
.empty-line { padding: 38px 0; color: #64748b; font-weight: 600; }

/* ── CAPTURE & SETTINGS (HIGH CONTRAST PARCHMENT PALETTE) ── */
.capture-lead {
  max-width: 62ch;
  margin: 10px 0 0;
  color: #334155;
  font-family: var(--font-en-body);
  font-size: .96rem;
  font-weight: 500;
  line-height: 1.6;
}
.capture-script {
  margin-top: 16px;
  border: 1.5px solid #e2d7c0;
  border-radius: 16px;
  padding: 20px;
  background: #fbf7ed;
  color: #1e293b;
  font-family: monospace;
  font-size: .86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
}
.capture-actions, .settings-actions, .queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.capture-status {
  min-height: 24px;
  margin: 8px 0 0;
  color: #b45309;
  font-weight: 700;
  font-size: .86rem;
}
.vocab-queue-section {
  margin-top: 2.4rem;
  border-top: 1.5px dashed #cbd5e1;
  padding-top: 1.4rem;
}
.queue-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}
.queue-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.queue-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #fde68a;
  border-bottom: 3px solid #f59e0b;
  border-radius: 12px;
  padding: 6px 12px;
  background: #fef3c7;
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: .84rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}
.queue-remove {
  display: inline-grid;
  min-height: 22px;
  width: 22px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b45309;
  cursor: pointer;
  font-weight: 900;
}
.queue-remove:hover {
  background: rgba(180, 83, 9, 0.15);
  color: #78350f;
}
.danger-button { color: var(--red); text-decoration-color: rgba(240, 133, 122, 0.4); }
.policy-note {
  margin-top: 28px;
  border: 1.5px solid #e2d8c3;
  border-bottom: 5px solid #cfbf9f;
  border-radius: 20px;
  padding: 24px;
  background: #faf6ed;
  color: #1e293b;
}
.policy-note > h3 {
  margin-top: 0;
  color: #0f172a;
  font-family: var(--font-en-display);
  font-weight: 800;
}
.policy-note p { color: #475569; }
.flow-list { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: flow; }
.flow-list li {
  position: relative;
  border-top: 1px solid #e2d8c3;
  padding: 15px 0 15px 38px;
  color: #334155;
  counter-increment: flow;
  font-size: .88rem;
  line-height: 1.55;
}
.flow-list li strong {
  color: #0f172a;
}
.flow-list li::before {
  position: absolute;
  top: 15px;
  left: 0;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: rgba(247, 197, 72, 0.15);
  color: var(--gold-light);
  content: counter(flow);
  font-size: .72rem;
  font-weight: 800;
}
.settings-panel {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.settings-panel summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  line-height: 44px;
  color: #fff;
}
.import-label { position: relative; overflow: hidden; }
.import-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ── REWARD FEEDBACK BURST ── */
.reward-burst {
  position: absolute;
  z-index: 6;
  top: 20rem;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
  visibility: hidden;
}
.reward-xp {
  position: absolute;
  left: 50%;
  top: 0;
  min-width: max-content;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  padding: 10px 18px;
  background: rgba(8, 13, 27, 0.96);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5), 0 0 32px var(--gold-glow);
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: 0;
  transform: translate(-50%, 18px) scale(.75);
}
.reward-burst i {
  --x: 0;
  --y: -72px;
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold-light);
  box-shadow: 0 0 14px var(--gold);
  opacity: 0;
  transform: translate(0, 0) rotate(0deg);
}
.reward-burst i:nth-of-type(1) { --x: -78px; --y: -36px; }
.reward-burst i:nth-of-type(2) { --x: -48px; --y: -82px; }
.reward-burst i:nth-of-type(3) { --x: 4px; --y: -96px; }
.reward-burst i:nth-of-type(4) { --x: 52px; --y: -78px; }
.reward-burst i:nth-of-type(5) { --x: 82px; --y: -30px; }
.reward-burst i:nth-of-type(6) { --x: 24px; --y: -48px; }
.reward-burst.is-active { visibility: visible; }
.reward-burst.is-active .reward-xp { animation: reward-xp-float 820ms var(--ease-pop) both; }
.reward-burst.is-active i { animation: reward-particle 720ms ease-out both; }
.reward-burst.is-active i:nth-of-type(2), .reward-burst.is-active i:nth-of-type(5) { animation-delay: 45ms; }
.review-stage.is-correct .citation-slip { animation: correct-card-pulse 620ms var(--ease-pop); }

@keyframes reward-xp-float {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(.72); }
  24% { opacity: 1; transform: translate(-50%, -8px) scale(1.08); }
  72% { opacity: 1; transform: translate(-50%, -22px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(.96); }
}
@keyframes reward-particle {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.4); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(150deg) scale(1); }
}
@keyframes correct-card-pulse {
  0%, 100% { box-shadow: 0 25px 65px rgba(0, 0, 0, 0.65), 0 0 40px rgba(247, 197, 72, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
  38% { border-color: #ffd76b; box-shadow: 0 25px 65px rgba(0, 0, 0, 0.65), 0 0 0 6px rgba(247, 197, 72, 0.2), 0 0 50px rgba(247, 197, 72, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

@keyframes reveal-answer {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes feedback-pop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-7px) rotate(3deg); }
}

/* ═══════════════════════════════════════════════════════════════
   STUDIO 1: PHRASAL VERBS QUEST & EXPLORER
   ═══════════════════════════════════════════════════════════════ */
.sibling-senses-container {
  margin-top: 18px;
  border-top: 1.5px dashed #cbd5e1;
  padding-top: 16px;
}
.sibling-senses-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #0f172a;
  font-family: var(--display);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.sibling-sense-card {
  margin-bottom: 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.sibling-sense-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sibling-sense-badge {
  border-radius: 6px;
  padding: 2px 8px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: .72rem;
  font-weight: 700;
}
.sibling-sense-pos { color: #64748b; font-size: .72rem; text-transform: uppercase; font-weight: 600; }
.sibling-sense-def-en { margin: 0; color: #0f172a; font-weight: 700; font-size: .96rem; }
.sibling-sense-def-th { margin: 4px 0 0; color: #047857; font-family: var(--font-th, var(--sans)); font-size: .9rem; font-weight: 600; }
.sibling-sense-example { margin: 6px 0 0; color: #1e3a8a; font-size: .88rem; font-style: italic; }

.phrasal-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.phrasal-root-wrapper {
  margin-bottom: 16px;
}
.phrasal-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 14px;
}
.phrasal-view-toggle .filter-button {
  padding: 6px 10px;
  font-size: .78rem;
  min-height: 38px;
}
.phrasal-toolbar { margin: 22px 0 24px; }
.phrasal-root-scroll {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 0;
  min-width: 0;
}
.phrasal-root-scroll::-webkit-scrollbar { display: none; }
.phrasal-root-nav { display: flex; gap: 8px; min-width: max-content; align-items: center; }
.phrasal-root-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-bottom: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 7px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  font-family: var(--font-en-display);
  font-size: .84rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}
.phrasal-root-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(168, 85, 247, 0.5);
  color: #fff;
  transform: translateY(-1px);
}
.phrasal-root-pill:active { transform: translateY(2px); border-bottom-width: 1.5px; }
.phrasal-root-pill[aria-pressed="true"] {
  border: 1.5px solid #e9d5ff;
  border-bottom: 3.5px solid #6b21a8;
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.phrasal-root-pill span {
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(0, 0, 0, 0.2);
  font-size: .7rem;
  color: #ffffff;
  font-weight: 700;
}
.phrasal-root-pill[aria-pressed="true"] span {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.phrasal-search-row { margin-top: 14px; }

.phrasal-quest-view { min-width: 0; }
.phrasal-quest-layout { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 780px; margin: 0 auto; }
.phrasal-formula-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  border: 1.5px solid #d8cdb7;
  border-radius: 12px;
  padding: 5px 16px;
  background: #f1ebd9;
}
.phrasal-formula-tag .verb-part { color: #92400e; font-family: var(--font-en-display); font-weight: 800; }
.phrasal-formula-tag .plus-sign { color: #6b7280; font-weight: 700; }
.phrasal-formula-tag .particle-part { color: #0369a1; font-family: var(--font-en-display); font-weight: 800; }

.phrasal-answer-panel {
  margin-top: 16px;
  border: 1.5px solid #e5dcc7;
  border-bottom: 4px solid #cfbf9f;
  border-radius: 24px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 #ffffff;
  animation: reveal-answer 380ms var(--ease-pop) both;
}
.particle-logic-box {
  margin-bottom: 16px;
  border: 1.5px solid #fde68a;
  border-radius: 16px;
  padding: 14px 18px;
  background: #fffbeb;
}
.particle-logic-label {
  display: block;
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.particle-logic-text { margin: 4px 0 0; color: #78350f; font-family: var(--font-en-body); font-size: .94rem; line-height: 1.55; font-weight: 600; }
.phrasal-meanings-list { display: grid; gap: 12px; }
.phrasal-meaning-item {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  background: #fbf9f4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.phrasal-meaning-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.phrasal-meaning-badge {
  border-radius: 6px;
  padding: 2px 8px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
}
.phrasal-meaning-en { margin: 0; color: #0f172a; font-family: var(--font-en-display); font-size: 1.05rem; font-weight: 800; line-height: 1.35; }
.phrasal-meaning-th { margin: 5px 0 0; color: #047857; font-family: var(--font-th, var(--sans)); font-size: .94rem; font-weight: 600; }
.phrasal-example-box {
  margin-top: 10px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}
.phrasal-example-en { margin: 0; color: #1e3a8a; font-family: var(--font-en-body); font-size: .95rem; font-style: italic; line-height: 1.55; }
.phrasal-example-en mark {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  font-style: normal;
}
.phrasal-example-th { margin: 4px 0 0; color: #475569; font-family: var(--font-th, var(--sans)); font-size: .88rem; }
.phrasal-tip { margin: 8px 0 0; color: #92400e; font-size: .82rem; line-height: 1.45; font-weight: 600; }
.phrasal-nav-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }

.phrasal-grid-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: .84rem;
}
.phrasal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.phrasal-card {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 5px solid #cfbf9f;
  border-radius: 26px;
  padding: 24px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(168, 85, 247, 0.1), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.phrasal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 35px rgba(168, 85, 247, 0.18), inset 0 1px 0 #ffffff;
}
.phrasal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.phrasal-card-title {
  margin: 0;
  font-family: var(--font-en-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
}
.phrasal-card-formula {
  display: inline-flex;
  gap: 4px;
  border-radius: 8px;
  padding: 3px 9px;
  background: #f1ebd9;
  border: 1px solid #d8cdb7;
  color: #78350f;
  font-family: var(--font-en-display);
  font-size: .74rem;
  font-weight: 700;
}
.phrasal-card-meanings { display: grid; gap: 10px; margin-top: 10px; }
.phrasal-card-meaning-line { font-size: .88rem; }
.phrasal-card-meaning-line strong { color: #92400e; font-family: var(--font-en-body); font-weight: 700; display: block; margin-bottom: 2px; }
.phrasal-card-meaning-line small { color: #4b5563; display: block; }
.phrasal-card-act { margin-top: 16px; display: flex; justify-content: flex-end; }
.phrasal-practice-btn {
  min-height: 40px;
  border: 1.5px solid #d8b4fe;
  border-bottom: 3.5px solid #7e22ce;
  border-radius: 9999px;
  padding: 7px 18px;
  background: linear-gradient(180deg, #a855f7 0%, #9333ea 100%);
  color: #ffffff;
  cursor: pointer;
  font-family: var(--font-en-display);
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.phrasal-practice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.phrasal-practice-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

/* ═══════════════════════════════════════════════════════════════
   STUDIO 2: SPEAKING STUDIO (CHATGPT INTEGRATION)
   ═══════════════════════════════════════════════════════════════ */
.speaking-toolbar { margin-bottom: 20px; }
.speaking-category-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.speaking-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.speaking-card {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 5px solid #cfbf9f;
  border-radius: 26px;
  padding: 24px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 30px rgba(14, 165, 233, 0.1), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.speaking-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 38px rgba(14, 165, 233, 0.18), inset 0 1px 0 #ffffff;
}
.speaking-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.speaking-card-title {
  margin: 0;
  font-family: var(--font-en-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
}
.speaking-card-title-th {
  margin: 4px 0 0;
  font-size: .88rem;
  color: #92400e;
  font-weight: 600;
}
.speaking-card-badge {
  border-radius: 8px;
  padding: 4px 10px;
  background: #f1ebd9;
  border: 1px solid #d8cdb7;
  color: #0369a1;
  font-family: var(--font-en-display);
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}
.speaking-card-summary {
  margin: 0 0 12px;
  font-size: .92rem;
  color: #4b5563;
  line-height: 1.6;
}
.speaking-box {
  border: 1.5px solid #e5dcc7;
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-top: 10px;
}
.speaking-box-label {
  display: block;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0284c7;
  margin-bottom: 5px;
}
.speaking-box-text {
  margin: 0;
  font-family: var(--font-en-body);
  font-size: .88rem;
  line-height: 1.5;
  color: #1f2937;
}
.speaking-openers-list {
  margin: 0;
  padding-left: 18px;
  font-family: var(--font-en-body);
  font-size: .86rem;
  line-height: 1.5;
  color: #374151;
}
.speaking-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.speaking-launch-btn {
  flex: 1;
  min-height: 44px;
  border: 1.5px solid #7dd3fc;
  border-bottom: 3.5px solid #0369a1;
  border-radius: 9999px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  font-family: var(--font-en-display);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.speaking-launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.speaking-launch-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}
.speaking-copy-btn {
  min-height: 44px;
  border: 1.5px solid #d8cdb7;
  border-bottom: 3.5px solid #bdae95;
  border-radius: 9999px;
  padding: 8px 18px;
  background: #f1ebd9;
  color: #92400e;
  font-family: var(--font-en-display);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 140ms ease, background 140ms ease;
}
.speaking-copy-btn:hover {
  background: #ece4cd;
  color: #78350f;
  transform: translateY(-2px);
}
.speaking-copy-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

/* ═══════════════════════════════════════════════════════════════
   STUDIO 3: SHADOWING CADENCE DECK
   ═══════════════════════════════════════════════════════════════ */
.speaking-stage,
.shadowing-stage,
.grammar-stage,
.writing-stage,
.library-stage,
.capture-stage {
  min-width: 0;
}
.shadowing-stage { width: 100%; }

.capture-stage-box {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 6px solid #cfbf9f;
  border-radius: 32px;
  padding: 32px 28px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 50px rgba(236, 72, 153, 0.12), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.capture-stage-box h2 {
  margin: 5px 0 0;
  font-family: var(--font-en-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: #111827;
}
.capture-stage-box h3 {
  color: #0f172a;
}
.shadowing-card {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 6px solid #cfbf9f;
  border-radius: 32px;
  padding: 32px 28px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 50px rgba(20, 184, 166, 0.12), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.shadowing-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.shadowing-category-badge {
  border-radius: 8px;
  padding: 4px 12px;
  background: #f1ebd9;
  border: 1px solid #d8cdb7;
  color: #0f766e;
  font-family: var(--font-en-display);
  font-size: .76rem;
  font-weight: 800;
}
.shadowing-counter {
  font-family: var(--font-en-display);
  font-weight: 800;
  font-size: .88rem;
  color: #6b7280;
}
.shadowing-sentence-box {
  border: 1.5px solid #e5dcc7;
  border-bottom: 4px solid #cfbf9f;
  border-radius: 24px;
  padding: 26px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 22px;
}
.shadowing-blind-cover { text-align: center; padding: 26px 16px; }
.blind-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.blind-title {
  font-family: var(--font-en-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
}
.blind-hint {
  color: #4b5563;
  font-size: .92rem;
  margin: 6px 0 18px;
  line-height: 1.5;
}
.shadowing-en-text {
  font-family: var(--font-en-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.38;
  margin: 0 0 8px;
}
.shadowing-th-text {
  font-size: 1.1rem;
  color: #0f766e;
  font-weight: 600;
  margin: 0 0 8px;
}
.shadowing-ipa-text {
  font-family: monospace;
  font-size: .95rem;
  color: #0369a1;
  margin: 0 0 18px;
}
.shadowing-tips-box {
  border: 1.5px solid #ccfbf1;
  border-radius: 16px;
  padding: 14px 18px;
  background: #f0fdfa;
  margin-bottom: 14px;
}
.shadowing-tips-label {
  display: block;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0f766e;
  margin-bottom: 6px;
}
.shadowing-tips-list {
  margin: 0;
  padding-left: 18px;
  font-family: var(--font-en-body);
  font-size: .88rem;
  line-height: 1.55;
  color: #134e4a;
}
.shadowing-cadence-note {
  font-size: .84rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}
.shadowing-controls { display: grid; gap: 14px; }
.shadowing-playback-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.shadowing-play-btn {
  flex: 1;
  min-height: 44px;
  border: 1.5px solid #5eead4;
  border-bottom: 3.5px solid #0f766e;
  border-radius: 9999px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  font-family: var(--font-en-display);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.shadowing-speed-group {
  display: flex;
  gap: 4px;
  border: 1.5px solid #d8cdb7;
  border-radius: 12px;
  padding: 4px;
  background: #f1ebd9;
}
.speed-button {
  min-height: 36px;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  background: transparent;
  color: #78350f;
  cursor: pointer;
  font-family: var(--font-en-display);
  font-weight: 800;
  font-size: .8rem;
  transition: background 140ms ease, color 140ms ease;
}
.speed-button.active {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
}
.shadowing-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   STUDIO 4: GRAMMAR KNOWLEDGE HUB
   ═══════════════════════════════════════════════════════════════ */
.grammar-toolbar { margin-bottom: 18px; }
.grammar-level-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.grammar-search-row { margin-top: 14px; }
.grammar-meta {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.grammar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.grammar-card {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 5px solid #cfbf9f;
  border-radius: 26px;
  padding: 24px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(16, 185, 129, 0.1), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.grammar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 35px rgba(16, 185, 129, 0.18), inset 0 1px 0 #ffffff;
}
.grammar-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.grammar-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.grammar-chapter-badge {
  border-radius: 6px;
  padding: 3px 9px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
}
.grammar-level-badge {
  border-radius: 6px;
  padding: 3px 9px;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
}
.grammar-level-badge.level-beginner { background: #d1fae5; border: 1px solid #a7f3d0; color: #065f46; }
.grammar-level-badge.level-intermediate { background: #ffedd5; border: 1px solid #fed7aa; color: #9a3412; }
.grammar-level-badge.level-advanced { background: #fee2e2; border: 1px solid #fecaca; color: #991b1b; }
.grammar-cat-badge {
  border-radius: 6px;
  padding: 3px 9px;
  background: #f1ebd9;
  border: 1px solid #d8cdb7;
  color: #4b5563;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 700;
}
.grammar-card-time { font-family: var(--font-en-display); font-size: .76rem; color: #6b7280; font-weight: 700; }
.grammar-card-title {
  margin: 0 0 4px;
  font-family: var(--font-en-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
}
.grammar-card-sub {
  margin: 0 0 8px;
  font-size: .88rem;
  color: #047857;
  font-weight: 600;
}
.grammar-card-desc {
  margin: 0 0 18px;
  font-size: .9rem;
  color: #4b5563;
  line-height: 1.55;
}
.grammar-card-footer { margin-top: auto; }
.grammar-link-btn {
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1.5px solid #6ee7b7;
  border-bottom: 3.5px solid #047857;
  border-radius: 9999px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-family: var(--font-en-display);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.grammar-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.grammar-link-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

/* ═══════════════════════════════════════════════════════════════
   STUDIO 5: WRITING FRAMEWORK STUDIO
   ═══════════════════════════════════════════════════════════════ */
.writing-category-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.writing-card {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom: 5px solid #cfbf9f;
  border-radius: 26px;
  padding: 24px;
  background: linear-gradient(175deg, #fffdfa 0%, #fbf6ec 60%, #f6efe0 100%);
  color: #111827;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 30px rgba(249, 115, 22, 0.1), inset 0 1px 0 #ffffff, inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.writing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 38px rgba(249, 115, 22, 0.18), inset 0 1px 0 #ffffff;
}
.writing-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.writing-card-title {
  margin: 0;
  font-family: var(--font-en-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #111827;
}
.writing-card-sub {
  margin: 4px 0 0;
  font-size: .88rem;
  color: #c2410c;
  font-weight: 600;
}
.writing-card-badge {
  border-radius: 8px;
  padding: 4px 10px;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-family: var(--font-en-display);
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}
.writing-card-objective {
  margin: 0 0 14px;
  font-size: .92rem;
  color: #374151;
  line-height: 1.55;
}
.writing-box {
  border: 1.5px solid #e5dcc7;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-top: 10px;
}
.writing-box-label {
  display: block;
  font-family: var(--font-en-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #ea580c;
  margin-bottom: 6px;
}
.writing-framework-pre {
  font-family: var(--font-en-body);
  white-space: pre-wrap;
  font-size: .88rem;
  color: #1f2937;
  line-height: 1.55;
  margin: 0;
}
.writing-phrases-list {
  margin: 0;
  padding-left: 18px;
  font-family: var(--font-en-body);
  font-size: .88rem;
  line-height: 1.55;
  color: #1f2937;
}
.writing-template-pre {
  font-family: var(--font-en-body);
  white-space: pre-wrap;
  font-size: .84rem;
  background: #faf7f0;
  border: 1px solid #e5dcc7;
  border-radius: 10px;
  padding: 14px;
  color: #111827;
  line-height: 1.55;
  max-height: 220px;
  overflow-y: auto;
  margin: 6px 0 10px;
}
.writing-copy-btn {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid #fdba74;
  border-bottom: 3.5px solid #c2410c;
  border-radius: 9999px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-family: var(--font-en-display);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.writing-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.writing-copy-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE CRAFT FLOOR & ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
@media(max-width: 920px) {
  .workspace-header { grid-template-columns: minmax(0, 1fr) minmax(310px, .8fr); gap: 32px; }
  .review-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .session-ledger { padding-inline: 16px; }
  .hud-stat { padding-inline: 10px; }
  .hud-stat small { white-space: normal; }
}

@media(max-width: 760px) {
  .vocab-shell { width: min(100% - 24px, 680px); padding: 94px 0 72px; }
  .workspace-header, .sheet-head, .capture-sheet { grid-template-columns: 1fr; }
  .workspace-header { gap: 24px; }
  .workspace-hero-brand { align-items: flex-start; }
  .workspace-title h1 { max-width: 100%; }

  .workspace-tabs-wrapper {
    position: sticky;
    z-index: 8;
    top: 64px;
    margin-inline: -12px;
    padding: 8px 6px 10px;
    background: rgba(3, 7, 18, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .workspace-tabs { padding: 2px; }
  .tabs-scroll-btn { display: none !important; }
  .workspace-tab { flex: 1 0 auto; min-width: 120px; padding-inline: 12px; font-size: .82rem; }

  .review-layout { grid-template-columns: 1fr; }
  .session-ledger {
    position: static;
    border-radius: 28px;
    padding: 20px 16px;
    margin-bottom: 20px;
  }
  .pixel-companion-stage { margin: 0 0 14px; }
  .ledger-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ledger-line {
    display: block;
    min-width: 0;
    border-right: 1px solid #eadecb;
    border-bottom: 0;
    padding: 7px;
    text-align: center;
  }
  .ledger-line:last-child { border-right: 0; }
  .ledger-line dt, .ledger-line dd { display: block; }
  .ledger-line dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ledger-note { display: none; }

  .citation-slip { min-height: 440px; border-radius: 22px; padding: 26px 20px 32px; }
  .prompt-block { padding: 44px 0 32px; }

  .rating-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-controls.is-ready {
    position: sticky;
    z-index: 7;
    bottom: 0;
    margin-inline: -12px;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    background: rgba(3, 7, 18, 0.96);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-gold);
  }
  .rating-button { min-height: 66px; }

  .speaking-cards-grid, .grammar-grid, .writing-grid, .phrasal-grid { grid-template-columns: 1fr; }
  .phrasal-view-toggle { width: 100%; }
  .phrasal-view-toggle .filter-button { flex: 1; }
  .shadowing-playback-row { flex-direction: column; align-items: stretch; }
  .shadowing-speed-group { justify-content: center; }

  .library-controls, .library-entry { grid-template-columns: 1fr; }
  .library-entry:hover { padding-inline: 8px; }
  .scope-controls { min-width: 0; }
  .filter-button { flex: 1 1 0; }
  .policy-note { margin-top: 5px; }
}

@media(max-width: 480px) {
  .workspace-title h1 { font-size: clamp(2.5rem, 13vw, 3.4rem); }
  .workspace-title p { font-size: .92rem; }
  .hud-stat { display: block; padding: 13px 8px; text-align: center; }
  .hud-stat > span { display: block; margin-bottom: 4px; font-size: 1.2rem; }
  .hud-stat strong { font-size: 1.05rem; }
  .hud-stat small { font-size: .62rem; }
  .citation-slip { min-height: 410px; }
  .slip-head { align-items: flex-start; }
  .review-word { font-size: clamp(2.7rem, 16vw, 4.4rem); }
  .word-line { align-items: flex-end; flex-wrap: wrap; }
  .answer-panel { padding: 20px 18px; }
  .review-tools, .library-meta { align-items: flex-start; flex-direction: column; }
  .undo-button { padding-left: 0; }
  .keyboard-help span { display: none; }
  .keyboard-help kbd { margin-left: 7px; }
  .queue-input-row { grid-template-columns: 1fr; }
}

@media(prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DAYTIME LIGHT MODE (html[data-theme="light"])
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e6;
  --surface: #fffdf9;
  --surface-card: rgba(255, 253, 248, 0.94);
  --surface-raised: rgba(248, 243, 232, 0.96);
  --surface-soft: rgba(15, 23, 42, 0.05);
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.22);
  --line-gold: rgba(197, 151, 56, 0.42);
  --gold-light: #92400e;
}

html[data-theme="light"] body {
  background: radial-gradient(ellipse at 50% -10%, rgba(247, 197, 72, 0.22) 0%, rgba(255, 106, 77, 0.08) 34%, #f6f1e6 72%);
  color: #0f172a;
}

html[data-theme="light"] body::before {
  background-image: radial-gradient(rgba(180, 130, 35, 0.22) 0.75px, transparent 0.85px);
  opacity: 0.45;
}

html[data-theme="light"] .workspace-title h1 {
  color: #0f172a;
  text-shadow: 0 2px 14px rgba(197, 151, 56, 0.18);
}

html[data-theme="light"] .workspace-title p {
  color: #334155;
}

html[data-theme="light"] .eyebrow-pill {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(180, 83, 9, 0.32);
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .sheet-kicker,
html[data-theme="light"] .quest-kicker,
html[data-theme="light"] .challenge-label {
  color: #92400e;
}

html[data-theme="light"] .workspace-tabs-wrapper {
  background: rgba(255, 253, 248, 0.92);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   WEB STANDARD V2 · VOCAB QUEST ALL-8-TABS ARCHITECTURE (2026-10-26)
   - All 8 workspace tabs visible at once on desktop (zero scroll clipping)
   - Retired legacy pill fills replaced with v2 underline tabs
   - Zero Box-in-Box across HUD, Companion, Flashcards, Speaking, Shadowing, Grammar, Writing, Library, Capture
   - Button Hierarchy B & 100% Contrast Pass (Dark + Light >= 4.5:1)
   ═══════════════════════════════════════════════════════════════ */

/* 1. Top Workspace Navigator: All 8 Tabs Visible at Once, Zero Capsule Box, Zero Scroll Clipping */
#workspaceTabsWrapper.workspace-tabs-wrapper {
  position: relative !important;
  top: auto !important;
  margin: 22px 0 28px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: block !important;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background-color: #f6f1e6 !important;
}

html[data-theme="light"] #workspaceTabsWrapper.workspace-tabs-wrapper {
  border-bottom-color: rgba(15, 23, 42, 0.16) !important;
}

.tabs-scroll-btn {
  display: none !important;
}

#workspaceTabs.workspace-tabs {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, auto)) !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  gap: 4px !important;
  overflow: visible !important;
  padding: 0 !important;
  margin: 0 !important;
}

#workspaceTabs .workspace-tab {
  --tab-accent: #f59e0b;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 10px 10px 11px !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  border-radius: 10px 10px 0 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #cbd5e1 !important;
  font-family: var(--aku-font-head, "AK Thai", "Google Sans", system-ui, sans-serif) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  text-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease !important;
}

#workspaceTabs .workspace-tab[data-panel="review"] { --tab-accent: #f59e0b; }
#workspaceTabs .workspace-tab[data-panel="phrasal"] { --tab-accent: #c084fc; }
#workspaceTabs .workspace-tab[data-panel="speaking"] { --tab-accent: #38bdf8; }
#workspaceTabs .workspace-tab[data-panel="shadowing"] { --tab-accent: #2dd4bf; }
#workspaceTabs .workspace-tab[data-panel="grammar"] { --tab-accent: #34d399; }
#workspaceTabs .workspace-tab[data-panel="writing"] { --tab-accent: #fb923c; }
#workspaceTabs .workspace-tab[data-panel="library"] { --tab-accent: #818cf8; }
#workspaceTabs .workspace-tab[data-panel="capture"] { --tab-accent: #fb7185; }

html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="review"] { --tab-accent: #b45309; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="phrasal"] { --tab-accent: #7e22ce; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="speaking"] { --tab-accent: #0284c7; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="shadowing"] { --tab-accent: #0f766e; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="grammar"] { --tab-accent: #047857; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="writing"] { --tab-accent: #c2410c; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="library"] { --tab-accent: #4338ca; }
html[data-theme="light"] #workspaceTabs .workspace-tab[data-panel="capture"] { --tab-accent: #be123c; }

#workspaceTabs .workspace-tab:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border-bottom-color: color-mix(in srgb, var(--tab-accent) 55%, transparent) !important;
  transform: none !important;
  box-shadow: none !important;
}

#workspaceTabs .workspace-tab[aria-selected="true"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tab-accent) 18%, transparent) 0%, color-mix(in srgb, var(--tab-accent) 6%, transparent) 100%) !important;
  border-bottom: 3px solid var(--tab-accent) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  transform: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] #workspaceTabs .workspace-tab {
  color: #334155 !important;
  background: transparent !important;
}

html[data-theme="light"] #workspaceTabs .workspace-tab:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
}

html[data-theme="light"] #workspaceTabs .workspace-tab[aria-selected="true"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tab-accent) 14%, #ffffff) 0%, color-mix(in srgb, var(--tab-accent) 4%, #ffffff) 100%) !important;
  border-bottom: 3px solid var(--tab-accent) !important;
  color: #0f172a !important;
}

@media (max-width: 1080px) {
  #workspaceTabs.workspace-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding-bottom: 4px !important;
  }
}

@media (max-width: 640px) {
  #workspaceTabsWrapper.workspace-tabs-wrapper {
    position: static !important;
    margin-inline: 0 !important;
  }
  #workspaceTabs.workspace-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  #workspaceTabs .workspace-tab {
    justify-content: flex-start !important;
    padding-inline: 12px !important;
  }
}

/* 2. Zero Box-in-Box: Header HUD, Left Companion Stage, Flashcards, and All 7 Studios */
.hero-pixel-badge,
.mascot-ring {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.text-action {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  min-height: 36px !important;
  color: #78350f !important;
  justify-content: flex-start !important;
  text-decoration: underline !important;
  text-underline-offset: 4px !important;
}

.text-action:hover {
  background: transparent !important;
  color: #451a03 !important;
  transform: none !important;
}

.grammar-link-btn {
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid #e2d8c3 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #047857 !important;
  padding: 12px 0 0 !important;
  min-height: 38px !important;
  justify-content: flex-start !important;
}

.grammar-link-btn:hover {
  background: transparent !important;
  color: #065f46 !important;
  transform: translateX(3px) !important;
  box-shadow: none !important;
}

.player-hud {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
}

.hud-row {
  gap: 16px !important;
}

.hud-stat {
  background: transparent !important;
  border: 0 !important;
  border-left: 2.5px solid #f59e0b !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 4px 12px !important;
}

.hud-stat:nth-child(2) { border-left-color: #38bdf8 !important; }
.hud-stat:nth-child(3) { border-left-color: #34d399 !important; }

.hud-stat strong {
  color: #f8fafc !important;
}

.hud-stat small {
  color: #cbd5e1 !important;
}

.hud-goal {
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
  padding: 12px 0 0 !important;
  margin-top: 12px !important;
}

.hud-goal > div:first-child {
  color: #cbd5e1 !important;
}

.hud-goal strong {
  color: #fde68a !important;
}

.hud-goal-track {
  background: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="light"] .hud-stat strong {
  color: #0f172a !important;
}

html[data-theme="light"] .hud-stat small {
  color: #475569 !important;
}

html[data-theme="light"] .hud-goal {
  border-top-color: rgba(15, 23, 42, 0.14) !important;
}

html[data-theme="light"] .hud-goal > div:first-child {
  color: #334155 !important;
}

html[data-theme="light"] .hud-goal strong {
  color: #92400e !important;
}

html[data-theme="light"] .hud-goal-track {
  background: rgba(15, 23, 42, 0.12) !important;
}

.pixel-companion-stage {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #e2d8c3 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 14px !important;
  margin-bottom: 16px !important;
}

.pixel-companion-avatar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  width: 96px !important;
  height: 96px !important;
}

.pixel-speech-bubble {
  background: transparent !important;
  border: 0 !important;
  border-left: 3px solid #d97706 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 2px 0 2px 10px !important;
  text-align: left !important;
  color: #1e293b !important;
}

.pixel-speech-bubble::after {
  display: none !important;
}

.pixel-pose-btn {
  background: transparent !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #334155 !important;
  padding: 4px 12px !important;
  min-height: 30px !important;
}

.pixel-pose-btn:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
}

.session-vitals {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 8px !important;
}

.session-vitals span {
  background: rgba(15, 23, 42, 0.04) !important;
  border: 0 !important;
  border-left: 3px solid #d97706 !important;
  border-radius: 0 8px 8px 0 !important;
  box-shadow: none !important;
  color: #1e293b !important;
}

/* Flashcard (.citation-slip & .phrasal-slip): Natural Height Expansion + Unboxed Revealed Zones */
.citation-slip {
  height: auto !important;
  min-height: 380px !important;
  max-height: none !important;
  overflow: hidden;
}

.citation-slip.is-revealed {
  overflow-y: auto;
}

.slip-head {
  color: #475569 !important;
}

.slip-position,
.sense-number,
.part-of-speech,
.phrasal-formula-tag,
.phrasal-card-formula,
.speaking-card-badge,
.shadowing-category-badge,
.grammar-chapter-badge,
.grammar-level-badge,
.grammar-cat-badge,
.writing-card-badge {
  background: transparent !important;
  border: 0 !important;
  border-left: 2.5px solid #d97706 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 2px 0 2px 8px !important;
  color: #78350f !important;
}

.part-of-speech,
.speaking-card-badge {
  border-left-color: #0284c7 !important;
  color: #0369a1 !important;
}

.shadowing-category-badge,
.grammar-level-badge.level-beginner {
  border-left-color: #0d9488 !important;
  color: #0f766e !important;
}

.grammar-level-badge.level-intermediate,
.writing-card-badge {
  border-left-color: #ea580c !important;
  color: #9a3412 !important;
}

.grammar-level-badge.level-advanced {
  border-left-color: #dc2626 !important;
  color: #991b1b !important;
}

.grammar-cat-badge,
.slip-position {
  border-left-color: #64748b !important;
  color: #334155 !important;
}

.phrasal-meaning-num {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #0369a1 !important;
}

.answer-panel,
.phrasal-answer-panel {
  border: 0 !important;
  border-top: 1.5px solid #e2d8c3 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 20px 0 4px !important;
  margin-top: 18px !important;
}

.sibling-sense-card,
.particle-logic-box,
.phrasal-meaning-item,
.speaking-box,
.shadowing-tips-box,
.writing-box {
  border: 0 !important;
  border-left: 3px solid #d97706 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 0 6px 14px !important;
  margin-top: 12px !important;
}

.speaking-box {
  border-left-color: #0284c7 !important;
}

.shadowing-sentence-box {
  border: 0 !important;
  border-bottom: 1px solid #e2d8c3 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 12px 0 20px !important;
  margin-bottom: 18px !important;
}

.shadowing-tips-box {
  border-left-color: #0d9488 !important;
}

.writing-box {
  border-left-color: #ea580c !important;
}

.writing-template-pre,
.capture-script {
  border: 0 !important;
  border-left: 3px solid #cbd5e1 !important;
  border-radius: 0 8px 8px 0 !important;
  background: rgba(15, 23, 42, 0.04) !important;
  box-shadow: none !important;
  color: #0f172a !important;
}

.policy-note {
  border: 0 !important;
  border-top: 1.5px solid #e2d8c3 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 24px 0 0 !important;
  margin-top: 28px !important;
}

.flow-list li::before {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.settings-panel {
  border-top: 1px solid #e2d8c3 !important;
}

.settings-panel summary {
  color: #0f172a !important;
}

.queue-tag {
  background: transparent !important;
  border: 1px solid #d97706 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #78350f !important;
}

/* 3. Phrasal Verb Root Filter Bar & Sub-Filter Bars: Wrap Cleanly + Web Standard v2 Underline Tabs */
#phrasalRootWrapper.phrasal-root-wrapper {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 10px !important;
  margin: 0 0 16px !important;
}

html[data-theme="light"] #phrasalRootWrapper.phrasal-root-wrapper {
  border-bottom-color: rgba(15, 23, 42, 0.14) !important;
}

#phrasalRootScroll.phrasal-root-scroll {
  overflow: visible !important;
  padding: 0 !important;
}

#phrasalRootNav.phrasal-root-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.phrasal-root-pill,
.filter-button {
  min-height: 38px !important;
  padding: 6px 12px !important;
  border: 0 !important;
  border-bottom: 2.5px solid transparent !important;
  border-radius: 8px 8px 0 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #cbd5e1 !important;
  font-family: var(--aku-font-head, "AK Thai", "Google Sans", system-ui, sans-serif) !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  transform: none !important;
}

.phrasal-root-pill span {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 0 0 4px !important;
  color: #94a3b8 !important;
  font-size: 0.74rem !important;
}

.phrasal-root-pill:hover,
.filter-button:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border-bottom-color: rgba(245, 158, 11, 0.45) !important;
  transform: none !important;
}

.phrasal-root-pill[aria-pressed="true"],
.filter-button.active,
.filter-button[aria-pressed="true"] {
  background: rgba(245, 158, 11, 0.14) !important;
  border-bottom: 2.5px solid #f59e0b !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

.phrasal-root-pill[aria-pressed="true"] span {
  color: #fde68a !important;
}

/* Filter buttons inside cream session-ledger cards (.phrasal-view-toggle, .ledger-scope-controls) or inside cream cards (.shadowing-card) */
.session-ledger .filter-button,
.shadowing-card .filter-button {
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

.session-ledger .filter-button:hover,
.shadowing-card .filter-button:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.session-ledger .filter-button.active,
.session-ledger .filter-button[aria-pressed="true"] {
  background: #1e293b !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
}

.phrasal-view-toggle {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 !important;
  border-radius: 10px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.phrasal-view-toggle .filter-button:first-child {
  border-radius: 10px 0 0 10px !important;
}

.phrasal-view-toggle .filter-button:last-child {
  border-radius: 0 10px 10px 0 !important;
  border-left: 0 !important;
}

html[data-theme="light"] .phrasal-root-pill,
html[data-theme="light"] .filter-button {
  color: #334155 !important;
}

html[data-theme="light"] .phrasal-root-pill span {
  color: #475569 !important;
}

html[data-theme="light"] .phrasal-root-pill:hover,
html[data-theme="light"] .filter-button:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .phrasal-root-pill[aria-pressed="true"],
html[data-theme="light"] .filter-button.active,
html[data-theme="light"] .filter-button[aria-pressed="true"] {
  background: rgba(180, 83, 9, 0.1) !important;
  border-bottom: 2.5px solid #b45309 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .phrasal-root-pill[aria-pressed="true"] span {
  color: #92400e !important;
}

html[data-theme="light"] .session-ledger .filter-button.active,
html[data-theme="light"] .session-ledger .filter-button[aria-pressed="true"] {
  background: #1e293b !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
}

/* 4. Button Hierarchy B & High-Contrast Primary / Secondary Controls (>= 4.5:1 Everywhere) */
.reveal-button,
.paper-button,
.primary-dark-button:not(.grammar-link-btn),
.speaking-launch-btn,
.writing-copy-btn,
.phrasal-practice-btn,
.shadowing-play-btn {
  background: linear-gradient(180deg, #f3d282 0%, #d4a443 100%) !important;
  border: 1.5px solid #b45309 !important;
  border-bottom: 3.5px solid #78350f !important;
  color: #1b1203 !important;
  text-shadow: none !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

.reveal-button:hover,
.paper-button:hover,
.primary-dark-button:not(.grammar-link-btn):hover,
.speaking-launch-btn:hover,
.writing-copy-btn:hover,
.phrasal-practice-btn:hover,
.shadowing-play-btn:hover {
  background: linear-gradient(180deg, #fae098 0%, #dfaf4e 100%) !important;
  border-color: #92400e !important;
  border-bottom-color: #451a03 !important;
  color: #1b1203 !important;
}

.reveal-button span,
.reveal-button small {
  color: #1b1203 !important;
  text-shadow: none !important;
}

.reveal-button small {
  color: #291a04 !important;
  font-weight: 700 !important;
}

/* Secondary buttons inside cards: quiet outline / ghost */
.speaking-copy-btn,
.library-state-button,
.quiet-button {
  min-height: 44px !important;
  padding: 8px 16px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  color: #1e293b !important;
  font-family: var(--aku-font-head, "AK Thai", "Google Sans", system-ui, sans-serif) !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.speaking-copy-btn:hover,
.library-state-button:hover,
.quiet-button:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.quiet-button.danger-button {
  border-color: #fecaca !important;
  color: #991b1b !important;
  background: #fff5f5 !important;
}

.shadowing-speed-group {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  gap: 6px !important;
  align-items: center !important;
}

.speed-button {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #334155 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.speed-button.active {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #ffffff !important;
}

/* Shadowing Row Height & Mobile Alignment Lock (Zero Misalign, Zero Spill) */
.shadowing-playback-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

#shadowingPlayBtn,
#shadowingBlindToggleBtn,
.phrasal-nav-buttons > button {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.shadowing-nav-row {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: 10px !important;
}

#shadowingPrevBtn,
#shadowingCompleteBtn,
#shadowingNextBtn {
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

#shadowingCompleteBtn strong,
#shadowingCompleteBtn > span {
  display: inline !important;
  margin: 0 !important;
}

@media (max-width: 760px) {
  .shadowing-card {
    padding: 22px 16px !important;
    overflow: hidden !important;
  }
  .shadowing-playback-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .shadowing-speed-group {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    width: 100% !important;
  }
  #shadowingPlayBtn,
  #shadowingBlindToggleBtn {
    width: 100% !important;
  }
  .shadowing-nav-row {
    grid-template-columns: 1fr 1fr !important;
  }
  #shadowingCompleteBtn {
    grid-column: 1 / -1 !important;
    order: -1 !important;
    width: 100% !important;
  }
  #shadowingPrevBtn,
  #shadowingNextBtn {
    width: 100% !important;
    padding: 0 12px !important;
  }
}

/* Disabled & Enabled Rating Buttons: Opaque Surface + Crisp Text (> 7.5:1 Contrast) */
.rating-button:disabled {
  opacity: 1 !important;
  background: #f3ede0 !important;
  border-color: #d6cbb8 !important;
  border-bottom-color: #bfb29c !important;
  color: #334155 !important;
  box-shadow: none !important;
}

.rating-button:disabled strong {
  color: #1e293b !important;
}

.rating-button:disabled > span,
.rating-button:disabled b {
  color: #475569 !important;
  background: transparent !important;
}

.rating-button:not(:disabled) {
  box-shadow: none !important;
}

#vocabApp .rating-button[data-rating="again"]:not(:disabled),
#vocabApp .rating-button[data-phrasal-rating="again"]:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #fee2e2 100%) !important;
  background-color: #fee2e2 !important;
  border-color: #ef4444 !important;
  border-bottom-color: #b91c1c !important;
}
#vocabApp .rating-button[data-rating="again"]:not(:disabled) strong,
#vocabApp .rating-button[data-phrasal-rating="again"]:not(:disabled) strong,
#vocabApp .rating-button[data-rating="again"]:not(:disabled) > span,
#vocabApp .rating-button[data-phrasal-rating="again"]:not(:disabled) > span,
#vocabApp .rating-button[data-rating="again"]:not(:disabled) b,
#vocabApp .rating-button[data-phrasal-rating="again"]:not(:disabled) b {
  color: #450a0a !important;
}

#vocabApp .rating-button[data-rating="hard"]:not(:disabled),
#vocabApp .rating-button[data-phrasal-rating="hard"]:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #fef3c7 100%) !important;
  background-color: #fef3c7 !important;
  border-color: #f59e0b !important;
  border-bottom-color: #b45309 !important;
}
#vocabApp .rating-button[data-rating="hard"]:not(:disabled) strong,
#vocabApp .rating-button[data-phrasal-rating="hard"]:not(:disabled) strong,
#vocabApp .rating-button[data-rating="hard"]:not(:disabled) > span,
#vocabApp .rating-button[data-phrasal-rating="hard"]:not(:disabled) > span,
#vocabApp .rating-button[data-rating="hard"]:not(:disabled) b,
#vocabApp .rating-button[data-phrasal-rating="hard"]:not(:disabled) b {
  color: #431407 !important;
}

#vocabApp .rating-button[data-rating="good"]:not(:disabled),
#vocabApp .rating-button[data-phrasal-rating="good"]:not(:disabled),
#vocabApp #shadowingCompleteBtn {
  background: linear-gradient(180deg, #ffffff 0%, #dcfce7 100%) !important;
  background-color: #dcfce7 !important;
  border-color: #22c55e !important;
  border-bottom-color: #15803d !important;
}
#vocabApp .rating-button[data-rating="good"]:not(:disabled) strong,
#vocabApp .rating-button[data-phrasal-rating="good"]:not(:disabled) strong,
#vocabApp .rating-button[data-rating="good"]:not(:disabled) > span,
#vocabApp .rating-button[data-phrasal-rating="good"]:not(:disabled) > span,
#vocabApp .rating-button[data-rating="good"]:not(:disabled) b,
#vocabApp .rating-button[data-phrasal-rating="good"]:not(:disabled) b,
#vocabApp #shadowingCompleteBtn strong,
#vocabApp #shadowingCompleteBtn span {
  color: #052e16 !important;
}

#vocabApp .rating-button[data-rating="easy"]:not(:disabled),
#vocabApp .rating-button[data-phrasal-rating="easy"]:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%) !important;
  background-color: #dbeafe !important;
  border-color: #3b82f6 !important;
  border-bottom-color: #1d4ed8 !important;
}
#vocabApp .rating-button[data-rating="easy"]:not(:disabled) strong,
#vocabApp .rating-button[data-phrasal-rating="easy"]:not(:disabled) strong,
#vocabApp .rating-button[data-rating="easy"]:not(:disabled) > span,
#vocabApp .rating-button[data-phrasal-rating="easy"]:not(:disabled) > span,
#vocabApp .rating-button[data-rating="easy"]:not(:disabled) b,
#vocabApp .rating-button[data-phrasal-rating="easy"]:not(:disabled) b {
  color: #172554 !important;
}

.rating-button b,
.rating-button > b {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* 5. All-8-Tabs Inner Card Kicker, Label, Meta & Input Contrast Lock (Zero Washed-Out Text / Zero Sinking Inputs) */
.sheet-kicker,
.quest-kicker,
.challenge-label {
  color: #92400e !important;
  font-weight: 800 !important;
}

.answer-panel h3,
.definition-th,
.phrasal-meaning-th,
.library-definition .entry-thai {
  color: #065f46 !important;
}

.speaking-box-label,
.entry-meta {
  color: #075985 !important;
}

.writing-box-label {
  color: #9a3412 !important;
}

.shadowing-cadence-note,
.grammar-card-time {
  color: #334155 !important;
}

/* Inputs inside Cream Cards (#queueInput & #librarySearch): Crisp White Surface + Dark Slate Text & Placeholder */
#queueInput,
.library-search-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #94a3b8 !important;
  border-bottom: 3px solid #64748b !important;
  box-shadow: none !important;
}

#queueInput::placeholder,
.library-search-input::placeholder {
  color: #475569 !important;
  opacity: 1 !important;
}

/* Inputs on Dark/Light Page Canvas (#phrasalSearch & #grammarSearch) */
.search-field:not(.library-search-input) {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1.5px solid #475569 !important;
  border-bottom: 3px solid #f59e0b !important;
  box-shadow: none !important;
}

.search-field:not(.library-search-input)::placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}

html[data-theme="light"] .search-field:not(.library-search-input) {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #94a3b8 !important;
  border-bottom: 3px solid #b45309 !important;
}

html[data-theme="light"] .search-field:not(.library-search-input)::placeholder {
  color: #475569 !important;
  opacity: 1 !important;
}

.queue-empty-hint {
  margin: 4px 0 0 !important;
  color: #475569 !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

/* Status, Undo & Keyboard Help Contrast Lock (Dark + Light >= 5.5:1) */
.review-status,
.keyboard-help,
.keyboard-help kbd,
.phrasal-grid-meta,
.grammar-meta {
  color: #cbd5e1 !important;
}

.undo-button {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  color: #f8fafc !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

.undo-button:disabled {
  opacity: 1 !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="light"] .review-status,
html[data-theme="light"] .keyboard-help,
html[data-theme="light"] .phrasal-grid-meta,
html[data-theme="light"] .grammar-meta {
  color: #334155 !important;
}

html[data-theme="light"] .keyboard-help kbd {
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .undo-button {
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}

html[data-theme="light"] .undo-button:disabled {
  color: #475569 !important;
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

html[data-theme="light"] .search-field,
html[data-theme="light"] #queueInput {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  border-bottom-color: #94a3b8 !important;
}

html[data-theme="light"] .system-state {
  background: rgba(255, 253, 248, 0.94) !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  border-bottom-color: #d6c8b0 !important;
  color: #0f172a !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .system-state h2,
html[data-theme="light"] .system-state h3 {
  color: #0f172a !important;
  text-shadow: none !important;
}

/* 6. Duolingo 3D Tactile Game Polish Across All 8 Tabs */
.phrasal-search-row,
.grammar-search-row,
.library-controls {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.grammar-toolbar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
}

#phrasalSearch,
#grammarSearch,
#librarySearch {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
  min-height: 48px !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  font-size: 0.98rem !important;
}

/* Chunky 3D Progress Bar & Lesson Checkpoints */
.progress-track,
.goal-track {
  height: 14px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.55) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  overflow: hidden !important;
}

html[data-theme="light"] .progress-track,
html[data-theme="light"] .goal-track {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

.progress-fill,
.goal-fill {
  background: linear-gradient(90deg, #22c55e 0%, #84cc16 55%, #facc15 100%) !important;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.42) !important;
}

#lessonPath {
  display: flex !important;
  justify-content: space-between !important;
  margin-top: 8px !important;
  padding: 0 4px !important;
}

#lessonPath span {
  width: 12px !important;
  height: 12px !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.38) !important;
  border: 2px solid rgba(255, 255, 255, 0.42) !important;
}

html[data-theme="light"] #lessonPath span {
  background: #cbd5e1 !important;
  border-color: #94a3b8 !important;
}

#lessonPath span.is-done,
#lessonPath span.is-active {
  background: #facc15 !important;
  border-color: #ca8a04 !important;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55) !important;
}

/* Compact Revealed Slip so 4 Duolingo Rating Buttons Fit in Viewport Without Scrolling */
.citation-slip {
  min-height: 290px !important;
  padding: 22px 26px !important;
  border-bottom: 6px solid #d6c8b0 !important;
  border-radius: 24px !important;
}

.citation-slip.is-revealed {
  padding: 18px 24px !important;
  min-height: 0 !important;
}

.prompt-block {
  padding: 6px 0 !important;
}

.review-word {
  font-size: clamp(2.2rem, 4vw, 3.2rem) !important;
  margin: 4px 0 !important;
}

/* Duolingo 3D Tactile Lip Physics on Primary & Rating Buttons */
.reveal-button {
  border: 2px solid #b45309 !important;
  border-bottom: 5px solid #92400e !important;
  border-radius: 16px !important;
  min-height: 56px !important;
  padding: 10px 24px !important;
}

.rating-button:disabled {
  min-height: 48px !important;
  padding: 8px 12px !important;
  border-bottom-width: 3px !important;
}

.rating-button:not(:disabled) {
  min-height: 60px !important;
  border-width: 2px !important;
  border-bottom-width: 5px !important;
  border-radius: 16px !important;
}

/* Interactive Studio Quest Buttons (Speaking AI / Grammar Hub / Writing Studio) */
.speaking-card-actions,
.grammar-card-footer,
.writing-card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 14px !important;
}

.grammar-link-btn {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 2px solid #334155 !important;
  border-bottom: 4px solid #020617 !important;
  border-radius: 999px !important;
  padding: 8px 16px !important;
  min-height: 40px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.grammar-link-btn:hover {
  background: #1e293b !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.studio-quest-btn {
  background: #f0fdf4 !important;
  color: #052e16 !important;
  border: 2px solid #22c55e !important;
  border-bottom: 4px solid #15803d !important;
  border-radius: 999px !important;
  padding: 8px 16px !important;
  min-height: 40px !important;
  font-family: var(--font-en-display), var(--font-th), sans-serif !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.studio-quest-btn:hover {
  background: #dcfce7 !important;
  transform: translateY(-1px) !important;
}

.studio-quest-btn.is-done {
  background: #dcfce7 !important;
  color: #052e16 !important;
  border-color: #16a34a !important;
  border-bottom-color: #14532d !important;
}

.speaking-card.is-quest-done,
.grammar-card.is-quest-done,
.writing-card.is-quest-done {
  border-color: #22c55e !important;
  border-bottom-color: #15803d !important;
}

.writing-card {
  padding: 20px 22px !important;
  gap: 10px !important;
}

.writing-framework-pre {
  font-size: 0.85rem !important;
  line-height: 1.42 !important;
  margin: 4px 0 !important;
}

.writing-phrases-list {
  margin: 4px 0 !important;
  gap: 4px !important;
}

.writing-template-pre.is-collapsed {
  max-height: 64px !important;
  overflow: hidden !important;
  margin: 4px 0 !important;
}

@media (min-width: 900px) {
  .library-entry {
    grid-template-columns: minmax(210px, 1.15fr) 2.2fr auto !important;
  }
}

.library-term h3 {
  word-break: normal !important;
  overflow-wrap: normal !important;
}

.library-term-head {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.library-audio-btn {
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 10px !important;
  border: 1.5px solid #60a5fa !important;
  border-bottom: 3px solid #2563eb !important;
  background: #eff6ff !important;
  color: #1e3a8a !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  font-size: 0.88rem !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REA-EXTRACTED DUOLINGO WEB ("FEATHER / WEB-UI") DESIGN SYSTEM & MECHANICS
   Source Evidence: ev_976fd367... / ev_8b65b78d... / ev_69376efd...
   Decompiled from: d35aaqx5ub95lt.cloudfront.net/css/4779-c36ad395.css & DOM
   ═══════════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'AK Thai';
  src: url('/assets/fonts/noto-sans-thai.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  --aku-font-head: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --aku-font-body: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif;
  --aku-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --color-owl: 88, 204, 2;
  --color-tree-frog: 88, 167, 0;
  --color-sea-sponge: 215, 255, 184;
  --color-turtle: 165, 237, 110;
  --color-macaw: 28, 176, 246;
  --color-whale: 24, 153, 214;
  --color-blue-jay: 132, 216, 255;
  --color-iguana: 221, 244, 255;
  --color-cardinal: 255, 75, 75;
  --color-fire-ant: 234, 43, 43;
  --color-walking-fish: 255, 223, 224;
  --color-bee: 255, 200, 0;
  --color-camel: 231, 166, 1;
  --color-canary: 255, 245, 211;
  --color-fox: 255, 150, 0;
  --color-beetle: 206, 130, 255;
  --color-swan: 229, 229, 229;
  --color-swan-always-dark: 55, 70, 79;
  --color-hare: 175, 175, 175;
  --color-eel: 75, 75, 75;
  --color-snow: 255, 255, 255;
  --color-snow-always-dark: 19, 31, 36;
  --web-ui_button-lip-width: 4px;
  --web-ui_button-border-radius: 12px;
}

/* Pattern 2 from REA (duo521_click-continue-2.png): Inner specular gummy highlight strip */
.progress-fill,
.goal-fill {
  position: relative !important;
  overflow: hidden !important;
  background: rgb(var(--color-owl)) !important;
}

.progress-fill::after,
.goal-fill::after {
  content: "" !important;
  position: absolute !important;
  top: 3px !important;
  left: 8px !important;
  right: 8px !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.34) !important;
  pointer-events: none !important;
}

/* Pattern 1 from REA (duo521_wait-funboarding-continue.png): Mascot + Speech Bubble Prompt */
.duo-quiz-box {
  margin: 8px 0 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.duo-coach-prompt {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.duo-coach-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  object-fit: contain !important;
  background: #f1f5f9 !important;
  border: 2px solid rgb(var(--color-swan)) !important;
  flex-shrink: 0 !important;
}

.duo-speech-bubble {
  position: relative !important;
  background: #ffffff !important;
  color: rgb(var(--color-eel)) !important;
  border: 2px solid rgb(var(--color-swan)) !important;
  border-bottom-width: 3px !important;
  border-radius: 14px !important;
  padding: 8px 14px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.duo-speech-bubble::before {
  content: "" !important;
  position: absolute !important;
  left: -8px !important;
  top: 50% !important;
  transform: translateY(-50%) rotate(45deg) !important;
  width: 12px !important;
  height: 12px !important;
  background: #ffffff !important;
  border-left: 2px solid rgb(var(--color-swan)) !important;
  border-bottom: 2px solid rgb(var(--color-swan)) !important;
}

/* Pattern 5 from REA (4779-c36ad395.css ._2V6ug): Outlined 3D Choice Cards + Numbered Key Badges */
.duo-choice-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 8px !important;
}

.duo-choice-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 46px !important;
  padding: 8px 12px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 2px solid rgb(var(--color-swan)) !important;
  border-bottom: 4px solid #cecece !important;
  border-radius: 12px !important;
  font-family: var(--font-th), var(--font-en-body), sans-serif !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: transform 90ms ease, background-color 140ms ease, border-color 140ms ease !important;
}

.duo-choice-btn:hover:not(:disabled) {
  background: #f8fafc !important;
  border-color: rgb(var(--color-blue-jay)) !important;
  border-bottom-color: rgb(var(--color-macaw)) !important;
}

.duo-choice-btn:active:not(:disabled) {
  transform: translateY(2px) !important;
  border-bottom-width: 2px !important;
}

.duo-key-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 7px !important;
  border: 2px solid rgb(var(--color-swan)) !important;
  background: #f8fafc !important;
  color: #64748b !important;
  font-family: var(--font-en-display), monospace !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  flex-shrink: 0 !important;
}

.duo-choice-btn.is-correct {
  background: rgb(var(--color-sea-sponge)) !important;
  border-color: rgb(var(--color-owl)) !important;
  border-bottom-color: rgb(var(--color-tree-frog)) !important;
  color: #14532d !important;
}

.duo-choice-btn.is-correct .duo-key-badge {
  background: rgb(var(--color-owl)) !important;
  border-color: rgb(var(--color-tree-frog)) !important;
  color: #ffffff !important;
}

.duo-choice-btn.is-wrong {
  background: rgb(var(--color-walking-fish)) !important;
  border-color: rgb(var(--color-cardinal)) !important;
  border-bottom-color: rgb(var(--color-fire-ant)) !important;
  color: #7f1d1d !important;
}

.duo-choice-btn.is-wrong .duo-key-badge {
  background: rgb(var(--color-cardinal)) !important;
  border-color: rgb(var(--color-fire-ant)) !important;
  color: #ffffff !important;
}

/* Pattern 4 from REA: Sea-Sponge Green & Walking-Fish Red Feedback Sheet */
.duo-inline-feedback {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
}

.duo-inline-feedback[hidden] {
  display: none !important;
}

.duo-inline-feedback.is-correct {
  background: rgb(var(--color-sea-sponge)) !important;
  border: 2px solid rgb(var(--color-owl)) !important;
  border-bottom: 4px solid rgb(var(--color-tree-frog)) !important;
  color: #14532d !important;
}

.duo-inline-feedback.is-wrong {
  background: rgb(var(--color-walking-fish)) !important;
  border: 2px solid rgb(var(--color-cardinal)) !important;
  border-bottom: 4px solid rgb(var(--color-fire-ant)) !important;
  color: #7f1d1d !important;
}

/* Pattern 3 from REA: Interactive Duolingo Word Bank Sentence Builder (Grammar Hub) */
.duo-wordbank-stage {
  margin-bottom: 22px !important;
}

.duo-wordbank-card {
  background: linear-gradient(180deg, #fffdf9 0%, #f8f4ec 100%) !important;
  color: #0f172a !important;
  border: 2.5px solid #cbd5e1 !important;
  border-bottom: 6px solid #94a3b8 !important;
  border-radius: 22px !important;
  padding: 20px 22px !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.duo-wb-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.duo-wb-kicker {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgb(var(--color-iguana)) !important;
  color: rgb(var(--color-whale)) !important;
  border: 1.5px solid rgb(var(--color-blue-jay)) !important;
  border-bottom: 3px solid rgb(var(--color-macaw)) !important;
  border-radius: 999px !important;
  padding: 4px 12px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.duo-wb-progress {
  font-family: var(--font-en-display), monospace !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  color: #475569 !important;
}

.duo-wb-prompt-th {
  font-size: 1.12rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 !important;
}

.duo-wb-grammar-hint {
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  margin: 2px 0 0 !important;
}

.duo-sentence-tray {
  min-height: 60px !important;
  padding: 10px 12px !important;
  background: #f8fafc !important;
  border: 2px dashed #cbd5e1 !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
}

.duo-tray-placeholder {
  color: #64748b !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  user-select: none !important;
}

.duo-word-bank {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px 0 !important;
}

/* Exact replica of Duolingo 4779-c36ad395.css ._2V6ug Word Bank Tile */
.duo-word-tile {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 6px 14px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid rgb(var(--color-swan)) !important;
  border-bottom: 4px solid #cbd5e1 !important;
  border-radius: 12px !important;
  font-family: var(--font-en-display), sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: transform 80ms ease, background-color 120ms ease, border-color 120ms ease !important;
}

.duo-word-tile:hover:not(.is-ghost) {
  background: rgb(var(--color-iguana)) !important;
  border-color: rgb(var(--color-blue-jay)) !important;
  border-bottom-color: rgb(var(--color-macaw)) !important;
  color: rgb(var(--color-whale)) !important;
}

.duo-word-tile:active:not(.is-ghost) {
  transform: translateY(2px) !important;
  border-bottom-width: 2px !important;
}

.duo-word-tile.in-tray {
  background: rgb(var(--color-iguana)) !important;
  border-color: rgb(var(--color-blue-jay)) !important;
  border-bottom-color: rgb(var(--color-macaw)) !important;
  color: #0c4a6e !important;
}

/* Recessed gray ghost silhouette in Word Bank when tile is in tray (Duolingo ._2V6ug._2wryV) */
.duo-word-tile.is-ghost {
  background: rgb(var(--color-swan)) !important;
  border-color: rgb(var(--color-swan)) !important;
  border-bottom-color: #d4d4d4 !important;
  color: transparent !important;
  pointer-events: none !important;
  user-select: none !important;
}

.duo-wb-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  padding-top: 6px !important;
  border-top: 1.5px solid #e2e8f0 !important;
}

.duo-wb-left-btns,
.duo-wb-right-btns {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Exact replica of Duolingo 4779-c36ad395.css ._1VYyp Primary Check Button */
.duo-check-btn {
  min-height: 46px !important;
  padding: 8px 22px !important;
  background: rgb(var(--color-owl)) !important;
  color: #ffffff !important;
  border: 2px solid rgb(var(--color-owl)) !important;
  border-bottom: 4px solid rgb(var(--color-tree-frog)) !important;
  border-radius: 14px !important;
  font-family: var(--font-en-display), sans-serif !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: filter 150ms ease, transform 80ms ease !important;
}

.duo-check-btn:hover:not(:disabled) {
  filter: brightness(1.08) !important;
}

.duo-check-btn:active:not(:disabled) {
  transform: translateY(2px) !important;
  border-bottom-width: 2px !important;
}

.duo-check-btn:disabled {
  background: rgb(var(--color-swan)) !important;
  border-color: rgb(var(--color-swan)) !important;
  border-bottom-color: #cbd5e1 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
}

.duo-wb-secondary-btn {
  min-height: 40px !important;
  padding: 6px 14px !important;
  background: #ffffff !important;
  color: #334155 !important;
  border: 2px solid rgb(var(--color-swan)) !important;
  border-bottom: 3.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.duo-wb-secondary-btn:hover {
  background: #f1f5f9 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WEB STANDARD V2 FONT LOCK + WARM ESPRESSO-BRONZE DARK CARDS + 4-COLOR RATING + HUD BOX
   (Audi 2026-10-26:
    - "คุณคิดว่าสีพื้นหลังแบบนี้กล่องควรเป็นสีอะไรถ้าไม่ใช่สีตอนนี้"
    - "แล้ว Again 1 · 10m Hard 2 · 1d Good 3 · 1d Easy 4 · 4d ไม่มีสีเลยหรอ"
    - "แล้ว 🔥 0 day streak ⚡ 0 total XP 📚 193 words ready Today's goal 0 / 50 XP ตรงนี้ควรมีกล่องรึป่าว"
    - "คือฉันไม่ชอบกล่องก็จริงแต่ไม่ใช้กล่องเลยฉันไม่ชอบกว่า เพราะมันดูยาก จำเข้ากฎskillการทำเว้ปด้วย")
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Canonical Font Lock: AK Thai (Noto Sans Thai) + Google Sans Everywhere */
body,
.ak-shell,
.ak-footer,
#vocabApp,
#vocabApp button,
#vocabApp input,
#vocabApp select,
#vocabApp textarea {
  font-family: "AK Thai", "Google Sans", system-ui, -apple-system, sans-serif !important;
}

.review-ipa,
.phrasal-ipa,
.shadowing-ipa-text,
.writing-framework-pre,
.writing-template-pre,
.capture-script,
.keyboard-help kbd {
  font-family: "JetBrains Mono", "AK Thai", ui-monospace, monospace !important;
}

/* 2. Top Player HUD (.player-hud): Restore 1 Outer Container Box (Inner items stay unboxed = 0 Box-in-Box) */
.player-hud {
  padding: 18px 22px !important;
  border-radius: 22px !important;
}

/* 3. Zero Navy-Blue Buttons: Warm Gold 3D Tactile Mode Switches & Primary CTAs */
.phrasal-view-toggle,
.ledger-scope-controls {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.phrasal-view-toggle .filter-button,
.phrasal-view-toggle .filter-button:first-child,
.phrasal-view-toggle .filter-button:last-child,
.ledger-scope-controls .filter-button {
  border-radius: 12px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  font-weight: 800 !important;
}

.session-ledger .filter-button.active,
.session-ledger .filter-button[aria-pressed="true"],
html[data-theme="light"] .session-ledger .filter-button.active,
html[data-theme="light"] .session-ledger .filter-button[aria-pressed="true"],
.phrasal-view-toggle .filter-button[aria-pressed="true"],
.grammar-link-btn {
  background: linear-gradient(180deg, #f7d274 0%, #e5b241 100%) !important;
  border: 1.5px solid #b45309 !important;
  border-bottom: 3.5px solid #78350f !important;
  color: #1b1203 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
  text-shadow: none !important;
}

.session-ledger .filter-button.active:hover,
.session-ledger .filter-button[aria-pressed="true"]:hover,
html[data-theme="light"] .session-ledger .filter-button.active:hover,
html[data-theme="light"] .session-ledger .filter-button[aria-pressed="true"]:hover,
.phrasal-view-toggle .filter-button[aria-pressed="true"]:hover,
.grammar-link-btn:hover {
  background: linear-gradient(180deg, #fae098 0%, #dfaf4e 100%) !important;
  border-color: #92400e !important;
  border-bottom-color: #451a03 !important;
  color: #1b1203 !important;
  transform: translateY(-1px) !important;
}

/* 4. Dark Mode Surface Architecture: Refined C (Warm Ivory-Sand) & D (Obsidian Graphite) Pairings
      Zero navy-on-navy, zero blinding white glare — switchable via [data-card-palette] or ?card= */
html:not([data-theme="light"]) {
  /* Default Graphite variables (used by Graphite surfaces in C1, D1, D2) */
  --vc-card-bg: radial-gradient(circle at 100% 0%, rgba(248, 250, 252, 0.10), transparent 48%), linear-gradient(165deg, #21242b 0%, #16181d 100%);
  --vc-card-border: #5a6272;
  --vc-card-lip: #0b0c0e;
  --vc-tile-bg: #2c3039;
  --vc-tile-hover: #383d48;
  --vc-tile-border: #70788b;
  --vc-tile-lip: #101216;
  --vc-tray-bg: #121418;
  --vc-divider: rgba(226, 232, 240, 0.14);
}

html:not([data-theme="light"]) body {
  background: radial-gradient(ellipse 100% 70% at 50% 0%, #1b365d 0%, #09172d 55%, #070d17 100%) !important;
  color: #f4f6fc !important;
}

html:not([data-theme="light"]) :is(
  .player-hud,
  .session-ledger,
  .citation-slip,
  .phrasal-card,
  .speaking-card,
  .shadowing-card,
  .grammar-card,
  .writing-card,
  .library-stage-box,
  .capture-stage-box,
  .duo-wordbank-card,
  .system-state
) {
  background: var(--vc-card-bg) !important;
  border: 2px solid var(--vc-card-border) !important;
  border-bottom: 5px solid var(--vc-card-lip) !important;
  color: #fdfbf7 !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

html:not([data-theme="light"]) :is(.speaking-card, .grammar-card, .writing-card).is-quest-done {
  border-color: #22c55e !important;
  border-bottom-color: #15803d !important;
}

/* Dark Mode Primary Headings & Words (>14:1 contrast) */
html:not([data-theme="light"]) :is(
  .review-word,
  .session-ledger h2,
  .speaking-card-title,
  .grammar-card-title,
  .writing-card-title,
  .library-term h3,
  .phrasal-card-title,
  .duo-wb-prompt-th,
  .capture-stage-box h2,
  .capture-stage-box h3,
  .shadowing-en-text,
  .system-state h2,
  .system-state h3,
  .settings-panel summary,
  .phrasal-formula-tag .verb-part,
  .ledger-line dd,
  .blind-title,
  .combo-peek-bubble strong
) {
  color: #fdfbf7 !important;
  text-shadow: none !important;
}

/* Dark Mode Body, Definitions & Examples (>10:1 contrast) */
html:not([data-theme="light"]) :is(
  .definition-en,
  .example-en,
  .example-th,
  .usage-note,
  .phrasal-meaning-en,
  .phrasal-example-en,
  .phrasal-example-th,
  .phrasal-tip,
  .particle-logic-text,
  .speaking-card-summary,
  .speaking-card-title-th,
  .speaking-box-text,
  .speaking-openers-list li,
  .grammar-card-sub,
  .grammar-card-desc,
  .writing-card-sub,
  .writing-card-objective,
  .writing-phrases-list li,
  .library-definition .entry-definition,
  .library-definition .entry-example,
  .shadowing-th-text,
  .shadowing-tips-list li,
  .ledger-note,
  .duo-wb-grammar-hint,
  .duo-wb-progress,
  .flow-list li,
  .policy-note p,
  .queue-empty-hint,
  .phrasal-card-meaning-line small,
  .sibling-sense-def-en,
  .sibling-sense-example,
  .system-state p
) {
  color: #f1ece1 !important;
}

/* Dark Mode Metadata & IPA (>8.5:1 contrast) */
html:not([data-theme="light"]) :is(
  .slip-head,
  .review-ipa,
  .phrasal-ipa,
  .proof-note,
  .shadowing-ipa-text,
  .shadowing-cadence-note,
  .grammar-card-time,
  .grammar-cat-badge,
  .slip-position,
  .sibling-sense-pos,
  .quest-copy,
  .ledger-line dt,
  .prompt-kicker,
  .pronunciation-row,
  .pronunciation-row span,
  .blind-hint,
  .shadowing-counter,
  .library-meta,
  .library-meta span,
  #libraryCount,
  .combo-peek-bubble small,
  .phrasal-formula-tag .plus-sign
) {
  color: #dcd2c0 !important;
}

/* Dark Mode Thai Meanings & Positive Highlights (Duolingo Mint/Turtle #6ee7b7, >10:1 contrast) */
html:not([data-theme="light"]) :is(
  .answer-panel h3,
  .definition-th,
  .phrasal-meaning-th,
  .library-definition .entry-thai,
  .sibling-sense-def-th,
  .sibling-senses-title
) {
  color: #6ee7b7 !important;
}

/* Dark Mode Gold Kickers & Badges (#fcd34d, >11.5:1 contrast) */
html:not([data-theme="light"]) :is(
  .sheet-kicker,
  .quest-kicker,
  .challenge-label,
  .sense-number,
  .phrasal-formula-tag,
  .phrasal-card-formula,
  .grammar-chapter-badge,
  .phrasal-card-meaning-line strong,
  .particle-logic-label,
  .session-vitals strong
) {
  color: #fcd34d !important;
}

html:not([data-theme="light"]) .sibling-sense-badge {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #fde68a !important;
}

/* Dark Mode Blue / Cyan / Coral Category Badges (>9.5:1 contrast) */
html:not([data-theme="light"]) :is(
  .part-of-speech,
  .speaking-card-badge,
  .speaking-box-label,
  .entry-meta,
  .phrasal-meaning-num,
  .example-block h3,
  .phrasal-formula-tag .particle-part
) {
  color: #7dd3fc !important;
  border-left-color: #38bdf8 !important;
}

html:not([data-theme="light"]) .phrasal-meaning-badge {
  background: rgba(56, 189, 248, 0.16) !important;
  border-color: rgba(56, 189, 248, 0.42) !important;
  color: #bae6fd !important;
}

html:not([data-theme="light"]) :is(.shadowing-category-badge, .grammar-level-badge.level-beginner, .shadowing-tips-label) {
  color: #5eead4 !important;
  border-left-color: #2dd4bf !important;
}

html:not([data-theme="light"]) :is(.grammar-level-badge.level-intermediate, .writing-card-badge, .writing-box-label) {
  color: #fdba74 !important;
  border-left-color: #fb923c !important;
}

html:not([data-theme="light"]) .grammar-level-badge.level-advanced {
  color: #fca5a5 !important;
  border-left-color: #f87171 !important;
}

/* Dark Mode Dividers & Inner Sections */
html:not([data-theme="light"]) :is(
  .pixel-companion-stage,
  .answer-panel,
  .phrasal-answer-panel,
  .shadowing-sentence-box,
  .policy-note,
  .settings-panel,
  .library-entry,
  .duo-wb-actions,
  .example-block,
  .phrasal-example-box,
  .usage-note,
  .ledger-list,
  .ledger-line
) {
  border-color: var(--vc-divider, rgba(255, 236, 196, 0.15)) !important;
}

html:not([data-theme="light"]) .pixel-speech-bubble {
  color: #fdfbf7 !important;
  border-left-color: #f59e0b !important;
}

html:not([data-theme="light"]) .session-vitals span {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #fdfbf7 !important;
  border-left-color: #f59e0b !important;
}

html:not([data-theme="light"]) .pixel-pose-btn {
  background: var(--vc-tile-bg) !important;
  border: 1.5px solid var(--vc-tile-border) !important;
  color: #fdfbf7 !important;
}

html:not([data-theme="light"]) .pixel-pose-btn:hover {
  background: var(--vc-tile-hover) !important;
  color: #ffffff !important;
}

html:not([data-theme="light"]) .text-action {
  color: #fcd34d !important;
}

html:not([data-theme="light"]) .text-action:hover {
  color: #fde68a !important;
}

/* Dark Mode Inactive Filter Buttons, Secondary Buttons & Audio Button */
html:not([data-theme="light"]) :is(
  .session-ledger .filter-button:not(.active):not([aria-pressed="true"]),
  .shadowing-card .filter-button:not(.active):not([aria-pressed="true"]),
  .speaking-copy-btn,
  .library-state-button,
  .quiet-button:not(.danger-button),
  .speed-button:not(.active),
  .duo-wb-secondary-btn
) {
  background: var(--vc-tile-bg) !important;
  border: 1.5px solid var(--vc-tile-border) !important;
  border-bottom: 3px solid var(--vc-tile-lip) !important;
  color: #fdfbf7 !important;
}

html:not([data-theme="light"]) :is(
  .session-ledger .filter-button:not(.active):not([aria-pressed="true"]):hover,
  .shadowing-card .filter-button:not(.active):not([aria-pressed="true"]):hover,
  .speaking-copy-btn:hover,
  .library-state-button:hover,
  .quiet-button:not(.danger-button):hover,
  .speed-button:not(.active):hover,
  .duo-wb-secondary-btn:hover
) {
  background: var(--vc-tile-hover) !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
}

html:not([data-theme="light"]) .quiet-button.danger-button {
  background: #3b181e !important;
  border: 1.5px solid #f87171 !important;
  border-bottom: 3px solid #7f1d1d !important;
  color: #fecaca !important;
}

html:not([data-theme="light"]) .library-audio-btn,
html:not([data-theme="light"]) .pronounce-button,
html:not([data-theme="light"]) .icon-button {
  background: var(--vc-tile-bg) !important;
  border: 1.5px solid #f59e0b !important;
  border-bottom: 3px solid #92400e !important;
  color: #fde68a !important;
}

html:not([data-theme="light"]) .studio-quest-btn {
  background: #143d29 !important;
  border: 2px solid #22c55e !important;
  border-bottom: 4px solid #14532d !important;
  color: #bbf7d0 !important;
}

html:not([data-theme="light"]) .studio-quest-btn:hover {
  background: #194d34 !important;
  color: #dcfce7 !important;
}

/* Dark Mode Preformatted Blocks, Inputs & Queue Tags */
html:not([data-theme="light"]) :is(.writing-template-pre, .writing-framework-pre, .capture-script) {
  background: var(--vc-tray-bg) !important;
  color: #fdfbf7 !important;
  border-left: 3px solid #f59e0b !important;
}

html:not([data-theme="light"]) :is(#queueInput, .library-search-input, .search-field:not(.library-search-input)) {
  background: var(--vc-tray-bg) !important;
  color: #fdfbf7 !important;
  border: 1.5px solid var(--vc-tile-border) !important;
  border-bottom: 3px solid #f59e0b !important;
}

html:not([data-theme="light"]) :is(#queueInput, .library-search-input, .search-field:not(.library-search-input))::placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}

html:not([data-theme="light"]) .queue-tag {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: #f59e0b !important;
  color: #fde68a !important;
}

html:not([data-theme="light"]) .flow-list li::before {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fde68a !important;
}

/* Dark Mode Duolingo Quiz Choices, Mascot Bubble & Word Bank Tiles */
html:not([data-theme="light"]) .duo-coach-avatar {
  background: var(--vc-tile-bg) !important;
  border-color: var(--vc-tile-border) !important;
}

html:not([data-theme="light"]) .duo-speech-bubble {
  background: transparent !important;
  color: #cbd5e1 !important;
  border: 0 !important;
  box-shadow: none !important;
}

html:not([data-theme="light"]) .duo-speech-bubble::before {
  display: none !important;
}

html:not([data-theme="light"]) .duo-wb-kicker {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.5) !important;
  border-bottom-color: #b45309 !important;
  color: #fde68a !important;
}

html:not([data-theme="light"]) .duo-sentence-tray {
  background: var(--vc-tray-bg) !important;
  border-color: var(--vc-card-border) !important;
}

html:not([data-theme="light"]) .duo-tray-placeholder {
  color: #cbd5e1 !important;
}

html:not([data-theme="light"]) :is(.duo-choice-btn, .duo-word-tile):not(.is-correct):not(.is-wrong):not(.in-tray):not(.is-ghost) {
  background: var(--vc-tile-bg) !important;
  color: #fdfbf7 !important;
  border: 2px solid var(--vc-tile-border) !important;
  border-bottom: 4px solid var(--vc-tile-lip) !important;
}

html:not([data-theme="light"]) :is(.duo-choice-btn, .duo-word-tile):hover:not(:disabled):not(.is-correct):not(.is-wrong):not(.is-ghost) {
  background: var(--vc-tile-hover) !important;
  border-color: #fbbf24 !important;
  border-bottom-color: #b45309 !important;
  color: #ffffff !important;
}

html:not([data-theme="light"]) .duo-key-badge {
  background: var(--vc-tray-bg) !important;
  border-color: var(--vc-tile-border) !important;
  color: #fde68a !important;
}

html:not([data-theme="light"]) .duo-word-tile.in-tray {
  background: #3d2f14 !important;
  border-color: #fbbf24 !important;
  border-bottom-color: #b45309 !important;
  color: #fef3c7 !important;
}

html:not([data-theme="light"]) .duo-word-tile.is-ghost {
  background: var(--vc-tray-bg) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  border-bottom-color: rgba(0, 0, 0, 0.3) !important;
  color: transparent !important;
}

html:not([data-theme="light"]) .duo-check-btn:disabled {
  background: var(--vc-tile-bg) !important;
  border-color: var(--vc-tile-border) !important;
  border-bottom-color: var(--vc-tile-lip) !important;
  color: #cbd5e1 !important;
  filter: none !important;
  opacity: 0.75 !important;
}

html:not([data-theme="light"]) .combo-peek-bubble {
  background: var(--vc-tile-bg) !important;
  border-color: #f59e0b !important;
  color: #fdfbf7 !important;
}

/* 4b. Redesigned Quiz Choice Section (#playQuizBox & #phrasalQuizBox)
       Centered header strip + Clean vertical 3D choice stack + Right-side status pill */
.duo-quiz-box[hidden],
.duo-choice-grid[hidden],
.duo-inline-feedback[hidden],
.reveal-button[hidden],
.answer-panel[hidden],
.duo-answer-bonus-pill[hidden] {
  display: none !important;
}

.duo-quiz-box {
  width: 100% !important;
  max-width: 620px !important;
  margin: 10px auto 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.duo-coach-prompt {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
}

.duo-coach-avatar {
  display: none !important;
}

.duo-speech-bubble {
  position: relative !important;
  background: transparent !important;
  border: 0 !important;
  padding: 2px 8px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  box-shadow: none !important;
}

.duo-speech-bubble::before {
  display: none !important;
}

.duo-choice-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
}

.duo-choice-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: 100% !important;
  min-height: 52px !important;
  padding: 10px 16px !important;
  border-radius: 14px !important;
  font-size: 0.96rem !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: transform 110ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease !important;
}

.duo-choice-text {
  flex: 1 1 auto !important;
}

.duo-key-badge {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  flex-shrink: 0 !important;
}

.duo-choice-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-family: "JetBrains Mono", "AK Thai", monospace !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  flex-shrink: 0 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1px solid rgba(16, 185, 129, 0.38) !important;
  color: #34d399 !important;
}

.duo-choice-btn.is-correct {
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%) !important;
  border: 2px solid #16a34a !important;
  border-bottom: 4px solid #15803d !important;
  color: #052e16 !important;
}

.duo-choice-btn.is-correct .duo-key-badge {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.duo-choice-btn.is-correct .duo-choice-tag {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.duo-choice-btn.is-wrong {
  background: linear-gradient(180deg, #ffe4e6 0%, #fecdd3 100%) !important;
  border: 2px solid #ef4444 !important;
  border-bottom: 4px solid #b91c1c !important;
  color: #450a0a !important;
  opacity: 0.88 !important;
}

.duo-choice-btn.is-wrong .duo-key-badge {
  background: #ef4444 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.duo-choice-btn.is-wrong .duo-choice-tag {
  background: #ef4444 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.duo-answer-bonus-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  background: rgba(16, 185, 129, 0.16) !important;
  border: 1.5px solid #10b981 !important;
  color: #065f46 !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
}

html:not([data-theme="light"])[data-card-palette="graphite"] .duo-answer-bonus-pill,
html:not([data-theme="light"])[data-card-palette="graphite-sand"] .duo-answer-bonus-pill {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #34d399 !important;
  color: #6ee7b7 !important;
}

/* 4c. Refined Color Pairing Options:
   - C1 ([data-card-palette="sand"]): Center Flashcard = Warm Ivory-Sand (#f6f0e4 → #ebe1cf) × HUD/Sidebar = Obsidian Graphite (#21242b) + Emerald CTA & Cobalt Keycaps
   - C2 ([data-card-palette="sand-all"]): All Cards = Warm Ivory-Sand (#f6f0e4 → #ebe1cf) × White Porcelain Choices + Cobalt Keycaps + Emerald CTA
   - D1 ([data-card-palette="graphite-sand"]): Outer Cards = Obsidian Graphite (#21242b) × Inner Choice Buttons = Warm Ivory-Sand (#f5efe3)
   - D2 ([data-card-palette="graphite"]): Pure Obsidian Graphite Studio (#21242b) × Pearl-Graphite Choices & Gold Keycaps */

/* Shared Warm Ivory-Sand Surface & Typography for C1 (.citation-slip + stage cards) and C2 (all cards) */
html:not([data-theme="light"])[data-card-palette="sand"] :is(
  .citation-slip,
  .phrasal-card,
  .speaking-card,
  .shadowing-card,
  .grammar-card,
  .writing-card,
  .library-stage-box,
  .capture-stage-box,
  .duo-wordbank-card,
  .system-state
),
html:not([data-theme="light"])[data-card-palette="sand-all"] :is(
  .player-hud,
  .session-ledger,
  .citation-slip,
  .phrasal-card,
  .speaking-card,
  .shadowing-card,
  .grammar-card,
  .writing-card,
  .library-stage-box,
  .capture-stage-box,
  .duo-wordbank-card,
  .system-state
) {
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.55), transparent 52%), linear-gradient(165deg, #f6f0e4 0%, #ebe1cf 100%) !important;
  border: 2px solid #c4a672 !important;
  border-bottom: 5px solid #785f37 !important;
  color: #161922 !important;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 #ffffff !important;
}

/* Primary Ink on Warm Ivory-Sand Cards */
html:not([data-theme="light"])[data-card-palette="sand-all"] :is(
  .player-hud strong,
  .player-hud .hud-stat strong,
  .player-hud .hud-goal-head strong
),
html:not([data-theme="light"])[data-card-palette="sand-all"] #vocabApp :is(
  .session-ledger h2,
  .ledger-line dd,
  .pixel-speech-bubble
),
html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) #vocabApp :is(
  .review-word,
  .speaking-card-title,
  .grammar-card-title,
  .writing-card-title,
  .library-term h3,
  .phrasal-card-title,
  .duo-wb-prompt-th,
  .capture-stage-box h2,
  .capture-stage-box h3,
  .shadowing-en-text,
  .system-state h2,
  .system-state h3,
  .settings-panel summary,
  .phrasal-formula-tag .verb-part,
  .blind-title
) {
  color: #141824 !important;
  text-shadow: none !important;
}

/* Secondary Copy & IPA on Warm Ivory-Sand Cards */
html:not([data-theme="light"])[data-card-palette="sand-all"] :is(
  .player-hud .hud-stat small,
  .player-hud .hud-stat span,
  .player-hud .hud-goal > div:first-child,
  .player-hud .hud-goal span,
  .player-hud .hud-goal-head span
),
html:not([data-theme="light"])[data-card-palette="sand-all"] #vocabApp :is(
  .quest-copy,
  .ledger-line dt,
  .ledger-note,
  .policy-note p
),
html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) #vocabApp :is(
  .definition-en,
  .example-en,
  .example-th,
  .usage-note,
  .phrasal-meaning-en,
  .phrasal-example-en,
  .phrasal-example-th,
  .phrasal-tip,
  .particle-logic-text,
  .speaking-card-summary,
  .speaking-card-title-th,
  .speaking-box-text,
  .speaking-openers-list li,
  .grammar-card-sub,
  .grammar-card-desc,
  .writing-card-sub,
  .writing-card-objective,
  .writing-phrases-list li,
  .library-definition .entry-definition,
  .library-definition .entry-example,
  .shadowing-th-text,
  .shadowing-tips-list li,
  .duo-wb-grammar-hint,
  .duo-wb-progress,
  .flow-list li,
  .queue-empty-hint,
  .slip-head,
  .review-ipa,
  .phrasal-ipa,
  .proof-note,
  .shadowing-ipa-text,
  .shadowing-cadence-note,
  .grammar-card-time,
  .grammar-cat-badge,
  .slip-position,
  .prompt-kicker,
  .pronunciation-row,
  .pronunciation-row span,
  .duo-speech-bubble
) {
  color: #334155 !important;
  text-shadow: none !important;
}

/* Accent Kickers, Badges & Buttons on Warm Ivory-Sand Cards (True Color Pairing: Cobalt + Emerald + Amber) */
html:not([data-theme="light"])[data-card-palette="sand-all"] #vocabApp :is(
  .quest-kicker,
  .text-action,
  .session-vitals strong
),
html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) #vocabApp :is(
  .sheet-kicker,
  .challenge-label,
  .sense-number
) {
  color: #9a3412 !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) :is(
  .answer-panel h3,
  .definition-th,
  .phrasal-meaning-th,
  .library-definition .entry-thai
) {
  color: #065f46 !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) :is(
  .part-of-speech,
  .speaking-card-badge,
  .speaking-box-label,
  .entry-meta
) {
  color: #1d4ed8 !important;
  border-left-color: #2563eb !important;
}

/* Audio Speaker Button on Warm Ivory-Sand: Crisp Sky-Cobalt 3D Button (Not muddy brown/green!) */
html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) :is(.pronounce-button, #pronounceButton, .library-audio-btn) {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
  border: 1.5px solid #3b82f6 !important;
  border-bottom: 3.5px solid #1d4ed8 !important;
  color: #1e3a8a !important;
}

/* Primary Reveal Button on Warm Ivory-Sand: Vibrant Duolingo Emerald-Jade 3D CTA (#16a34a → #15803d)
   Eliminates yellow-on-yellow mush and creates an instant focal point! */
html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) .reveal-button {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%) !important;
  border: 2px solid #22c55e !important;
  border-bottom: 5px solid #14532d !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) .reveal-button :is(span, small) {
  color: #ffffff !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) .reveal-button:hover {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%) !important;
  transform: translateY(-1px) !important;
}

/* Porcelain White 3D Choice Cards + Cobalt Indigo Keycaps [1][2][3] on Warm Ivory-Sand AND on D1 (graphite-sand) */
html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) :is(
  .duo-choice-btn,
  .duo-word-tile
):not(.is-correct):not(.is-wrong):not(.in-tray):not(.is-ghost) {
  background: #ffffff !important;
  color: #141824 !important;
  border: 2px solid #cbbba0 !important;
  border-bottom: 4px solid #968260 !important;
  box-shadow: 0 4px 10px rgba(20, 24, 36, 0.05) !important;
}

html:not([data-theme="light"])[data-card-palette="graphite-sand"] :is(
  .duo-choice-btn,
  .duo-word-tile
):not(.is-correct):not(.is-wrong):not(.in-tray):not(.is-ghost) {
  background: linear-gradient(180deg, #f7f2e7 0%, #ece2d0 100%) !important;
  color: #141824 !important;
  border: 2px solid #c4a672 !important;
  border-bottom: 4px solid #785f37 !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"], [data-card-palette="graphite-sand"]) :is(
  .duo-choice-btn,
  .duo-word-tile
):hover:not(:disabled):not(.is-correct):not(.is-wrong):not(.is-ghost) {
  background: #f0f9ff !important;
  border-color: #38bdf8 !important;
  border-bottom-color: #0284c7 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"], [data-card-palette="graphite-sand"]) .duo-choice-btn:not(.is-correct):not(.is-wrong) .duo-key-badge {
  background: #dbeafe !important;
  border: 1.5px solid #60a5fa !important;
  color: #1e3a8a !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"], [data-card-palette="graphite-sand"]) .duo-choice-btn:not(.is-correct):not(.is-wrong) .duo-choice-tag {
  background: #d1fae5 !important;
  border: 1px solid #34d399 !important;
  color: #065f46 !important;
}

html:not([data-theme="light"])[data-card-palette="sand-all"] .session-vitals span {
  background: rgba(20, 24, 36, 0.07) !important;
  color: #141824 !important;
}

html:not([data-theme="light"])[data-card-palette="sand-all"] :is(
  .pixel-pose-btn,
  .session-ledger .filter-button:not(.active):not([aria-pressed="true"])
) {
  background: #ffffff !important;
  color: #141824 !important;
  border: 1.5px solid #cbbba0 !important;
  border-bottom: 3px solid #968260 !important;
}

html:not([data-theme="light"]):is([data-card-palette="sand"], [data-card-palette="sand-all"]) :is(
  .answer-panel,
  .phrasal-answer-panel,
  .shadowing-sentence-box,
  .library-entry,
  .duo-wb-actions,
  .example-block,
  .phrasal-example-box,
  .usage-note
) {
  border-color: rgba(120, 95, 55, 0.22) !important;
}

html:not([data-theme="light"])[data-card-palette="sand-all"] :is(
  .pixel-companion-stage,
  .policy-note,
  .settings-panel,
  .ledger-list,
  .ledger-line,
  .hud-stat,
  .hud-goal
) {
  border-color: rgba(120, 95, 55, 0.22) !important;
}

/* Live Card Palette Switcher Bar (.vc-palette-switcher) */
.vc-palette-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

html[data-theme="light"] .vc-palette-switcher {
  display: none;
}

.vc-palette-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fde68a;
  margin-right: 4px;
}

.vc-palette-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  min-height: 36px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.vc-palette-btn:hover {
  transform: translateY(-1px);
  border-color: #fbbf24;
}

.vc-palette-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #f7d274 0%, #e5b241 100%) !important;
  border-color: #b45309 !important;
  color: #1b1203 !important;
}

.vc-palette-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}
.vc-palette-dot[data-swatch="sand"] { background: linear-gradient(135deg, #f6f0e4 50%, #21242b 50%); border-color: #c4a672; }
.vc-palette-dot[data-swatch="sand-all"] { background: #f6f0e4; border-color: #16a34a; }
.vc-palette-dot[data-swatch="graphite-sand"] { background: linear-gradient(135deg, #21242b 50%, #f6f0e4 50%); border-color: #94a3b8; }
.vc-palette-dot[data-swatch="graphite"] { background: #21242b; border-color: #94a3b8; }

/* 5. 4-Color Semantic Rating Buttons (Again=Red, Hard=Amber, Good=Green, Easy=Sky Blue)
      ALWAYS COLORED — Never monochrome grey even before Reveal! */
#vocabApp .rating-button,
#vocabApp .rating-button:disabled {
  filter: none !important;
  opacity: 1 !important;
  min-height: 60px !important;
  border-width: 2px !important;
  border-bottom-width: 5px !important;
  border-radius: 16px !important;
}

/* Dark Mode 4-Color Rating Buttons (Both Disabled & Active States) */
html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="again"], .rating-button[data-phrasal-rating="again"]) {
  background: linear-gradient(180deg, #4c1d24 0%, #351318 100%) !important;
  border-color: #f87171 !important;
  border-bottom-color: #991b1b !important;
  color: #fecaca !important;
}
html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="again"], .rating-button[data-phrasal-rating="again"]) :is(strong, span, b) {
  color: #fecaca !important;
}

html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="hard"], .rating-button[data-phrasal-rating="hard"]) {
  background: linear-gradient(180deg, #4a2c11 0%, #331d0a 100%) !important;
  border-color: #fbbf24 !important;
  border-bottom-color: #b45309 !important;
  color: #fde68a !important;
}
html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="hard"], .rating-button[data-phrasal-rating="hard"]) :is(strong, span, b) {
  color: #fde68a !important;
}

html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="good"], .rating-button[data-phrasal-rating="good"], #shadowingCompleteBtn) {
  background: linear-gradient(180deg, #143d29 0%, #0d291b 100%) !important;
  border-color: #4ade80 !important;
  border-bottom-color: #15803d !important;
  color: #bbf7d0 !important;
}
html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="good"], .rating-button[data-phrasal-rating="good"], #shadowingCompleteBtn) :is(strong, span, b) {
  color: #bbf7d0 !important;
}

html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="easy"], .rating-button[data-phrasal-rating="easy"]) {
  background: linear-gradient(180deg, #13354e 0%, #0c2336 100%) !important;
  border-color: #38bdf8 !important;
  border-bottom-color: #0284c7 !important;
  color: #e0f2fe !important;
}
html:not([data-theme="light"]) #vocabApp :is(.rating-button[data-rating="easy"], .rating-button[data-phrasal-rating="easy"]) :is(strong, span, b) {
  color: #e0f2fe !important;
}

/* Light Mode 4-Color Rating Buttons (Both Disabled & Active States) */
html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="again"], .rating-button[data-phrasal-rating="again"]) {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%) !important;
  border-color: #ef4444 !important;
  border-bottom-color: #b91c1c !important;
}
html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="again"], .rating-button[data-phrasal-rating="again"]) :is(strong, span, b) {
  color: #450a0a !important;
}

html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="hard"], .rating-button[data-phrasal-rating="hard"]) {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%) !important;
  border-color: #f59e0b !important;
  border-bottom-color: #b45309 !important;
}
html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="hard"], .rating-button[data-phrasal-rating="hard"]) :is(strong, span, b) {
  color: #431407 !important;
}

html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="good"], .rating-button[data-phrasal-rating="good"], #shadowingCompleteBtn) {
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border-color: #22c55e !important;
  border-bottom-color: #15803d !important;
}
html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="good"], .rating-button[data-phrasal-rating="good"], #shadowingCompleteBtn) :is(strong, span, b) {
  color: #052e16 !important;
}

html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="easy"], .rating-button[data-phrasal-rating="easy"]) {
  background: linear-gradient(180deg, #f0f9ff 0%, #dbeafe 100%) !important;
  border-color: #3b82f6 !important;
  border-bottom-color: #1d4ed8 !important;
}
html[data-theme="light"] #vocabApp :is(.rating-button[data-rating="easy"], .rating-button[data-phrasal-rating="easy"]) :is(strong, span, b) {
  color: #172554 !important;
}

/* 6. Light Mode Clean Daylight Surfaces (Dawn Harbour Sky + Crisp White Cards including .player-hud) */
html[data-theme="light"],
html[data-theme="light"] body {
  background: linear-gradient(180deg, #d6eafb 0%, #eaf2fa 48%, #f5f2eb 100%) !important;
  color: #0f172a !important;
}

html[data-theme="light"] :is(
  .player-hud,
  .session-ledger,
  .citation-slip,
  .phrasal-card,
  .speaking-card,
  .shadowing-card,
  .grammar-card,
  .writing-card,
  .library-stage-box,
  .capture-stage-box,
  .duo-wordbank-card,
  .system-state
) {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 2px solid #cbd5e1 !important;
  border-bottom: 5px solid #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 #ffffff !important;
}
