/* Enhancements specifically for Reading Vocab App while preserving the classic Botanical Bamboo Studio layout */
:root {
  --bg-soft: #eef3e4;
  --bg-card: var(--card-bg, #fdfdf9);
  --card-shadow: 0 6px 22px rgba(35, 58, 30, 0.07);
  --text-ok: #265022;
  --text-err: #b91c1c;
  --accent-subtle: rgba(82, 136, 62, 0.12);
}

[data-theme="dark"] #screen-study .scope-select,
#screen-study .scope-select {
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px !important;
}
header.app-header {
  min-height: 52px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
body:has(#screen-study.active) {
  height: auto !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
main.app-main,
main.app-main:has(#screen-study.active) {
  height: auto !important;
  min-height: calc(100svh - 54px) !important;
  overflow: visible !important;
  justify-content: flex-start !important;
  padding: 6px 8px 12px !important;
}
#screen-study .study-top-bar {
  max-width: 820px !important;
  margin: 0 auto 8px !important;
  gap: 8px;
}
#screen-study .scope-select-wrap {
  flex: 1 1 250px;
  min-width: 220px;
  max-width: 390px;
}

/* Align card & side decks to the top so no empty gap pushes buttons below laptop fold */
#screen-study .study-stage-row {
  align-items: flex-start;
}
.study-center-col {
  flex: 1 1 500px;
  max-width: 780px;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* Full size on tall screens, fluid fit on laptop viewports so Prev/Flip/Next never clip */
#screen-study .fc-scene {
  flex: none !important;
  width: 100% !important;
  max-width: 780px !important;
  min-width: 0 !important;
  height: clamp(340px, calc(100svh - 208px), 700px) !important;
  min-height: 340px !important;
  margin: 0 auto 8px !important;
  user-select: none;
  -webkit-user-select: none;
}
#screen-study .fc-face {
  padding: 18px 30px 14px !important;
}
#screen-study .fc-face-back .fc-meta-top {
  margin-bottom: 4px !important;
}
#screen-study .fc-face-back .fc-pronounce-row {
  margin-bottom: 8px !important;
}
#screen-study .fc-face-back .card-assessment-label {
  margin-bottom: 6px !important;
}
#screen-study .study-controls {
  margin: 2px auto 0 !important;
}
.keyboard-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 5px;
}
@media (max-height: 760px) {
  .keyboard-hint { display: none; }
  header.app-header {
    min-height: 46px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }
  main.app-main,
  main.app-main:has(#screen-study.active) {
    min-height: calc(100svh - 48px) !important;
    padding-top: 4px !important;
    padding-bottom: 8px !important;
  }
  #screen-study .study-top-bar {
    margin: 0 auto 6px !important;
  }
  #screen-study .study-controls {
    margin: 2px auto 0 !important;
  }
  #screen-study .nav-buttons-group button {
    height: 40px !important;
    min-height: 40px !important;
    padding: 6px 14px !important;
  }
  #screen-study .fc-center-front { padding: 8px 0 !important; }
  #screen-study .fc-word { margin-bottom: 10px !important; }
  #screen-study .fc-flip-prompt { padding: 8px 14px !important; }
  #screen-study .fc-scene {
    height: clamp(340px, calc(100svh - 172px), 580px) !important;
  }
  body:has(#task-study-bar[style*="flex"]) #screen-study .fc-scene {
    height: clamp(320px, calc(100svh - 196px), 540px) !important;
  }
}
@media (min-width: 1200px) {
  html:has(#screen-study.active),
  body:has(#screen-study.active) {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    scrollbar-width: none;
  }
  body:has(#screen-study.active)::-webkit-scrollbar {
    display: none;
  }
  body:has(#screen-study.active) > header.app-header {
    flex: 0 0 auto;
  }
  main.app-main:has(#screen-study.active) {
    flex: 1 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 8px 6px !important;
  }
  body:has(#task-study-bar[style*="flex"]) #screen-study .fc-scene {
    height: clamp(320px, calc(100svh - 232px), 650px) !important;
  }
}
.btn-deck-tool.is-active {
  background: #2f6b32 !important;
  border-color: #2f6b32 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .btn-deck-tool.is-active {
  background: #52883e !important;
  border-color: #82b36e !important;
  color: #ffffff !important;
}
#screen-study .fc-flip-prompt {
  background: transparent !important;
  border: none !important;
  padding: 6px 0 0 !important;
  color: var(--text-muted) !important;
  opacity: 0.78;
  font-size: 12px !important;
  font-weight: 550 !important;
}

/* Front Face Typography */
#screen-study #fc-front-word {
  font-size: clamp(64px, 6.4vw, 84px) !important;
  font-weight: 850 !important;
  letter-spacing: -1.2px !important;
  overflow-wrap: break-word;
}
#screen-study #fc-front-word.is-long-word {
  font-size: clamp(44px, 4.8vw, 62px) !important;
}
#screen-study .fc-face-front .fc-pos {
  font-size: 15px !important;
  padding: 6px 15px !important;
}
#screen-study .fc-face-front .fc-ipa-badge {
  font-size: 19px !important;
  padding: 6px 16px !important;
}
#screen-study .fc-face-front .btn-voice-speak {
  font-size: 15.5px !important;
  padding: 6px 15px !important;
}
#screen-study .fc-flip-prompt {
  font-size: 15px !important;
}

/* Redesigned Card Back: Balanced 2-Corner Meta Row + Word-Left / Pronunciation-Right Row */
.fc-back-header-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.16);
  flex-shrink: 0;
}
.fc-back-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.fc-back-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}
#screen-study #fc-back-word {
  font-size: 30px !important;
  font-weight: 850 !important;
  margin: 0 !important;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.fc-back-header-bar .fc-pronounce-row {
  margin: 0 0 0 auto !important;
  gap: 6px;
}
.fc-back-header-bar .fc-ipa-badge {
  font-size: 15.5px !important;
  padding: 3.5px 10px !important;
}
.fc-back-header-bar .btn-voice-speak {
  font-size: 13px !important;
  padding: 3.5px 9px !important;
}
.fc-back-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
#screen-study #fc-back-pos {
  font-size: 12.5px !important;
  padding: 4px 10px !important;
}
.btn-reading-tip {
  padding: 4.5px 11px;
  border-radius: 9999px;
  border: 1.5px solid #52883e;
  background: rgba(82, 136, 62, 0.12);
  color: #265022;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-reading-tip:hover {
  background: #2f6b32;
  border-color: #2f6b32;
  color: #ffffff;
}
[data-theme="dark"] .btn-reading-tip {
  border-color: #90c276;
  background: rgba(144, 194, 118, 0.14);
  color: #d9f0cb;
}
[data-theme="dark"] .btn-reading-tip:hover {
  background: #90c276;
  color: #111c12;
}

.fc-back-body-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 2px 0;
}
#screen-study .fc-back-meaning {
  font-size: clamp(30px, 3.1vw, 37px) !important;
  line-height: 1.18 !important;
  font-weight: 850 !important;
  margin: 0 !important;
  text-align: left;
  color: #164e23 !important;
}
[data-theme="dark"] #screen-study .fc-back-meaning {
  color: #f3d27a !important;
}

.fc-pairs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}
.fc-pairs-grid.single-col {
  grid-template-columns: 1fr;
}
.fc-pair-card {
  border-radius: 14px;
  padding: 10px 14px;
  background: #eef6e7;
  border: 1px solid #c3dbb0;
}
.fc-pair-card.trap {
  background: #fdf2f2;
  border-color: #efcaca;
}
[data-theme="dark"] .fc-pair-card {
  background: rgba(144, 194, 118, 0.09);
  border-color: rgba(144, 194, 118, 0.24);
}
[data-theme="dark"] .fc-pair-card.trap {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}
.fc-pair-label {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 7px;
  color: #1f4722;
  opacity: 0.85;
}
.fc-pair-card.trap .fc-pair-label {
  color: #8c1d1d;
}
[data-theme="dark"] .fc-pair-label {
  color: #d9f0cb;
}
[data-theme="dark"] .fc-pair-card.trap .fc-pair-label {
  color: #fecaca;
}
.fc-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-chip {
  font-size: 14px;
  font-weight: 650;
  padding: 3px 9.5px;
  border-radius: 7px;
  background: #ffffff;
  color: #1f4722;
}
#screen-study .fc-pair-card .fc-chip {
  font-size: 19.5px !important;
  font-weight: 750;
  padding: 4.5px 12px;
  border-radius: 10px;
}
.fc-pair-card.trap .fc-chip {
  background: #ffffff;
  color: #8c1d1d;
}
[data-theme="dark"] .fc-chip {
  background: rgba(144, 194, 118, 0.16);
  color: #e4f7d3;
}
[data-theme="dark"] .fc-pair-card.trap .fc-chip {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

#screen-study #fc-front-sentence {
  max-width: 680px !important;
  font-size: 21.5px !important;
  line-height: 1.44 !important;
  padding: 12px 20px !important;
  margin: 12px auto 0 !important;
  border: 1px solid #dce8ce !important;
  border-left: 2.5px solid #52883e !important;
  border-right: 2.5px solid #52883e !important;
  border-radius: 12px !important;
  background: rgba(82, 136, 62, 0.06) !important;
  text-align: justify !important;
  text-align-last: left !important;
}
[data-theme="dark"] #screen-study #fc-front-sentence {
  border-color: #324237 !important;
  border-left: 2.5px solid #90c276 !important;
  border-right: 2.5px solid #90c276 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #d7e7d2 !important;
}
#screen-study #fc-back-sentence {
  font-size: 21.5px !important;
  line-height: 1.42 !important;
  padding: 10px 15px !important;
  margin: 0 !important;
  border: none !important;
  border-left: 4px solid #52883e !important;
  border-radius: 0 12px 12px 0 !important;
  background: rgba(82, 136, 62, 0.06) !important;
  text-align: justify !important;
  text-align-last: left !important;
}
[data-theme="dark"] #screen-study #fc-back-sentence {
  border-left-color: #90c276 !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: #d7e7d2 !important;
}
#screen-study .assessment-row {
  padding-top: 10px !important;
  border-top: 1px solid rgba(128, 128, 128, 0.16);
}
#screen-study .btn-assess {
  font-size: 16.5px !important;
  font-weight: 800 !important;
}
@media (max-height: 720px) {
  #screen-study .fc-face { padding: 9px 20px 7px !important; }
  #screen-study .fc-back-scrollable { margin-bottom: 2px !important; }
  .fc-back-header-bar { gap: 3px; padding-bottom: 4px; }
  #screen-study #fc-back-word { font-size: 28px !important; }
  .fc-back-body-stack { gap: 5px; padding: 1px 0; }
  #screen-study .fc-back-meaning { font-size: 28px !important; line-height: 1.15 !important; }
  .fc-pair-card { padding: 6px 12px; }
  .fc-pair-label { font-size: 13.5px; margin-bottom: 4px; }
  #screen-study .fc-pair-card .fc-chip { font-size: 18px !important; padding: 3.5px 11px; }
  #screen-study #fc-front-sentence { font-size: 19.5px !important; line-height: 1.38 !important; padding: 9px 16px !important; margin-top: 8px !important; }
  #screen-study #fc-back-sentence { font-size: 19.5px !important; line-height: 1.36 !important; padding: 6px 12px !important; }
  #screen-study .assessment-row { padding-top: 5px !important; }
  #screen-study .btn-assess { min-height: 34px !important; padding: 4px 10px !important; font-size: 14.5px !important; }
}

/* READING TIP Focus Flashcard Overlay */
.tip-focus-overlay {
  backdrop-filter: blur(6px);
  background: rgba(10, 16, 11, 0.72) !important;
}
.tip-focus-card {
  max-width: 1060px !important;
  width: 94vw !important;
  max-height: 95vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 24px !important;
  border: 2px solid #8fad6c !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden;
}
#tip-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.tip-two-cols {
  display: grid;
  grid-template-columns: 1fr 1.04fr;
  gap: 16px;
  align-items: stretch;
}
.tip-col-left,
.tip-col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(128, 128, 128, 0.035);
  border: 1px solid rgba(128, 128, 128, 0.14);
}
[data-theme="dark"] .tip-col-left,
[data-theme="dark"] .tip-col-right {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.08);
}
.tip-col-heading {
  display: flex;
  align-items: center;
  min-height: 28px;
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.16);
}
.tip-exam-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tip-qa-block {
  border-radius: 13px;
  padding: 13px 15px;
  background: rgba(128, 128, 128, 0.055);
  border: 1px solid rgba(128, 128, 128, 0.2);
  margin-bottom: 0;
}
.tip-qa-block.passage {
  background: rgba(82, 136, 62, 0.075);
  border-color: rgba(82, 136, 62, 0.26);
  border-left: 3.5px solid #2f6b32;
}
.tip-two-cols .tip-qa-block.passage {
  flex: 1 0 auto;
}
.tip-two-cols .tip-kw-box,
.tip-two-cols .tip-section {
  margin-bottom: 0;
}
[data-theme="dark"] .tip-qa-block.passage {
  border-left-color: #90c276;
}
.tip-qa-label {
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 6px;
}
.tip-qa-en {
  font-size: 16px;
  line-height: 1.58;
  color: var(--text-bright);
  font-weight: 500;
}
.tip-qa-vi {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(128, 128, 128, 0.26);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.tip-kw-box {
  border-radius: 13px;
  padding: 13px 15px;
  background: rgba(82, 136, 62, 0.065);
  border: 1px solid rgba(82, 136, 62, 0.24);
  margin-bottom: 11px;
}
.tip-kw-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 9px;
  align-items: stretch;
  margin-top: 8px;
}
.tip-kw-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 11px 13px;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid rgba(82, 136, 62, 0.22);
}
[data-theme="dark"] .tip-kw-col {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(144, 194, 118, 0.22);
}
.tip-kw-col-head {
  font-size: 11.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tip-kw-main {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.3;
}
.tip-kw-alts {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tip-kw-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 850;
  color: var(--accent);
  text-align: center;
  padding: 0 2px;
}
.fc-chip.trap {
  background: rgba(239, 68, 68, 0.14);
  color: #8c1d1d;
}
[data-theme="dark"] .fc-chip.trap {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}
@media (max-width: 780px) {
  .tip-two-cols {
    grid-template-columns: 1fr;
  }
  .tip-kw-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .tip-kw-arrow {
    transform: rotate(90deg);
  }
}
[data-theme="dark"] .tip-focus-card {
  background: #1a251c !important;
  border-color: #4a684b !important;
}
.tip-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #2f6b32;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  margin-right: 8px;
}
[data-theme="dark"] .tip-pill {
  background: #90c276;
  color: #111c12;
}
.tip-core-line {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 3px;
}
.tip-sub-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.16);
}
.tip-answer-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  margin-right: 6px;
}
[data-theme="dark"] .tip-answer-badge {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
}
.tip-section {
  border-radius: 12px;
  padding: 12px 15px;
  margin-bottom: 10px;
  background: rgba(82, 136, 62, 0.08);
  border: 1px solid rgba(82, 136, 62, 0.22);
}
.tip-section.trap {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}
.tip-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 7px;
}
.tip-section.trap .tip-section-title {
  color: #f87171;
}
[data-theme="light"] .tip-section.trap .tip-section-title {
  color: #b91c1c;
}
.tip-bullets {
  list-style: none;
  display: grid;
  gap: 7px;
}
.tip-bullets li {
  position: relative;
  padding-left: 14px;
  font-size: 15.5px;
  line-height: 1.54;
  color: var(--text);
}
.tip-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}
.tip-section.trap .tip-bullets li::before {
  color: #f87171;
}
.tip-bullets code {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 750;
  background: rgba(144, 194, 118, 0.18);
  color: var(--text-bright);
  padding: 1px 5px;
  border-radius: 4px;
}
.tip-section.trap .tip-bullets code {
  background: rgba(239, 68, 68, 0.15);
}
.tip-focus-card .fc-sentence-box {
  border: none !important;
  border-left: 3px solid #90c276 !important;
  border-radius: 0 10px 10px 0 !important;
  background: rgba(82, 136, 62, 0.08) !important;
  padding: 9px 14px !important;
  font-size: 13.5px !important;
  line-height: 1.55 !important;
}
.tip-focus-card .fc-target-mark {
  background: rgba(144, 194, 118, 0.28) !important;
  color: var(--text-bright) !important;
  padding: 0 4px !important;
  border-radius: 4px !important;
  font-weight: 750 !important;
}
.tip-sub-example {
  margin-top: 4px;
  padding-left: 10px;
  border-left: 2px solid rgba(82, 136, 62, 0.35);
  font-size: 14px;
  line-height: 1.48;
  color: var(--text-muted);
}
[data-theme="dark"] .tip-sub-example {
  border-left-color: rgba(144, 194, 118, 0.45);
  color: #b7cbbd;
}
/* Recall Typing Check Modal (Đã thuộc verification) */
.recall-overlay {
  backdrop-filter: blur(22px);
  background: rgba(10, 15, 11, 0.95) !important;
}
.recall-check-card {
  max-width: 680px !important;
  width: 94vw !important;
  border-radius: 24px !important;
  border: 2px solid #8fad6c !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5) !important;
  user-select: none;
  -webkit-user-select: none;
}
.recall-check-card .modal-header {
  padding: 18px 26px 14px;
}
.recall-check-card .modal-body {
  padding: 20px 26px 24px !important;
}
.recall-check-card .tip-pill,
.recall-check-card .recall-stage-pill,
.recall-check-card .recall-timer-badge {
  font-size: 13.5px;
  padding: 5px 13px;
}
[data-theme="dark"] .recall-check-card {
  background: #1b211e !important;
  border-color: #46664e !important;
}
.recall-hint-box {
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(82, 136, 62, 0.08);
  border: 1px solid rgba(82, 136, 62, 0.24);
  margin-bottom: 16px;
  text-align: center;
}
.recall-stage-word {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.3;
}
.recall-stage-sub {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.recall-stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(82, 136, 62, 0.14);
  color: #265022;
  border: 1px solid rgba(82, 136, 62, 0.35);
}
[data-theme="dark"] .recall-stage-pill {
  background: #24372a;
  color: #c5e6ce;
  border-color: #466950;
}
.recall-syn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.recall-syn-opt {
  width: 100%;
  padding: 15px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-bright);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.recall-syn-opt:hover:not(:disabled) {
  border-color: #6b965d;
  background: rgba(82, 136, 62, 0.08);
}
.recall-syn-opt.is-selected {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.18);
  color: #164e23;
  box-shadow: inset 0 0 0 1px #2f6b32;
}
[data-theme="dark"] .recall-syn-opt.is-selected {
  border-color: #82b892;
  background: rgba(130, 184, 146, 0.22);
  color: #e4f7ea;
  box-shadow: inset 0 0 0 1px #82b892;
}
.recall-syn-opt.is-right {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.22);
  color: #164e23;
}
[data-theme="dark"] .recall-syn-opt.is-right {
  border-color: #82b892;
  background: rgba(130, 184, 146, 0.25);
  color: #d7f2df;
}
.recall-syn-opt.is-missed {
  border: 1.5px dashed #2f6b32;
  background: rgba(82, 136, 62, 0.10);
  color: #1f5a26;
}
[data-theme="dark"] .recall-syn-opt.is-missed {
  border-color: #82b892;
  background: rgba(130, 184, 146, 0.14);
  color: #bfe8cb;
}
.recall-syn-opt.is-wrong {
  border-color: #dc2626;
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}
[data-theme="dark"] .recall-syn-opt.is-wrong {
  color: #fecaca;
}
.recall-syn-opt:disabled {
  cursor: default;
}
.recall-word-input {
  width: 100%;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1.5px solid var(--card-border);
  background: rgba(82, 136, 62, 0.06);
  color: var(--text-bright);
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 1px;
  outline: none;
  margin-bottom: 12px;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.recall-word-input::placeholder {
  letter-spacing: 8px;
  opacity: 0.65;
}
.recall-word-input:focus {
  border-color: #2f6b32;
  background: var(--card-bg);
}
[data-theme="dark"] .recall-word-input {
  background: rgba(130, 184, 146, 0.07);
}
[data-theme="dark"] .recall-word-input:focus {
  border-color: #82b892;
  background: var(--card-bg);
}
.recall-feedback {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
  margin-bottom: 14px;
}
.recall-feedback.err {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}
[data-theme="dark"] .recall-feedback.err {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}
.recall-feedback.ok {
  background: rgba(82, 136, 62, 0.14);
  border: 1px solid rgba(82, 136, 62, 0.35);
  color: #164e23;
}
[data-theme="dark"] .recall-feedback.ok {
  background: rgba(130, 184, 146, 0.2);
  color: #d7f2df;
}
.recall-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.recall-timer-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(82, 136, 62, 0.14);
  color: #265022;
  border: 1px solid rgba(82, 136, 62, 0.35);
}
.recall-timer-badge.is-urgent {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.38);
}
[data-theme="dark"] .recall-timer-badge {
  background: #24372a;
  color: #c5e6ce;
  border-color: #466950;
}
[data-theme="dark"] .recall-timer-badge.is-urgent {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
}
@keyframes recallSpeedPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.48);
  }
  45% {
    transform: scale(1.24);
    box-shadow: 0 0 0 7px rgba(220, 38, 38, 0);
  }
}
.recall-timer-badge.is-speed-pulse {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  animation: recallSpeedPulse 0.62s ease-in-out infinite;
  will-change: transform;
}
.recall-speed-bar-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.16);
  overflow: hidden;
  margin-bottom: 12px;
}
.recall-speed-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3f8c4f 0%, #5cb85c 100%);
  transition: width 65ms linear, background-color 180ms ease;
}
.recall-speed-bar-fill.is-warn {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}
.recall-speed-bar-fill.is-danger {
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}
@media (prefers-reduced-motion: reduce) {
  .recall-timer-badge.is-speed-pulse {
    animation: none;
  }
}
#btn-assess-3:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
/* Word List Modal Polish */
#modal-word-list .modal-card {
  max-width: 680px !important;
  width: 94vw !important;
}
#modal-word-list .wl-filter-bar .btn-subtle {
  padding: 6px 13px;
  border-radius: 9px;
  border: 1px solid var(--card-border);
  font-weight: 650;
  font-size: 13.5px;
  background: transparent;
  color: var(--text-muted);
}
#modal-word-list .wl-filter-bar .btn-subtle.active {
  background: #2f6b32;
  border-color: #2f6b32;
  color: #ffffff;
}
[data-theme="dark"] #modal-word-list .wl-filter-bar .btn-subtle.active {
  background: #52883e;
  border-color: #7eb26b;
  color: #ffffff;
}
#modal-word-list .word-list-item {
  display: grid !important;
  grid-template-columns: minmax(150px, 190px) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
}
#modal-word-list .word-list-word {
  font-size: 15.5px;
  font-weight: 750;
  color: var(--text-bright);
}
#modal-word-list .word-list-meaning {
  font-size: 14.5px;
  margin-left: 0 !important;
  color: var(--text);
  line-height: 1.4;
}
#modal-word-list .wl-status-cell {
  justify-self: end;
  white-space: nowrap;
}
@media (max-width: 560px) {
  #modal-word-list .word-list-item {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
  }
  #modal-word-list .word-list-meaning {
    grid-column: 1 / -1;
  }
}
.tip-quiz-opt.is-wrong {
  background: #fdebec !important;
  border-color: #c2414c !important;
  color: #8c1d1d !important;
}
[data-theme="dark"] .tip-quiz-opt.is-wrong {
  background: #3a2326 !important;
  border-color: #b85c65 !important;
  color: #f6ced2 !important;
}
.tip-quiz-feedback {
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
}
.tip-quiz-feedback.ok {
  background: rgba(47, 107, 50, 0.14);
  color: #1b5e20;
}
[data-theme="dark"] .tip-quiz-feedback.ok {
  background: rgba(99, 168, 119, 0.18);
  color: #b7ebca;
}
.tip-quiz-feedback.err {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}
[data-theme="dark"] .tip-quiz-feedback.err {
  background: rgba(239, 68, 68, 0.18);
  color: #f8c7cb;
}
.tip-practice-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(128, 128, 128, 0.18);
}
.board-item.is-me {
  background: #eef6e7 !important;
  border: 1.5px dashed #7ba662 !important;
  font-weight: 750;
}
[data-theme="dark"] .board-item.is-me {
  background: #212c25 !important;
  border: 1.5px dashed #4a6b54 !important;
}
.board-item.is-me .board-rank,
.board-item.is-me .board-score {
  color: #2f6b32 !important;
  font-weight: 850;
}
[data-theme="dark"] .board-item.is-me .board-rank,
[data-theme="dark"] .board-item.is-me .board-score {
  color: #8cc49b !important;
}

@media (max-width: 640px) {
  .fc-pairs-grid {
    grid-template-columns: 1fr;
  }
}

/* Balanced Left & Right Study Decks (Restored original 296px proportions to match center card) */
.study-deck .panda-mascot-avatar {
  width: 60px !important;
  height: 60px !important;
  border-radius: 15px !important;
  background: #f4f7ef !important;
  border: 1.5px solid var(--card-border) !important;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(47, 107, 50, 0.10);
}
.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: cover;
  background: #faf7f0;
  border: 1.5px solid var(--card-border);
  box-shadow: 0 2px 6px rgba(24, 48, 28, 0.10);
}
.hdr-btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.app-header .btn-icon-glass {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.study-deck .widget-header {
  gap: 8px !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  padding-bottom: 7px !important;
}
.study-deck .widget-title-group {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.study-deck .widget-title {
  font-size: 14.5px !important;
  line-height: 1.18 !important;
  white-space: normal !important;
  overflow-wrap: break-word;
}
.study-deck .widget-subtitle {
  font-size: 13px !important;
  line-height: 1.25 !important;
  margin-top: 2px !important;
  white-space: normal !important;
}
.study-deck .streak-badge {
  font-size: 12px !important;
  padding: 3px 7px !important;
  border-radius: 10px !important;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Streak Chart (Tuần / Tháng / Năm) inside #widget-study-streak */
.streak-chart-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px;
  border-radius: 8px;
  margin-bottom: 8px;
}
[data-theme="dark"] .streak-chart-tabs {
  background: rgba(255, 255, 255, 0.05);
}
.streak-chart-area {
  margin-bottom: 7px;
}
/* Symmetrical, generous Left & Right decks (~500-555px matching center Flashcard height) */
@media (min-width: 1200px) {
  #screen-study .study-stage-row {
    align-items: flex-start !important;
    max-width: 1432px !important;
    gap: 12px !important;
  }
  #screen-study .study-deck {
    width: 304px !important;
  }
  #screen-study .study-deck-left,
  #screen-study .study-deck-right {
    gap: 9px !important;
  }
  #screen-study .study-deck-left .deck-widget,
  #screen-study .study-deck-right .deck-widget {
    padding: 8px 10px !important;
  }
  #screen-study .study-deck .widget-header {
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
  }
  #screen-study .timer-display-box {
    padding: 7px 12px !important;
    margin-bottom: 7px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  #screen-study .timer-digits {
    font-size: 29px !important;
  }
  #screen-study .timer-status-text {
    font-size: 13.5px !important;
    margin-top: 0 !important;
    text-align: right;
  }
  #screen-study .timer-presets {
    margin-bottom: 6px !important;
  }
  #screen-study .btn-timer-ctrl {
    padding: 6px 11px !important;
    font-size: 14px !important;
  }
  #screen-study .board-list {
    gap: 5px !important;
  }
  #screen-study .board-item,
  #screen-study .board-user-card {
    padding: 5.5px 9.5px !important;
    font-size: 14.5px !important;
  }
  #screen-study .board-info {
    display: flex !important;
    align-items: baseline;
    gap: 6px;
  }
  #screen-study .board-meta {
    font-size: 13px !important;
    opacity: 0.84;
  }
  #screen-study .board-user-card {
    margin-top: 6px !important;
  }
  #screen-study .vocab-stats-list {
    gap: 9px !important;
    padding-top: 3px;
  }
}
@media (min-width: 1380px) {
  #screen-study .study-deck {
    width: 312px !important;
  }
}
@media (max-height: 700px) and (min-width: 1200px) {
  .study-deck .panda-mascot-avatar {
    width: 56px !important;
    height: 56px !important;
  }
  #screen-study .study-deck-left .deck-widget,
  #screen-study .study-deck-right .deck-widget {
    padding: 8px 10px !important;
  }
  #screen-study .board-item,
  #screen-study .board-user-card {
    padding: 4px 8px !important;
  }
  #screen-study .streak-bars-row {
    height: 68px !important;
  }
  #screen-study .streak-line-stage {
    height: 54px !important;
  }
  #screen-study .vocab-stats-list {
    gap: 6.5px !important;
  }
}

/* Anki Spaced Repetition Due Queue & Reminder */
.dot-status.due {
  background: #e67e22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}
[data-theme="dark"] .dot-status.due {
  background: #f5b041;
  box-shadow: 0 0 0 3px rgba(245, 176, 65, 0.2);
}
.due-review-row {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed rgba(128, 128, 128, 0.24);
}
.btn-due-quick {
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid #d97706;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-due-quick:hover {
  background: #d97706;
  color: #ffffff;
}
[data-theme="dark"] .btn-due-quick {
  border-color: #d99b38;
  background: rgba(245, 176, 65, 0.16);
  color: #fbd38d;
}
[data-theme="dark"] .btn-due-quick:hover {
  background: #d99b38;
  color: #161b17;
}
.btn-deck-tool.has-due:not(.is-active) {
  border-color: #d97706 !important;
  color: #b45309 !important;
  background: rgba(245, 158, 11, 0.11) !important;
}
[data-theme="dark"] .btn-deck-tool.has-due:not(.is-active) {
  border-color: #b77e28 !important;
  color: #f6cc7f !important;
  background: rgba(245, 176, 65, 0.12) !important;
}
.anki-ivl-tag {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.78;
  margin-left: 2px;
}
.anki-due-reminder {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  max-width: 390px;
  width: calc(100vw - 32px);
  padding: 15px 18px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1.5px solid #d97706;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: slideUpToast 0.22s ease;
}
[data-theme="dark"] .anki-due-reminder {
  background: #1d2420;
  border-color: #c2872c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.anki-due-reminder.visible {
  display: flex;
}
.anki-rem-title {
  font-size: 16px;
  font-weight: 850;
  color: #b45309;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
[data-theme="dark"] .anki-rem-title {
  color: #f6cc7f;
}
.anki-rem-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
.anki-rem-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.streak-bars-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 84px;
  padding: 4px 2px 2px;
}
.streak-bars-row.is-month {
  gap: 2px;
}
.streak-bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
.streak-bar-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(128, 128, 128, 0.08);
  border-radius: 5px;
  overflow: hidden;
}
.streak-bar-fill {
  width: 100%;
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: #9db88b;
  transition: height 0.25s ease;
}
.streak-bar-fill.active {
  background: #466b37;
}
.streak-bar-fill.today {
  background: #2f6b32;
  box-shadow: 0 0 0 1px #8fad6c inset;
}
[data-theme="dark"] .streak-bar-fill {
  background: #304232;
}
[data-theme="dark"] .streak-bar-fill.active {
  background: #6a994e;
}
[data-theme="dark"] .streak-bar-fill.today {
  background: #a2c77d;
}
.streak-bar-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}
.streak-bar-label.is-today {
  color: #2f6b32;
  font-weight: 850;
}
[data-theme="dark"] .streak-bar-label.is-today {
  color: #c5e3a4;
}
.streak-axis-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 650;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 1px;
}
.streak-axis-row.is-year {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  text-align: center;
  padding: 0;
}
.streak-axis-row span.is-today {
  color: #2f6b32;
  font-weight: 850;
}
[data-theme="dark"] .streak-axis-row span.is-today {
  color: #c5e3a4;
}
.streak-line-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 4px 2px 0;
}
.streak-line-stage {
  position: relative;
  width: 100%;
  height: 68px;
}
.streak-line-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.streak-line-grid {
  stroke: rgba(128, 128, 128, 0.2);
  stroke-width: 1;
  stroke-dasharray: 2.5 3.5;
  vector-effect: non-scaling-stroke;
}
.streak-line-base {
  stroke: rgba(128, 128, 128, 0.26);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.streak-line-path {
  fill: none;
  stroke: #466b37;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
[data-theme="dark"] .streak-line-path {
  stroke: #82b892;
}
.streak-dot-pt {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.streak-dot-pt::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.streak-dot-pt:hover::after {
  background: rgba(70, 107, 55, 0.45);
  transform: scale(1.3);
}
.streak-dot-pt.active::after {
  width: 7px;
  height: 7px;
  background: #466b37;
  border: 1.5px solid var(--card-bg);
}
[data-theme="dark"] .streak-dot-pt.active::after {
  background: #7cb685;
}
.streak-dot-pt.today::after {
  width: 9px;
  height: 9px;
  background: #2f6b32;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(47, 107, 50, 0.25);
}
[data-theme="dark"] .streak-dot-pt.today::after {
  background: #b4df93;
  border: 2px solid #1b211e;
  box-shadow: 0 0 0 2px rgba(180, 223, 147, 0.28);
}

/* =========================================================
   EYE-COMFORT MATTE DARK THEME OVERRIDES
   ========================================================= */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131715 !important;
  --bg-soft: #151a18 !important;
  --card-bg: #1b211e !important;
  --bg-card: #1b211e !important;
  --card-solid: #1b211e !important;
  --card-border: #2e3833 !important;
  --card-border-hover: #46584e !important;
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.42) !important;
  --text: #d6dfd9 !important;
  --text-bright: #edf2ee !important;
  --text-muted: #95a39b !important;
  --accent: #82b892 !important;
  --accent-hover: #99cba8 !important;
  --accent-subtle: rgba(130, 184, 146, 0.18) !important;
  --text-ok: #9be2ae !important;
  --text-err: #fecaca !important;
  --success: #4ade80 !important;
  --warning: #fbbf24 !important;
  --danger: #f87171 !important;
  --danger-border: rgba(248, 113, 113, 0.45) !important;
  --dark-overlay-opacity: 0.48;
}

/* Flashcard Front & Back (Loại bỏ neon text glow gây chói/nhòe chữ) */
[data-theme="dark"] #screen-study .fc-face,
[data-theme="dark"] #screen-study .fc-face-front,
[data-theme="dark"] #screen-study .fc-face-back {
  background: #1b211e !important;
  border: 1.5px solid #323e38 !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35) !important;
}
[data-theme="dark"] #screen-study .fc-face:hover {
  border-color: #46584e !important;
}
[data-theme="dark"] #screen-study .fc-word,
[data-theme="dark"] #screen-study #fc-back-word {
  color: #eef3ef !important;
  text-shadow: none !important;
}
[data-theme="dark"] #screen-study .fc-pos {
  background: #252f2a !important;
  border-color: #38463f !important;
  color: #b8d4c1 !important;
}
[data-theme="dark"] .fc-ipa-badge {
  background: #232b27 !important;
  border-color: #36423c !important;
  color: #c7d6cd !important;
}
.btn-voice-speak.btn-accent-choice {
  min-width: 48px;
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 9px;
  border: 1.5px solid rgba(82, 136, 62, 0.35);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}
.btn-voice-speak.btn-accent-choice.active {
  background: #2f6b32 !important;
  border-color: #2f6b32 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .btn-voice-speak {
  background: #252f2a !important;
  border-color: #3a4841 !important;
  color: #d6e4dc !important;
}
[data-theme="dark"] .btn-voice-speak.btn-accent-choice.active {
  background: #52883e !important;
  border-color: #7eb26b !important;
  color: #ffffff !important;
}
[data-theme="dark"] .btn-voice-speak:hover {
  background: #2f3c35 !important;
  border-color: #4c5e54 !important;
}
[data-theme="dark"] .btn-reading-tip {
  background: #24332a !important;
  border-color: #4a6b55 !important;
  color: #c5e3ce !important;
}
[data-theme="dark"] .btn-reading-tip:hover {
  background: #365c41 !important;
  border-color: #487354 !important;
  color: #f0f6f2 !important;
}

/* Flashcard Back Meaning, Chip Cards & Example Sentence */
[data-theme="dark"] #screen-study .fc-back-meaning {
  color: #ebd494 !important;
}
[data-theme="dark"] #screen-study .fc-pair-card {
  background: #222a26 !important;
  border-color: #334039 !important;
}
[data-theme="dark"] #screen-study .fc-pair-label {
  color: #a3c4af !important;
}
[data-theme="dark"] #screen-study .fc-chip,
[data-theme="dark"] .fc-chip {
  background: #2b3530 !important;
  color: #e8f0eb !important;
  border: 1px solid #3c4a43 !important;
}
[data-theme="dark"] #screen-study .fc-pair-card.trap {
  background: #261e20 !important;
  border-color: #453034 !important;
}
[data-theme="dark"] #screen-study .fc-pair-card.trap .fc-pair-label {
  color: #e2a0a6 !important;
}
[data-theme="dark"] #screen-study .fc-pair-card.trap .fc-chip,
[data-theme="dark"] .fc-chip.trap {
  background: #332427 !important;
  color: #f2d5d8 !important;
  border: 1px solid #4f353a !important;
}
[data-theme="dark"] #screen-study #fc-back-sentence,
[data-theme="dark"] #screen-study .fc-sentence-box {
  background: #222925 !important;
  border-color: #313d36 !important;
  border-left: 4px solid #639673 !important;
  color: #d8e2dc !important;
}
[data-theme="dark"] #screen-study .fc-target-mark {
  background: #2d4435 !important;
  border-color: #43654e !important;
  color: #e6f5ea !important;
  padding: 1px 6px !important;
  border-radius: 5px !important;
}

/* Assessment & Navigation Buttons */
[data-theme="dark"] #screen-study .btn-assess-unremembered {
  background: #291e21 !important;
  color: #eebec3 !important;
  border-color: #4a3035 !important;
}
[data-theme="dark"] #screen-study .btn-assess-slow {
  background: #29241b !important;
  color: #ebd398 !important;
  border-color: #4d4028 !important;
}
[data-theme="dark"] #screen-study .btn-assess-mastered {
  background: #1d2b22 !important;
  color: #b7dfc4 !important;
  border-color: #314f3b !important;
}
[data-theme="dark"] #screen-study .btn-assess .kbd-badge {
  background: rgba(0, 0, 0, 0.28) !important;
  color: inherit !important;
}
[data-theme="dark"] #screen-study .nav-buttons-group .btn-flip-action,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover {
  background: #365c41 !important;
  border-color: #487354 !important;
  color: #f0f6f2 !important;
}
[data-theme="dark"] #screen-study .nav-buttons-group .btn-flip-action:hover {
  background: #3e694b !important;
}

/* Left & Right Sidebar Widgets */
[data-theme="dark"] .deck-widget {
  background: #1b211e !important;
  border-color: #2e3833 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] .deck-widget:hover {
  border-color: #415249 !important;
}
[data-theme="dark"] .widget-header {
  border-bottom-color: #29332e !important;
}
[data-theme="dark"] .widget-title {
  color: #e6ede8 !important;
}
[data-theme="dark"] .widget-subtitle,
[data-theme="dark"] .timer-footer-stat,
[data-theme="dark"] .board-meta {
  color: #94a39a !important;
}
[data-theme="dark"] .timer-display-box {
  background: #151a18 !important;
  border-color: #29332e !important;
}
[data-theme="dark"] .timer-digits {
  color: #cfe3d5 !important;
}
[data-theme="dark"] .board-item {
  background: #222925 !important;
}
[data-theme="dark"] .board-score,
[data-theme="dark"] .board-user-card .user-rank,
[data-theme="dark"] .board-user-card .user-score {
  color: #8cc49b !important;
}
[data-theme="dark"] .board-user-card {
  background: #212c25 !important;
  border-color: #384d3f !important;
}
[data-theme="dark"] .board-tab-btn.active {
  background: #29362e !important;
  color: #d2e7d8 !important;
}
[data-theme="dark"] .btn-timer-ctrl {
  background: #242d28 !important;
  border-color: #36453c !important;
  color: #cfe0d5 !important;
}
[data-theme="dark"] .btn-timer-ctrl.primary {
  background: #365c41 !important;
  border-color: #487354 !important;
  color: #f0f6f2 !important;
}
[data-theme="dark"] .streak-badge {
  background: #2b251c !important;
  border-color: #4b402c !important;
  color: #e6ca8a !important;
}
[data-theme="dark"] .streak-bar-fill {
  background: #2b352f !important;
}
[data-theme="dark"] .streak-bar-fill.active {
  background: #4e7d5d !important;
}
[data-theme="dark"] .streak-bar-fill.today {
  background: #6da37e !important;
  box-shadow: none !important;
}
[data-theme="dark"] .streak-bar-label.is-today {
  color: #a9d4b7 !important;
}

/* READING TIP Focus Card (Dịu mắt, rõ từng khối) */
[data-theme="dark"] .tip-focus-card {
  background: #1b211e !important;
  border: 1.5px solid #38493f !important;
}
[data-theme="dark"] .tip-pill {
  background: #365c41 !important;
  color: #f0f6f2 !important;
}
[data-theme="dark"] .tip-col-heading {
  color: #a8d1b4 !important;
  border-bottom-color: #35473c !important;
}
[data-theme="dark"] .tip-qa-block {
  background: #222825 !important;
  border-color: #323c37 !important;
}
[data-theme="dark"] .tip-qa-block.passage {
  background: #202a24 !important;
  border-color: #34493b !important;
  border-left-color: #639673 !important;
}
[data-theme="dark"] .tip-kw-box {
  background: #222925 !important;
  border-color: #334239 !important;
}
[data-theme="dark"] .tip-kw-col {
  background: #29322d !important;
  border-color: #3b4941 !important;
}
[data-theme="dark"] .tip-section {
  background: #212a24 !important;
  border-color: #33443a !important;
}
[data-theme="dark"] .tip-section.trap {
  background: #251e20 !important;
  border-color: #462f33 !important;
}
[data-theme="dark"] .tip-section.trap .tip-section-title,
[data-theme="dark"] .tip-section.trap .tip-bullets li::before {
  color: #e59ba2 !important;
}
[data-theme="dark"] .tip-bullets code {
  background: #2c3630 !important;
  color: #e8f0eb !important;
}
[data-theme="dark"] .tip-section.trap .tip-bullets code {
  background: #362528 !important;
  color: #f4d3d6 !important;
}
[data-theme="dark"] .tip-answer-badge {
  background: #3b262a !important;
  color: #f2cfd2 !important;
}

.fc-front-opt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.tactics-grid {
  display: grid;
  gap: 10px;
}
.tactic-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(82, 136, 62, 0.06);
}
.tactic-card h4 {
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-bright);
}
.tactic-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* Ensure header & top-bar stay compact and aligned with the 1-screen Vocab Studio */
@media (max-width: 1199px) {
  #screen-study .study-top-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  #screen-study .study-top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
@media (max-width: 640px) {
  header.app-header {
    padding: 6px 10px !important;
    flex-wrap: wrap !important;
    gap: 5px 6px !important;
  }
  header.app-header .brand-status-chip {
    display: none;
  }
  header.app-header .brand-logo-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
  }
  header.app-header .brand-title {
    font-size: 0.88rem !important;
    white-space: nowrap;
    gap: 6px !important;
  }
  header.app-header .header-actions {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }
  #btn-teacher-preview,
  #btn-teacher-refresh,
  #btn-open-student-tasks,
  #btn-header-menu {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
    min-height: 30px !important;
  }
  main.app-main {
    padding-top: 6px !important;
  }
  #screen-study .study-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 5px !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
  }
  #screen-study .scope-select-wrap {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #screen-study #study-scope-select {
    padding: 7px 30px 7px 12px !important;
    font-size: 13.5px !important;
    min-height: 36px !important;
  }
  #screen-study .study-top-actions {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #screen-study .study-top-actions::-webkit-scrollbar {
    display: none;
  }
  #screen-study .btn-deck-tool,
  #screen-study .study-progress {
    padding: 5px 10px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  #screen-study #fc-front-word,
  #screen-study #fc-front-word.is-long-word {
    font-size: clamp(30px, 8.8vw, 42px) !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }
}

/* =========================================================
   AUTH LOGIN GATE & USER ACCOUNT CONTROLS
   ========================================================= */
.auth-gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  position: relative;
}
.auth-theme-corner {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 20;
}
.auth-theme-corner .btn-icon-glass,
#btn-header-logout {
  width: auto;
  height: auto;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  white-space: nowrap;
}
.auth-card.auth-split {
  width: 100%;
  max-width: 780px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  box-shadow: 0 22px 54px rgba(24, 48, 28, 0.14);
}
[data-theme="dark"] .auth-card.auth-split {
  background: #18201b;
  border-color: #2f3e35;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.50);
}
.auth-showcase {
  position: relative;
  overflow: hidden;
  padding: 36px 28px;
  background: linear-gradient(155deg, #245728 0%, #17381a 100%);
  color: #f4f9f1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
}
[data-theme="dark"] .auth-showcase {
  background: linear-gradient(155deg, #1f4723 0%, #102413 100%);
}
.auth-showcase-bg {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 227, 140, 0.18) 0%, transparent 70%);
  bottom: -85px;
  left: -70px;
  pointer-events: none;
}
.auth-showcase-bg::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px dashed rgba(167, 227, 140, 0.22);
  border-radius: 50%;
  top: -145px;
  left: 200px;
}
.auth-showcase-panda {
  width: 128px;
  height: 128px;
  border-radius: 22px;
  object-fit: cover;
  background: #faf7f0;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  position: relative;
  z-index: 1;
}
.auth-showcase-pill {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(167, 227, 140, 0.18);
  border: 1px solid rgba(167, 227, 140, 0.34);
  color: #cff5bc;
  position: relative;
  z-index: 1;
}
.auth-showcase-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.auth-showcase-copy {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(238, 247, 234, 0.84);
  margin: 0;
  position: relative;
  z-index: 1;
}
.auth-form-pane {
  padding: 34px 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 720px) {
  .auth-card.auth-split {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
  .auth-showcase {
    padding: 22px 22px 20px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
  }
  .auth-showcase-panda {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }
  .auth-showcase-title { font-size: 20px; }
  .auth-showcase-copy { display: none; }
  .auth-form-pane { padding: 24px 22px 22px; }
}
.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.auth-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--card-border);
}
.auth-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.25;
}
.auth-brand-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
}
.auth-heading {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.auth-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.auth-field {
  margin-bottom: 15px;
}
.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--card-border);
  background: var(--bg);
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 120, 82, 0.18);
}
[data-theme="dark"] .auth-input {
  background: #141916;
  border-color: #34423b;
  color: #eef3ef;
}
[data-theme="dark"] .auth-input:focus {
  border-color: #82b892;
  box-shadow: 0 0 0 3px rgba(130, 184, 146, 0.16);
}
.auth-pass-toggle {
  position: absolute;
  right: 8px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.auth-pass-toggle:hover {
  color: var(--text-bright);
  border-color: var(--card-border-hover);
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
  margin: 4px 0 16px;
  cursor: pointer;
  user-select: none;
}
.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: #2f6b32;
  cursor: pointer;
}
.auth-error {
  display: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff0f2;
  border: 1px solid #e8b5bf;
  color: #a42b40;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}
[data-theme="dark"] .auth-error {
  background: #2c1e21;
  border-color: #5a343b;
  color: #f4b7be;
}
.auth-error.visible {
  display: block;
}
.btn-auth-submit {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #2a5d2e;
  background: #2f6b32;
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.1s ease;
}
.btn-auth-submit:hover {
  background: #275a2a;
}
.btn-auth-submit:active {
  transform: translateY(1px);
}
[data-theme="dark"] .btn-auth-submit {
  background: #365c41;
  border-color: #4f7e5c;
  color: #f4f8f5;
}
[data-theme="dark"] .btn-auth-submit:hover {
  background: #3f6b4c;
}
.auth-hint-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
}

/* Header User Badge & Logout */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-user-id {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 7px 14px;
  border-radius: 12px;
  border: 1px solid rgba(70, 130, 82, 0.28);
  background: rgba(70, 130, 82, 0.14);
  color: var(--accent);
  text-transform: uppercase;
  white-space: nowrap;
}
[data-theme="dark"] .header-user-id {
  background: #233329;
  border-color: #3a5443;
  color: #9ee6be;
}
.btn-board-all {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.btn-board-all:hover {
  background: rgba(70, 130, 82, 0.1);
  border-color: var(--accent);
}
.class-report-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.class-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.class-report-table th,
.class-report-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
.class-report-table th {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: rgba(128, 128, 128, 0.06);
}
.class-report-table tr:last-child td {
  border-bottom: none;
}
.class-report-table tr.is-me {
  background: rgba(70, 130, 82, 0.12);
  font-weight: 750;
}
[data-theme="dark"] .class-report-table tr.is-me {
  background: rgba(130, 184, 146, 0.14);
}
@media (max-width: 640px) {
  .header-user-id {
    padding: 6px 10px;
    font-size: 12px;
  }
  .auth-card:not(.auth-split) {
    padding: 24px 20px 20px;
  }
}

/* =========================================================
   TASK WORKSPACE, TEACHER LINK BUILDER & 2-COL TRANSLATION
   ========================================================= */
.btn-header-task {
  width: auto !important;
  padding: 0 14px !important;
  white-space: nowrap !important;
  background: rgba(82, 136, 62, 0.14) !important;
  border-color: rgba(82, 136, 62, 0.38) !important;
  color: #265022 !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
}
[data-theme="dark"] .btn-header-task {
  background: rgba(130, 184, 146, 0.16) !important;
  border-color: rgba(130, 184, 146, 0.38) !important;
  color: #cfead7 !important;
}
.teacher-task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 2px;
  margin: 12px 0;
}
@media (max-width: 640px) {
  .teacher-task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.teacher-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.teacher-task-item:has(input:checked) {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.10);
}
[data-theme="dark"] .teacher-task-item:has(input:checked) {
  border-color: #82b892;
  background: rgba(130, 184, 146, 0.14);
}
.teacher-task-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-bright);
}
.teacher-task-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}
.task-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.teacher-deadline-row {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
}
.teacher-deadline-label {
  font-size: 13px;
  font-weight: 750;
  color: var(--text-bright);
  white-space: nowrap;
}
.teacher-deadline-custom {
  max-width: 225px;
  min-width: 185px;
  flex: 0 1 auto;
}
.teacher-deadline-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.task-deadline-mini,
.task-deadline-badge {
  font-size: 12px;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #b45309;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
[data-theme="dark"] .task-deadline-mini,
[data-theme="dark"] .task-deadline-badge {
  color: #fcd34d;
}
.task-deadline-mini.is-urgent,
.task-deadline-badge.is-urgent {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #b91c1c;
}
[data-theme="dark"] .task-deadline-mini.is-urgent,
[data-theme="dark"] .task-deadline-badge.is-urgent {
  color: #fca5a5;
}
.task-lock-banner.is-info-ended {
  background: rgba(34, 150, 90, 0.12);
  border-color: rgba(34, 150, 90, 0.35);
  color: #166534;
}
[data-theme="dark"] .task-lock-banner.is-info-ended {
  color: #86efac;
}
.task-link-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-soft);
  color: var(--text-bright);
  font-size: 13px;
  font-family: ui-monospace, monospace;
}

/* Unified Task Study Pill inside .app-header (keeps main Flashcard center column 100% identical in height & alignment) */
.task-study-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 4px 9px 4px 8px;
  border-radius: 999px;
  background: linear-gradient(155deg, #eef8eb 0%, #ffffff 72%);
  border: 1.5px solid #9ec797;
  box-shadow: 0 2px 8px rgba(47, 107, 50, 0.12);
  margin: 0;
  flex-shrink: 0;
  max-width: 100%;
  overflow: visible;
}
[data-theme="dark"] .task-study-bar {
  background: linear-gradient(155deg, #1b2b1e 0%, #151e18 75%);
  border-color: #4a7852;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.task-study-bar-info {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  min-width: 0;
}
.task-study-bar-status,
.task-idle-mini {
  display: none !important;
}
.task-deadline-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #f59e0b;
}
.task-deadline-mini.is-urgent {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #ef4444;
}
.task-deadline-mini.is-unlimited {
  background: rgba(78, 122, 81, 0.11);
  color: #2f5c33;
  border-color: rgba(78, 122, 81, 0.28);
}
[data-theme="dark"] .task-deadline-mini {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}
[data-theme="dark"] .task-deadline-mini.is-urgent {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.55);
}
[data-theme="dark"] .task-deadline-mini.is-unlimited {
  background: rgba(114, 184, 126, 0.16);
  color: #b5e4be;
  border-color: rgba(114, 184, 126, 0.32);
}
.task-card-rem-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-card-rem-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #f59e0b;
  white-space: nowrap;
}
.task-card-rem-pill.is-urgent {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #ef4444;
}
.task-card-rem-pill.is-unlimited {
  background: rgba(78, 122, 81, 0.11);
  color: #2f5c33;
  border-color: rgba(78, 122, 81, 0.26);
}
[data-theme="dark"] .task-card-rem-pill {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}
[data-theme="dark"] .task-card-rem-pill.is-urgent {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.55);
}
[data-theme="dark"] .task-card-rem-pill.is-unlimited {
  background: rgba(114, 184, 126, 0.16);
  color: #b5e4be;
  border-color: rgba(114, 184, 126, 0.32);
}
header.app-header .tip-pill,
header.app-header .btn-icon-glass,
#task-study-pill {
  white-space: nowrap;
  flex-shrink: 0;
}
.task-study-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-sm-task {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  border-radius: 999px !important;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}
#btn-task-to-test1.is-test-ready {
  box-shadow: 0 2px 8px rgba(47, 107, 50, 0.28);
}
/* In active Task mode, Task pill occupies the center header slot cleanly instead of colliding with 4 nav tabs */
body:has(#task-study-bar[style*="flex"]) header.app-header .tot-nav-tabs {
  display: none !important;
}
/* Prevent header squeeze/clipping when Task bar is active on compact laptops (1121px - 1380px) */
@media (min-width: 1121px) and (max-width: 1380px) {
  body:has(#task-study-bar[style*="flex"]) header.app-header {
    gap: 8px !important;
  }
  body:has(#task-study-bar[style*="flex"]) .brand-name-txt,
  body:has(#task-study-bar[style*="flex"]) #hdr-streak-pill,
  body:has(#task-study-bar[style*="flex"]) .tot-hdr-btn .hdr-lbl-hide-sm {
    display: none !important;
  }
}
/* Highlight Flashcard's built-in Idle Clock & Mastery Progress card while studying an active Task */
body:has(#task-study-bar[style*="flex"]) #study-idle-clock {
  border-color: rgba(47, 107, 50, 0.45) !important;
  background: linear-gradient(180deg, #f3faf1 0%, #ffffff 100%) !important;
  box-shadow: 0 2px 8px rgba(47, 107, 50, 0.12) !important;
}
body:has(#task-study-bar[style*="flex"]) #study-idle-clock #study-idle-clock-val {
  color: #1f5c24 !important;
  font-weight: 850 !important;
}
body:has(#task-study-bar[style*="flex"]) #widget-vocab-progress {
  border-color: rgba(47, 107, 50, 0.45) !important;
  box-shadow: 0 4px 14px rgba(47, 107, 50, 0.12) !important;
}
[data-theme="dark"] body:has(#task-study-bar[style*="flex"]) #study-idle-clock {
  background: linear-gradient(180deg, #1b2c20 0%, #152119 100%) !important;
  border-color: rgba(114, 184, 126, 0.45) !important;
}
[data-theme="dark"] body:has(#task-study-bar[style*="flex"]) #study-idle-clock #study-idle-clock-val {
  color: #a7e6b2 !important;
}
@media (max-width: 1120px) {
  header.app-header {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .task-study-bar {
    order: 3;
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
    flex-wrap: wrap;
  }
}

/* Task Final 3-Stage Exam Overlay Modal */
#screen-task.task-exam-overlay {
  max-width: none;
  margin: 0;
  padding: 16px;
  z-index: 900;
}
#modal-task-summary {
  z-index: 960;
}
.task-exam-dialog {
  width: min(1420px, 98vw) !important;
  max-width: 1420px !important;
  height: 94vh !important;
  max-height: 94vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  padding: 0 !important;
  border-radius: 20px !important;
}
.task-exam-dialog > .modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 24px !important;
}
#task-stage-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#task-stage-container:has(.task-card-panel) {
  flex: 1 0 auto;
}
.task-exam-dialog > .modal-body:has(.translation-workspace) {
  padding: 0 !important;
  overflow: hidden !important;
}
.task-exam-dialog .task-topbar {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  margin-bottom: 0;
  flex-shrink: 0;
  padding: 14px 24px;
}
.task-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  margin-bottom: 14px;
}
.task-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.task-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.btn-task-finish {
  padding: 7px 14px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  border-radius: 999px !important;
  white-space: nowrap;
}
.btn-task-finish:disabled {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.25);
}
.btn-task-arrow-exit {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-bright);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
}
.btn-task-arrow-exit:hover {
  border-color: #52883e;
  background: rgba(82, 136, 62, 0.1);
  transform: translateX(-1px);
}
.task-active-theme-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.1px;
}
.task-steps-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.task-step-pill {
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--card-border);
  color: var(--text-muted);
  background: transparent;
  user-select: none;
}
button.task-step-pill {
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
  outline: none;
  transition: all 0.15s ease;
}
button.task-step-pill:not(.active):hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
button.task-step-pill.active:hover {
  color: #ffffff;
}
.task-exam-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 18px;
}
.task-exam-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.task-exam-title {
  margin: 0;
  font-size: 25px;
  font-weight: 850;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}
.task-stat-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.task-stat-pills .recall-stage-pill {
  font-size: 16px;
  font-weight: 750;
  padding: 7px 16px;
}
.task-err-pill {
  font-size: 16px;
  font-weight: 750;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}
.task-err-pill.has-err {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
}
.task-col-caption {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--text-muted);
  padding: 0 4px 4px;
}
.task-step-pill.active {
  background: #2f6b32;
  border-color: #2f6b32;
  color: #ffffff;
}
.task-step-pill.done {
  background: rgba(82, 136, 62, 0.14);
  border-color: rgba(82, 136, 62, 0.38);
  color: #265022;
}
[data-theme="dark"] .task-step-pill.active {
  background: #365c41;
  border-color: #4f7e5c;
}
[data-theme="dark"] .task-step-pill.done {
  background: rgba(130, 184, 146, 0.18);
  color: #bfe8cb;
}
.task-idle-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 9999px;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.task-card-panel {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 24px 32px 28px;
  box-shadow: var(--card-shadow);
  flex: 1 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.task-stage-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.14);
  overflow: hidden;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.task-stage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f8541 0%, #6ba353 100%);
  border-radius: 999px;
  transition: width 0.28s ease;
}
.task-match-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.task-q-sentence {
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1.5px solid var(--card-border);
  margin-bottom: 16px;
  font-size: 20px;
  line-height: 1.72;
  color: var(--text-bright);
}
.task-blank-pill {
  display: inline-block;
  min-width: 82px;
  padding: 0 10px;
  margin: 0 4px;
  border-radius: 8px;
  background: rgba(82, 136, 62, 0.14);
  border-bottom: 2.5px solid #2f6b32;
  color: #2f6b32;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
}
[data-theme="dark"] .task-blank-pill {
  background: rgba(130, 184, 146, 0.18);
  border-bottom-color: #82b892;
  color: #bfe8cb;
}
.task-q-opt {
  gap: 14px;
}
.task-q-opt-key {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1.5px solid var(--card-border);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.task-q-opt:not(:disabled):hover .task-q-opt-key {
  border-color: #52883e;
  color: #265022;
  background: rgba(82, 136, 62, 0.12);
}
.task-q-opt.is-right .task-q-opt-key {
  background: #2f6b32;
  border-color: #2f6b32;
  color: #ffffff;
}
.task-q-opt.is-wrong .task-q-opt-key {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}
@media (max-width: 640px) {
  .task-match-head {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 8px;
    font-size: 11px;
  }
  .task-q-sentence {
    padding: 14px 16px;
    font-size: 17px;
  }
}
.task-exam-dialog > .modal-body:has(.task-match-wrap) {
  padding: 18px 26px 22px !important;
  overflow-y: auto !important;
}
.task-learn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) {
  .task-learn-grid { grid-template-columns: 1fr; }
}
.task-wf-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(82, 136, 62, 0.08);
  border: 1px solid rgba(82, 136, 62, 0.25);
  margin-top: 12px;
}
.task-wf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.task-wf-chip {
  padding: 6px 11px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 13.5px;
  color: var(--text-bright);
}
.task-match-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 14px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.task-match-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.task-match-btn {
  flex: 1 0 auto;
  height: auto;
  padding: 18px 26px;
  min-height: 70px;
  max-height: none;
  border-radius: 16px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-bright);
  font-size: 21px;
  font-weight: 750;
  line-height: 1.38;
  text-align: left;
  overflow-wrap: break-word;
  word-break: normal;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: transform 0.12s ease, border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}
@media (max-width: 1366px), (max-height: 780px) {
  .task-exam-dialog > .modal-body:has(.task-match-wrap) {
    padding: 14px 20px 18px !important;
  }
  .task-card-panel:has(.task-match-wrap) {
    padding: 18px 22px 20px;
  }
  .task-match-btn {
    padding: 13px 18px;
    min-height: 60px;
    font-size: 18px;
    line-height: 1.35;
  }
}
.task-match-btn:not(:disabled):hover {
  border-color: #84b175;
  background: rgba(82, 136, 62, 0.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(47, 107, 50, 0.08);
}
.task-match-btn:not(:disabled):active {
  transform: scale(0.985);
}
.task-match-btn.is-active {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.14);
  box-shadow: 0 0 0 2.5px rgba(47, 107, 50, 0.22);
}
.task-match-btn.is-matched {
  border-color: #52883e;
  background: rgba(82, 136, 62, 0.18);
  color: #164e23;
  opacity: 0.62;
  cursor: default;
}
[data-theme="dark"] .task-match-btn.is-matched {
  color: #c5e6ce;
}
.task-match-btn.is-err {
  border-color: #dc2626;
  background: rgba(239, 68, 68, 0.16);
}
/* Test 2 Drag & Drop (Left = Drop Container, Right = Whole Block Transfer) */
@keyframes t2BlockSnapIn {
  0% { transform: scale(0.86) translateX(18px); opacity: 0.35; }
  70% { transform: scale(1.03) translateX(0); opacity: 1; }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}
@keyframes t2WrongShake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
}
.task-match-wrap.is-t2-dnd .task-match-col:last-child {
  justify-content: flex-start;
}
.t2-dropzone {
  justify-content: space-between;
  gap: 14px;
}
.t2-dropzone > * {
  pointer-events: none;
}
.t2-drop-word {
  flex: 1 1 auto;
  min-width: 0;
}
.t2-drop-slot {
  flex-shrink: 0;
  max-width: 54%;
  padding: 7px 14px;
  border-radius: 12px;
  border: 1.5px dashed rgba(82, 136, 62, 0.38);
  background: rgba(82, 136, 62, 0.04);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.16s ease;
}
.t2-drop-slot.is-filled {
  border: 1.5px solid #52883e;
  background: var(--card-bg);
  color: #1b5426;
  padding: 9px 16px;
  font-size: 16.5px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(47, 107, 50, 0.14);
  animation: t2BlockSnapIn 0.26s cubic-bezier(0.2, 0.9, 0.25, 1.05);
}
[data-theme="dark"] .t2-drop-slot.is-filled {
  color: #bfe8cb;
  background: rgba(34, 54, 39, 0.95);
  border-color: #659e6d;
}
.t2-dropzone.is-matched {
  opacity: 1;
  background: rgba(82, 136, 62, 0.11);
  border-color: rgba(82, 136, 62, 0.45);
}
.t2-dropzone.is-drop-over {
  border-color: #2f6b32 !important;
  border-style: dashed !important;
  background: rgba(82, 136, 62, 0.14) !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 50, 0.22) !important;
  transform: scale(1.012);
}
.t2-dropzone.is-drop-over .t2-drop-slot:not(.is-filled) {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.14);
  color: #1b5426;
}
.t2-drag-card {
  flex: 0 0 auto !important;
  min-height: 70px;
  gap: 12px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.t2-drag-card:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(47, 107, 50, 0.12);
}
.t2-drag-card.is-source-lifted {
  opacity: 0.18 !important;
  border-style: dashed !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: scale(0.98) !important;
}
.t2-drag-card.is-source-lifted > * {
  opacity: 0;
}
.t2-drag-card.is-matched {
  display: none !important;
}
.t2-drag-card.is-err,
.t2-dropzone.is-err {
  animation: t2WrongShake 0.3s ease;
}
.t2-drag-grip {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -1.5px;
  opacity: 0.65;
  flex-shrink: 0;
}
.t2-floating-block {
  position: fixed;
  z-index: 100005;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 26px;
  border-radius: 16px;
  border: 2px solid #2f6b32;
  background: var(--card-bg);
  color: var(--text-bright);
  font-size: 21px;
  font-weight: 750;
  line-height: 1.38;
  box-shadow: 0 18px 42px rgba(47, 107, 50, 0.24), 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: scale(1.03) rotate(1deg);
  transition: transform 0.08s ease;
  box-sizing: border-box;
}
[data-theme="dark"] .t2-floating-block {
  background: #1f2b22;
  border-color: #7cc086;
}
@media (max-width: 1366px), (max-height: 780px) {
  .t2-drag-card {
    min-height: 60px;
  }
  .t2-floating-block {
    padding: 13px 18px;
    font-size: 18px;
  }
  .t2-drop-slot.is-filled {
    font-size: 15px;
    padding: 7px 13px;
  }
}
@media (max-width: 640px) {
  .t2-dropzone {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 7px 9px !important;
    min-height: 50px !important;
    border-radius: 12px !important;
  }
  .t2-left-word {
    font-size: 14.5px !important;
    line-height: 1.25 !important;
  }
  .t2-drop-slot,
  .t2-drop-slot.is-filled {
    max-width: 100%;
    font-size: 12px;
    padding: 3px 8px;
  }
  .t2-drag-card {
    min-height: 50px;
    gap: 5px;
    padding: 7px 10px !important;
    font-size: 14.5px !important;
    border-radius: 12px !important;
  }
  .t2-drag-grip {
    font-size: 12.5px;
  }
  .t2-floating-block {
    padding: 9px 13px;
    font-size: 15px;
  }
}
.task-q-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
@media (max-width: 640px) {
  .task-q-opts { grid-template-columns: 1fr; }
}
.task-q-opt {
  padding: 20px 26px;
  min-height: 76px;
  border-radius: 16px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-bright);
  font-size: 20.5px;
  font-weight: 750;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: transform 0.12s ease, border-color 0.14s ease, background-color 0.14s ease;
}
.task-q-opt:not(:disabled):hover {
  border-color: #84b175;
  background: rgba(82, 136, 62, 0.06);
}
.task-q-opt.is-right {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.22);
}
.task-q-opt.is-wrong {
  border-color: #dc2626;
  background: rgba(239, 68, 68, 0.18);
}

/* Flush Split-Pane 2-Column Translation Workspace (Single Clean Scrollbar) */
.translation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--card-bg);
}
.translation-workspace .practice-paper {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.translation-workspace .english-paper {
  padding: 20px 28px 26px;
  border-right: 1.5px solid var(--card-border);
  overflow-y: auto;
  height: 100%;
}
.translation-workspace .writing-paper {
  padding: 0;
  overflow: hidden;
  height: 100%;
}
@media (max-width: 960px) {
  .task-exam-dialog > .modal-body:has(.translation-workspace) {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #task-stage-container:has(.translation-workspace) {
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
  }
  .translation-workspace {
    grid-template-columns: 1fr;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
  }
  .translation-workspace .english-paper {
    border-right: none;
    border-bottom: 2px solid var(--card-border);
    height: auto;
    max-height: 36vh;
    padding: 14px 16px 18px;
  }
  .translation-workspace .writing-paper {
    height: auto;
    overflow: visible;
    flex: none;
  }
  .t3-tabs-bar {
    padding: 0 16px;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 3;
  }
  #t3-pane-write {
    flex: none !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 14px 16px 22px !important;
    gap: 16px !important;
  }
  .t3-trans-field,
  .t3-sum-field {
    flex: none !important;
    min-height: auto !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .translation-input {
    flex: none !important;
    height: auto !important;
    min-height: 170px !important;
    margin-top: 0 !important;
  }
  .summary-input {
    flex: none !important;
    height: auto !important;
    min-height: 96px !important;
    margin-top: 0 !important;
  }
  #t3-pane-grade {
    flex: none !important;
    height: auto !important;
    overflow: visible !important;
    padding: 16px 16px 24px !important;
  }
}
@media (max-width: 640px) {
  .translation-workspace .english-passage {
    font-size: 16.5px;
    line-height: 1.68;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  .translation-workspace .translation-input,
  .translation-workspace .summary-input {
    font-size: 16px;
    padding: 12px 14px;
  }
}
.paper-eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 16px;
  flex-shrink: 0;
}
.paper-title-upper {
  font-size: 16.5px;
  font-weight: 850;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: var(--text-bright);
  line-height: 1.35;
}
.paper-wc {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.english-passage {
  font-size: 18.5px;
  line-height: 1.78;
  color: var(--text-bright);
  white-space: pre-line;
  text-align: justify;
  text-justify: inter-word;
}
.t3-tabs-bar {
  display: flex;
  align-items: stretch;
  gap: 24px;
  padding: 0 26px;
  height: 48px;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-soft);
  flex-shrink: 0;
}
.t3-tab-btn {
  padding: 0 4px;
  border: none;
  border-bottom: 2.5px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.t3-tab-btn:hover {
  color: var(--text-bright);
}
.t3-tab-btn.active {
  background: transparent;
  border-bottom-color: #2f6b32;
  color: #265022;
}
[data-theme="dark"] .t3-tab-btn.active {
  color: #a3d9a5;
  border-bottom-color: #7cc47f;
}
.t3-tab-score-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(82, 136, 62, 0.16);
  color: #265022;
}
.t3-tab-score-badge.is-fail {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}
#t3-pane-write {
  flex: 1;
  min-height: 0;
  padding: 18px 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.t3-trans-field {
  flex: 1;
  min-height: 168px;
  display: flex;
  flex-direction: column;
}
.t3-sum-field {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
#t3-pane-grade {
  flex: 1;
  min-height: 0;
  padding: 20px 26px 24px;
  overflow-y: auto;
}
.translation-input, .summary-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--card-border);
  background: var(--bg-soft);
  color: var(--text-bright);
  font-family: inherit;
  font-size: 17.5px;
  line-height: 1.65;
  resize: none;
  margin: 6px 0 0;
}
.translation-input {
  flex: 1;
  min-height: 150px;
  height: 100%;
}
.summary-input {
  min-height: 102px;
  height: 104px;
}
@media (max-height: 720px) and (min-width: 961px) {
  #t3-pane-write {
    padding: 14px 22px 16px;
    gap: 10px;
  }
  .translation-input {
    min-height: 120px;
  }
  .summary-input {
    min-height: 84px;
    height: 88px;
  }
}
.writing-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 750;
  color: var(--text-bright);
  flex-shrink: 0;
}
.ai-grade-box {
  margin-top: 0;
  padding: 22px 24px;
  border-radius: 16px;
  border: 1.5px solid rgba(82, 136, 62, 0.38);
  background: rgba(82, 136, 62, 0.08);
  font-size: 16px;
  line-height: 1.6;
}
.ai-grade-box.fail {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
}
.ai-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
@media (max-width: 640px) {
  .ai-criteria-grid { grid-template-columns: 1fr; }
}
.ai-crit-pill {
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
}
.task-notice-box {
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(82, 136, 62, 0.09);
  border: 1px solid rgba(82, 136, 62, 0.28);
  font-size: 16.5px;
  line-height: 1.65;
  margin-bottom: 14px;
}
.passage-hl-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.passage-hl-anchor {
  background: rgba(82, 136, 62, 0.22);
  color: #1b4d20;
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 750;
}
.passage-hl-signal {
  background: rgba(217, 119, 6, 0.20);
  color: #92400e;
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 750;
  border-bottom: 1.5px solid rgba(217, 119, 6, 0.55);
}
[data-theme="dark"] .passage-hl-anchor {
  background: rgba(130, 184, 146, 0.25);
  color: #d7f2df;
}
[data-theme="dark"] .passage-hl-signal {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}
.task-mistake-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
  text-align: left;
}
.task-mistake-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.06);
}
.task-lock-banner {
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #b91c1c;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 750;
  margin-bottom: 14px;
}
[data-theme="dark"] .task-lock-banner { color: #fecaca; }
[data-theme="dark"] .task-meaning-main { color: #b7dfc4 !important; }
.task-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 700px) {
  .task-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.task-kpi-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--bg-soft);
}
.task-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}
.task-kpi-val {
  font-size: 20px;
  font-weight: 850;
  color: var(--text-bright);
  margin-top: 3px;
}
/* Task Completion Summary Modal — Clean Editorial Layout */
#modal-task-summary .modal-card-wide {
  max-width: 820px !important;
  border-radius: 20px !important;
}
#modal-task-summary .modal-header {
  padding: 15px 22px 13px !important;
}
#modal-task-summary .modal-title {
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
#task-summary-subtitle {
  font-size: 13px !important;
  color: var(--text-muted);
  margin-top: 2px;
}
#task-summary-body {
  padding: 16px 22px 18px !important;
}

.task-summary-highlight {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, #4e7a51 24%, var(--card-border));
  background: linear-gradient(135deg, #f3f8f1 0%, #faf8f2 100%);
  margin-bottom: 14px;
}
[data-theme="dark"] .task-summary-highlight {
  border-color: #35543c;
  background: linear-gradient(135deg, rgba(46, 107, 54, 0.22) 0%, rgba(28, 36, 30, 0.92) 100%);
}
.task-sum-hero-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.task-sum-panda-ring {
  width: 72px;
  height: 72px;
  padding: 3px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #d5e4d1;
  box-shadow: 0 3px 10px rgba(47, 107, 50, 0.08);
  flex-shrink: 0;
}
[data-theme="dark"] .task-sum-panda-ring {
  background: #1f2b22;
  border-color: #3d5d44;
}
.task-sum-panda-ring .task-summary-panda {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  object-fit: cover;
  border: none;
  box-shadow: none;
}
.task-sum-hero-main {
  flex: 1 1 0;
  min-width: 0;
}
.task-sum-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.task-sum-done-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #2f6b32;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.task-sum-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(47, 107, 50, 0.08);
  border: 1px solid rgba(47, 107, 50, 0.16);
  color: var(--text-bright);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
[data-theme="dark"] .task-sum-meta-chip {
  background: rgba(155, 226, 174, 0.10);
  border-color: rgba(155, 226, 174, 0.22);
}
.task-sum-preview-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.10);
  border: 1px solid rgba(13, 148, 136, 0.28);
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
}
[data-theme="dark"] .task-sum-preview-pill {
  color: #99f6e4;
}
.task-sum-hero-title {
  font-size: 21px;
  font-weight: 850;
  color: var(--text-bright);
  line-height: 1.24;
  letter-spacing: -0.015em;
}
.task-sum-hero-note {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}
.task-sum-score-card {
  padding: 12px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dfd8c4;
  box-shadow: 0 2px 10px rgba(47, 60, 42, 0.05);
  text-align: center;
  min-width: 132px;
  flex-shrink: 0;
}
[data-theme="dark"] .task-sum-score-card {
  background: rgba(24, 33, 26, 0.92);
  border-color: #3d5240;
}
.task-sum-score-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.task-sum-score-line {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  margin-top: 2px;
}
.task-sum-score-num {
  font-size: 34px;
  font-weight: 900;
  color: #2f6b32;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .task-sum-score-num {
  color: #9be2ae;
}
.task-sum-score-denom {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}
.task-sum-score-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
}

.task-sum-stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.task-sum-stat {
  display: flex;
  flex-direction: column;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid #e3dfd5;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(40, 52, 38, 0.04);
  min-width: 0;
}
[data-theme="dark"] .task-sum-stat {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: none;
}
.task-sum-stat-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}
.task-sum-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-sum-stat.is-t1 .task-sum-dot { background: #4e7a51; }
.task-sum-stat.is-t2 .task-sum-dot { background: #3d8b80; }
.task-sum-stat.is-t3 .task-sum-dot { background: #c79538; }
.task-sum-stat.is-vocab .task-sum-dot { background: #c97254; }
.task-sum-stat-label {
  font-size: 14px;
  font-weight: 750;
  color: var(--text-bright);
  line-height: 1.3;
  margin-top: 4px;
  white-space: nowrap;
}
.task-sum-stat-val {
  font-size: 25px;
  font-weight: 900;
  color: var(--text-bright);
  margin-top: 10px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.task-sum-stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-sum-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.task-sum-btn {
  font-size: 14.5px !important;
  padding: 9px 18px !important;
}

@media (max-width: 760px) {
  .task-sum-hero-row {
    flex-wrap: wrap;
    gap: 12px;
  }
  .task-sum-panda-ring {
    width: 58px;
    height: 58px;
  }
  .task-sum-score-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 10px 14px;
  }
  .task-sum-score-num {
    font-size: 26px;
  }
  .task-sum-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .task-sum-stat {
    padding: 12px 13px;
  }
  .task-sum-stat-val {
    font-size: 21px;
  }
}
.task-sum-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Simple Dedicated Teacher Dashboard */
main.app-main:has(#screen-teacher.active) {
  max-width: 1260px;
}
#screen-teacher {
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 22px 42px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.teacher-panel {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 18px 22px 20px;
  box-shadow: var(--card-shadow);
}
.teacher-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.teacher-panel-title {
  font-size: 18px;
  font-weight: 850;
  color: var(--text-bright);
  margin: 0;
}
.teacher-panel-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.teacher-task-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
@media (max-width: 960px) {
  .teacher-task-dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .teacher-task-dash-grid { grid-template-columns: 1fr; }
}
.teacher-task-item.is-all-done {
  border-color: rgba(82, 136, 62, 0.45);
  background: rgba(82, 136, 62, 0.08);
}
.teacher-task-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  margin-left: 6px;
}
.teacher-task-badge.done {
  background: rgba(82, 136, 62, 0.18);
  color: #265022;
}
.teacher-task-badge.partial {
  background: rgba(217, 119, 6, 0.16);
  color: #b45309;
}
.teacher-task-badge.sent {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}
[data-theme="dark"] .teacher-task-badge.done { color: #bfe8cb; }
[data-theme="dark"] .teacher-task-badge.partial { color: #fcd34d; }
[data-theme="dark"] .teacher-task-badge.sent { color: #93c5fd; }
.teacher-task-missing {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.35;
}
.teacher-lock-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 750;
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  white-space: nowrap;
}
[data-theme="dark"] .teacher-lock-pill { color: #fecaca; }
.teacher-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.teacher-status-ok {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(82, 136, 62, 0.12);
  color: #265022;
}
[data-theme="dark"] .teacher-status-ok {
  background: rgba(130, 184, 146, 0.16);
  color: #bfe8cb;
}
.btn-teacher-unlock {
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1.5px solid #2f6b32;
  background: #2f6b32;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}
.btn-teacher-unlock:hover {
  background: #245626;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(47, 107, 50, 0.25);
}
.teacher-task-done-note { color: #265022; font-weight: 700; }
[data-theme="dark"] .teacher-task-done-note { color: #9be2ae; }
.cheat-warn-overlay {
  z-index: 99999 !important;
  background: rgba(8, 12, 9, 0.96) !important;
  backdrop-filter: blur(12px) !important;
}
.cheat-warn-card {
  max-width: 520px !important;
  width: 92vw !important;
  border: 2px solid #dc2626 !important;
  border-radius: 22px !important;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.72) !important;
}
.multitab-block-overlay {
  z-index: 99998 !important;
  background: rgba(6, 10, 8, 0.98) !important;
  backdrop-filter: blur(14px) !important;
}
body.is-multitab-blocked #auth-gate,
body.is-multitab-blocked #app-shell {
  visibility: hidden !important;
  pointer-events: none !important;
}
.exam-no-copy,
.exam-no-copy * {
  -webkit-user-select: none !important;
  user-select: none !important;
}
.exam-no-copy input,
.exam-no-copy textarea {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* =========================================================
   P0 + P1 + P2 UI POLISH, RESPONSIVE MOBILE & DARK CONTRAST
   ========================================================= */
.task-text-ok { color: var(--text-ok) !important; }
.task-text-err { color: var(--text-err) !important; }
.task-badge-err {
  background: rgba(239, 68, 68, 0.14) !important;
  color: var(--text-err) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

/* Fix #screen-study card top progress bar protruding at 0% and unify dark flip prompt */
#screen-study .card-progress-bar {
  top: 2px !important;
  left: 20px !important;
  width: calc(100% - 40px) !important;
  height: 3.5px !important;
  border-radius: 9999px !important;
  background: rgba(128, 128, 128, 0.13) !important;
  overflow: hidden !important;
}
#screen-study .card-progress-fill {
  min-width: 0 !important;
  background: var(--accent) !important;
}
[data-theme="dark"] #screen-study .fc-flip-prompt {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  opacity: 0.78;
}

/* Large crisp Toast notifications + Finished Deck + Recall feedback */
.toast-notice {
  top: 18px !important;
  bottom: auto !important;
  z-index: 100001 !important;
  width: max-content !important;
  max-width: min(92vw, 760px) !important;
  overflow-wrap: break-word;
  transform: translateX(-50%) translateY(-16px);
  padding: 16px 34px !important;
  border-radius: 20px !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
  letter-spacing: -0.2px !important;
  text-align: center;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32), 0 0 0 2px rgba(82, 136, 62, 0.5) !important;
  background: #172419 !important;
  color: #f7faf7 !important;
}
.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto !important;
}
@media (max-width: 640px) {
  .toast-notice {
    top: 12px !important;
    font-size: 15.5px !important;
    padding: 12px 18px !important;
    border-radius: 16px !important;
    line-height: 1.45 !important;
  }
}
.cheat-warn-card {
  max-width: 580px !important;
}
.recall-feedback {
  font-size: 16px !important;
  line-height: 1.55 !important;
}
.fc-finished-title {
  font-size: 23px !important;
}
.fc-finished-desc {
  font-size: 16.5px !important;
  line-height: 1.55 !important;
  max-width: 480px !important;
}

/* Auto-hide floating Anki reminder behind any open modal, Task screen, or Teacher view */
body:has(.modal-overlay.open) #anki-due-reminder,
body:has(#screen-task.active) #anki-due-reminder,
body:has(#screen-teacher.active) #anki-due-reminder {
  display: none !important;
}

/* Clean affordance for .btn-subtle across toolbars & modals */
.btn-subtle {
  border: 1px solid var(--card-border) !important;
  background: rgba(128, 128, 128, 0.06) !important;
  border-radius: 10px !important;
  padding: 7px 12px !important;
  font-weight: 650 !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-subtle:hover:not(:disabled) {
  background: var(--accent-subtle) !important;
  border-color: var(--accent) !important;
  color: var(--text-bright) !important;
}
.btn-subtle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Neutral bamboo grey for Unlearned progress bar segment */
.bamboo-seg-unlearned {
  background: #dce5d5 !important;
}
[data-theme="dark"] .bamboo-seg-unlearned {
  background: #2b352f !important;
}

/* Reading Tip modal height optimization on compact 620px laptops */
@media (max-height: 700px) {
  .tip-focus-card {
    max-height: 94vh !important;
  }
  .tip-focus-card .modal-header {
    padding: 10px 18px !important;
  }
  #tip-modal-body {
    padding: 10px 18px 14px !important;
  }
}

/* Segmented Theme Switch & Auth Badge */
.theme-seg-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
}
.theme-seg-btn {
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.theme-seg-btn.active {
  background: var(--card-bg);
  color: var(--text-bright);
  border-color: var(--card-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Compact Stats Strip for Mobile / Narrow Tablet (< 1200px) */
.mobile-stats-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 820px;
  margin: 0 auto 8px;
}
@media (min-width: 1200px) {
  .mobile-stats-strip {
    display: none !important;
  }
}
.mob-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.mob-stat-pill strong {
  color: var(--text-bright);
  font-weight: 800;
}
.mob-stat-pill.is-due {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}

@media (max-width: 1199px) {
  #screen-study .study-stage-row {
    flex-direction: column !important;
    align-items: center !important;
  }
  #screen-study .study-center-col {
    order: 1;
    width: 100%;
    max-width: 680px;
  }
  body.mobile-widgets-open #screen-study .study-deck {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
    max-width: 680px;
    margin-top: 10px;
  }
  #screen-study .study-deck-left { order: 2; }
  #screen-study .study-deck-right { order: 3; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  #screen-study.active .study-deck {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
    max-width: 680px;
    margin-top: 12px;
  }
  .mob-widgets-toggle {
    display: none !important;
  }
}
@media (max-width: 640px) {
  body.mobile-widgets-open #screen-study .study-deck {
    grid-template-columns: 1fr !important;
    gap: 10px;
    position: relative;
    padding-top: 16px;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    animation: mobSheetSlideUp 0.22s ease-out;
  }
  body.mobile-widgets-open #screen-study .study-deck-left::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: rgba(120, 138, 114, 0.35);
    margin: -6px auto 4px;
  }
  header.app-header {
    position: static !important;
    flex-wrap: wrap !important;
    padding: 6px 10px !important;
    gap: 5px !important;
  }
  header.app-header .header-actions {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .task-study-bar {
    padding: 5px 8px !important;
    gap: 4px 8px !important;
    border-radius: 10px !important;
  }
  .task-study-bar-info {
    gap: 6px !important;
    font-size: 12px !important;
    flex-wrap: wrap;
  }
  .task-study-bar-actions {
    gap: 6px !important;
  }
  .btn-sm-task {
    padding: 3.5px 9px !important;
    font-size: 11.5px !important;
    min-height: 28px !important;
  }
  .header-user-id {
    padding: 3.5px 7px !important;
    font-size: 11px !important;
  }
  #btn-open-student-tasks {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
  }
  main.app-main,
  main.app-main:has(#screen-study.active) {
    padding: 6px 10px 16px !important;
  }
  .mobile-stats-strip {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: center !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-stats-strip::-webkit-scrollbar {
    display: none;
  }
  .mob-stat-pill {
    padding: 3.5px 6.5px !important;
    font-size: 11px !important;
    gap: 3px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  #screen-study .study-center-col {
    gap: 6px !important;
  }
  #screen-teacher {
    padding: 10px 4px 28px;
    gap: 12px;
  }
  .teacher-panel {
    padding: 14px 12px 16px;
    border-radius: 16px;
  }
  #screen-teacher .class-report-table th:nth-child(2),
  #screen-teacher .class-report-table td:nth-child(2) {
    max-width: 150px;
  }
  #screen-study .fc-scene {
    height: clamp(390px, calc(100svh - 275px), 495px) !important;
    border-radius: 22px !important;
    box-shadow: 0 12px 30px rgba(24, 48, 28, 0.10), 0 2px 6px rgba(24, 48, 28, 0.05) !important;
  }
  body:has(#task-study-bar[style*="flex"]) #screen-study .fc-scene {
    height: clamp(360px, calc(100svh - 338px), 460px) !important;
  }
  #screen-study .fc-card,
  #screen-study .fc-face {
    border-radius: 22px !important;
  }
  #screen-study .keyboard-hint {
    display: none !important;
  }
  #screen-study .study-controls {
    margin-top: 2px !important;
  }
  #screen-study .nav-buttons-group {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--card-border);
    border-radius: 18px;
    padding: 6px;
    gap: 6px !important;
    box-shadow: 0 8px 24px rgba(24, 48, 28, 0.08);
  }
  [data-theme="dark"] #screen-study .nav-buttons-group {
    background: rgba(24, 32, 27, 0.92);
  }
  #screen-study .nav-buttons-group .btn {
    min-height: 44px !important;
    border-radius: 13px !important;
    font-weight: 750 !important;
  }
  #screen-study .nav-buttons-group .btn-flip-action {
    flex: 1.45 !important;
  }
  #screen-study .fc-face {
    padding: 10px 14px 8px !important;
  }
  .fc-back-header-bar {
    gap: 3px !important;
    padding-bottom: 5px !important;
  }
  #screen-study #fc-back-word {
    font-size: clamp(22px, 6.2vw, 27px) !important;
  }
  .fc-back-body-stack {
    gap: 6px !important;
    padding: 2px 0 !important;
  }
  #screen-study .fc-back-meaning {
    font-size: clamp(20px, 5.4vw, 24px) !important;
    line-height: 1.24 !important;
  }
  .fc-pair-card {
    padding: 7px 10px !important;
    border-radius: 11px !important;
  }
  .fc-pair-label {
    font-size: 12.5px !important;
    margin-bottom: 4px !important;
  }
  #screen-study .fc-pair-card .fc-chip {
    font-size: 15px !important;
    padding: 3px 9px !important;
  }
  #screen-study #fc-back-sentence {
    font-size: 16px !important;
    line-height: 1.38 !important;
    padding: 7px 10px !important;
  }
  #screen-study .assessment-row {
    padding-top: 6px !important;
    gap: 6px !important;
  }
  #screen-study .btn-assess {
    min-height: 44px !important;
    padding: 5px 6px !important;
    font-size: 13.5px !important;
  }
  #screen-study .btn-assess .anki-ivl-tag {
    display: block !important;
    font-size: 11px !important;
    margin-top: 2px !important;
    opacity: 0.85;
  }
  #screen-study .nav-row .btn {
    min-height: 44px !important;
  }
  .ai-criteria-grid {
    grid-template-columns: 1fr !important;
  }
  #screen-task.task-exam-overlay {
    padding: 6px;
  }
  .task-exam-dialog {
    width: 97vw !important;
    border-radius: 16px !important;
  }
  .task-exam-dialog .task-topbar {
    padding: 8px 10px;
    gap: 5px 8px;
  }
  .task-topbar-left {
    gap: 7px;
  }
  .btn-task-arrow-exit {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .task-active-theme-text {
    font-size: 13.5px;
    line-height: 1.25;
  }
  .task-steps-nav {
    gap: 5px;
  }
  .task-step-pill {
    padding: 4px 10px;
    font-size: 12.5px;
  }
  .btn-task-finish {
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
  .task-exam-dialog > .modal-body {
    padding: 10px 10px 14px !important;
  }
  .task-exam-dialog > .modal-body:has(.task-match-wrap) {
    padding: 8px 10px 12px !important;
  }
  .task-card-panel {
    padding: 10px 10px 12px !important;
    border-radius: 14px !important;
  }
  .task-exam-header-row {
    padding-bottom: 8px;
    margin-bottom: 6px;
    gap: 6px;
  }
  .task-exam-title {
    font-size: 17px;
    line-height: 1.25;
  }
  .task-match-wrap {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important;
    gap: 8px !important;
    margin-top: 6px;
  }
  .task-match-col {
    gap: 7px;
  }
  .task-match-btn {
    padding: 9px 10px !important;
    min-height: 48px !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    border-radius: 12px;
    overflow-wrap: anywhere;
  }
  .t2-dropzone {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 7px 9px !important;
    min-height: 50px !important;
    border-radius: 12px !important;
  }
  .t2-drag-card {
    min-height: 50px;
    gap: 5px;
    padding: 7px 10px !important;
    font-size: 14.5px !important;
    border-radius: 12px !important;
  }
  .task-q-opt {
    padding: 13px 15px;
    min-height: 54px;
    font-size: 16.5px;
  }
}

@keyframes mobSheetSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Teacher Dashboard Usability: Mascots, 4 Pastel KPI Cards, Monograms, Single-Row Search+Sort */
.teacher-panel-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.teacher-panda-badge {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  background: #f8f3eb;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(28, 48, 30, 0.14);
  flex-shrink: 0;
}
[data-theme="dark"] .teacher-panda-badge {
  border-color: #364b3d;
}
.teacher-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.teacher-kpi-card {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--card-border);
}
.teacher-kpi-card.is-mint { background: #f1f8ef; border-color: #cde2c7; }
.teacher-kpi-card.is-gold { background: #fdf7e6; border-color: #ecdcaf; }
.teacher-kpi-card.is-coral { background: #fdf2eb; border-color: #f0cfc0; }
.teacher-kpi-card.is-teal { background: #eef7f5; border-color: #c4dfd8; }
[data-theme="dark"] .teacher-kpi-card.is-mint { background: rgba(46, 125, 79, 0.18); border-color: #2f4b34; }
[data-theme="dark"] .teacher-kpi-card.is-gold { background: rgba(180, 130, 35, 0.16); border-color: #574824; }
[data-theme="dark"] .teacher-kpi-card.is-coral { background: rgba(185, 75, 45, 0.16); border-color: #5c3726; }
[data-theme="dark"] .teacher-kpi-card.is-teal { background: rgba(36, 138, 118, 0.18); border-color: #284e45; }
.teacher-kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.teacher-kpi-val {
  font-size: 19px;
  font-weight: 850;
  color: var(--text-bright);
  margin-top: 2px;
}
.teacher-student-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.teacher-toolbar-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}
.teacher-search-input,
.teacher-sort-select {
  width: 100% !important;
  min-width: 0 !important;
}
.teacher-secret-input {
  -webkit-text-security: disc;
}
.teacher-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  height: 38px;
  border-radius: var(--radius-btn, 10px);
  background: var(--bg-soft, #f3efe4);
  border: 1px solid var(--border-strong, rgba(61, 82, 54, 0.18));
  flex-shrink: 0;
}
.teacher-view-tab {
  height: 30px;
  padding: 0 13px;
  border: none;
  border-radius: calc(var(--radius-btn, 10px) - 3px);
  background: transparent;
  color: var(--text-muted, #5c6659);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.teacher-view-tab:hover:not(.active) {
  color: var(--ink, #233022);
  background: rgba(82, 136, 62, 0.08);
}
.teacher-view-tab.active {
  background: #2f6b32;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(32, 68, 34, 0.24);
}
[data-theme="dark"] .teacher-view-tabs {
  background: #1d2922;
  border-color: rgba(154, 210, 165, 0.22);
}
[data-theme="dark"] .teacher-view-tab {
  color: #b2c5b6;
}
[data-theme="dark"] .teacher-view-tab.active {
  background: #4e8c49;
  color: #ffffff;
}
@media (max-width: 760px) {
  .teacher-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .teacher-toolbar-row {
    grid-template-columns: 1fr;
  }
  .teacher-view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .teacher-panda-badge {
    width: 54px;
    height: 54px;
    border-radius: 13px;
  }
}
.teacher-task-dash-grid {
  max-height: 410px;
  overflow-y: auto;
  padding-right: 4px;
}
#screen-teacher .class-report-table th:nth-child(1),
#screen-teacher .class-report-table td:nth-child(1),
#modal-class-report .class-report-table th:nth-child(1),
#modal-class-report .class-report-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  box-sizing: border-box;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
#screen-teacher .class-report-table th:nth-child(1),
#screen-teacher .class-report-table td:nth-child(1) {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
}
#modal-class-report .class-report-table th:nth-child(1),
#modal-class-report .class-report-table td:nth-child(1) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
}
#screen-teacher .class-report-table th:nth-child(2),
#screen-teacher .class-report-table td:nth-child(2) {
  position: sticky;
  left: 42px;
  z-index: 1;
}
#modal-class-report .class-report-table th:nth-child(2),
#modal-class-report .class-report-table td:nth-child(2) {
  position: sticky;
  left: 56px;
  z-index: 1;
}
#screen-teacher .class-report-table td:nth-child(1),
#screen-teacher .class-report-table td:nth-child(2),
#modal-class-report .class-report-table td:nth-child(1),
#modal-class-report .class-report-table td:nth-child(2) {
  background: var(--card-bg);
}
#screen-teacher .class-report-table th,
#modal-class-report .class-report-table th,
#screen-teacher .class-report-table th:nth-child(1),
#screen-teacher .class-report-table th:nth-child(2),
#modal-class-report .class-report-table th:nth-child(1),
#modal-class-report .class-report-table th:nth-child(2) {
  background: #f7f6f0;
  background: color-mix(in srgb, var(--card-bg) 94%, #808080);
}
[data-theme="dark"] #screen-teacher .class-report-table th,
[data-theme="dark"] #modal-class-report .class-report-table th,
[data-theme="dark"] #screen-teacher .class-report-table th:nth-child(1),
[data-theme="dark"] #screen-teacher .class-report-table th:nth-child(2),
[data-theme="dark"] #modal-class-report .class-report-table th:nth-child(1),
[data-theme="dark"] #modal-class-report .class-report-table th:nth-child(2) {
  background: #212724;
  background: color-mix(in srgb, var(--card-bg) 94%, #808080);
}
#modal-class-report .class-report-table tr.is-me td,
#modal-class-report .class-report-table tr.is-me td:nth-child(1),
#modal-class-report .class-report-table tr.is-me td:nth-child(2) {
  background: #e9efe3;
  background: color-mix(in srgb, var(--card-bg) 88%, rgb(70, 130, 82));
}
[data-theme="dark"] #modal-class-report .class-report-table tr.is-me td,
[data-theme="dark"] #modal-class-report .class-report-table tr.is-me td:nth-child(1),
[data-theme="dark"] #modal-class-report .class-report-table tr.is-me td:nth-child(2) {
  background: #29362e;
  background: color-mix(in srgb, var(--card-bg) 86%, rgb(130, 184, 146));
}
.class-report-table td:nth-child(3),
.class-report-table td:nth-child(4),
.class-report-table td:nth-child(5),
.class-report-table td:nth-child(6),
.class-report-table td:nth-child(7) {
  white-space: nowrap;
}

/* Student Task item completion & lock visual cues */
.teacher-task-item.is-done {
  border-color: rgba(82, 136, 62, 0.48);
  background: rgba(82, 136, 62, 0.09);
}
.teacher-task-item.is-locked {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.07);
}

/* Word Family Mini Audio Chip */
.task-wf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.btn-wf-speak {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 750;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-wf-speak:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Streak Chart Peak Label */
.streak-max-label {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 750;
  color: var(--text-muted);
  background: var(--card-bg);
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
}

/* Selection counter in Recall Stage 2 */
.recall-select-counter {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--accent-subtle);
  color: var(--text-ok);
}

/* =========================================================
   FLUTTER-TEMPLATES INSPIRED BOTANICAL PASTEL WIDGETS
   Clean 4-Tone Pastel Cards + Circular Mascot Badges + Clip Blobs
   ========================================================= */
.study-deck {
  padding-top: 2px;
  padding-bottom: 4px;
}
#screen-study .study-deck-left,
#screen-study .study-deck-right {
  gap: 12px !important;
}
@media (max-height: 700px) and (min-width: 1200px) {
  #screen-study .study-deck-left,
  #screen-study .study-deck-right {
    gap: 10px !important;
  }
}

.study-deck .deck-widget {
  position: relative;
  overflow: hidden !important;
  border-radius: 18px !important;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.study-deck .deck-widget > * {
  position: relative;
  z-index: 1;
}
.study-deck .deck-widget::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  right: -46px;
  bottom: -48px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  transition: transform 0.28s ease;
}
.study-deck .deck-widget:hover {
  transform: translateY(-2px);
}
.study-deck .deck-widget:hover::after {
  transform: scale(1.08);
}

/* 4 Distinct Pastel Botanical Card Personalities (inspired by Food Delivery cards) */
.deck-widget.widget-theme-mint {
  background: linear-gradient(155deg, #f2f9f0 0%, #ffffff 58%) !important;
  border-color: #d0e3cb !important;
}
.deck-widget.widget-theme-mint::after {
  background: radial-gradient(circle, rgba(94, 158, 74, 0.16) 0%, transparent 72%);
}
.deck-widget.widget-theme-mint:hover {
  border-color: #4f8f44 !important;
  box-shadow: 0 10px 26px rgba(47, 107, 50, 0.11);
}

.deck-widget.widget-theme-gold {
  background: linear-gradient(155deg, #fdf8e7 0%, #ffffff 58%) !important;
  border-color: #ecdcaf !important;
}
.deck-widget.widget-theme-gold::after {
  background: radial-gradient(circle, rgba(217, 161, 59, 0.20) 0%, transparent 72%);
}
.deck-widget.widget-theme-gold:hover {
  border-color: #c78d24 !important;
  box-shadow: 0 10px 26px rgba(180, 125, 25, 0.12);
}

.deck-widget.widget-theme-coral {
  background: linear-gradient(155deg, #fdf2eb 0%, #ffffff 58%) !important;
  border-color: #f0cfc0 !important;
}
.deck-widget.widget-theme-coral::after {
  background: radial-gradient(circle, rgba(234, 88, 12, 0.15) 0%, transparent 72%);
}
.deck-widget.widget-theme-coral:hover {
  border-color: #d4652a !important;
  box-shadow: 0 10px 26px rgba(194, 65, 12, 0.11);
}

.deck-widget.widget-theme-teal {
  background: linear-gradient(155deg, #eef7f5 0%, #ffffff 58%) !important;
  border-color: #c4dfd8 !important;
}
.deck-widget.widget-theme-teal::after {
  background: radial-gradient(circle, rgba(36, 138, 118, 0.16) 0%, transparent 72%);
}
.deck-widget.widget-theme-teal:hover {
  border-color: #2b8572 !important;
  box-shadow: 0 10px 26px rgba(36, 120, 102, 0.11);
}

/* Dark Mode Pastel Variants */
[data-theme="dark"] .deck-widget.widget-theme-mint {
  background: linear-gradient(155deg, #1a271c 0%, #151e17 65%) !important;
  border-color: #2f4b34 !important;
}
[data-theme="dark"] .deck-widget.widget-theme-mint:hover { border-color: #5ea864 !important; }

[data-theme="dark"] .deck-widget.widget-theme-gold {
  background: linear-gradient(155deg, #252116 0%, #171c18 65%) !important;
  border-color: #574824 !important;
}
[data-theme="dark"] .deck-widget.widget-theme-gold:hover { border-color: #d4a138 !important; }

[data-theme="dark"] .deck-widget.widget-theme-coral {
  background: linear-gradient(155deg, #271b16 0%, #171c18 65%) !important;
  border-color: #5c3726 !important;
}
[data-theme="dark"] .deck-widget.widget-theme-coral:hover { border-color: #e07640 !important; }

[data-theme="dark"] .deck-widget.widget-theme-teal {
  background: linear-gradient(155deg, #162522 0%, #151d1a 65%) !important;
  border-color: #284e45 !important;
}
[data-theme="dark"] .deck-widget.widget-theme-teal:hover { border-color: #46a38d !important; }

/* Big Square Hand-Drawn Panda Artwork (Clean, Bold, Zero Redundant Corner Icons) */
.widget-panda-lockup {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}
.widget-panda-img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
  background: #f8f3eb;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(28, 48, 30, 0.14);
  transition: transform 0.25s ease;
}
.deck-widget:hover .widget-panda-img {
  transform: scale(1.04);
}
[data-theme="dark"] .widget-panda-img {
  border-color: #364b3d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1379px) and (min-width: 1200px) {
  .widget-panda-lockup {
    width: 88px;
    height: 88px;
  }
  .widget-panda-img {
    border-radius: 18px;
  }
}
@media (max-height: 700px) and (min-width: 1200px) {
  .widget-panda-lockup {
    width: 80px;
    height: 80px;
  }
  .widget-panda-img {
    border-radius: 16px;
  }
}
@media (max-width: 1199px) {
  .widget-panda-lockup {
    width: 86px;
    height: 86px;
  }
  .widget-panda-img {
    border-radius: 18px;
  }
}

/* Sticky Frosted Top Header */
header.app-header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] header.app-header {
  background: rgba(255, 255, 255, 0.84) !important;
}
[data-theme="dark"] header.app-header {
  background: rgba(18, 25, 20, 0.84) !important;
}

/* Leaderboard Pastel Monogram Avatars (FlutterTemplates Team Chat / Billfold Send-again) */
#screen-study .board-item {
  gap: 6px !important;
  align-items: center !important;
  border-radius: 11px !important;
}
#screen-study .board-item.is-top1:not(.is-me) {
  background: rgba(217, 161, 59, 0.12);
  border-color: rgba(217, 161, 59, 0.30);
}
.board-avatar {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.board-avatar.tone-0 { background: #cfeadb; color: #165934; }
.board-avatar.tone-1 { background: #d6e6ff; color: #1b4b91; }
.board-avatar.tone-2 { background: #fce6c5; color: #8c4d0d; }
.board-avatar.tone-3 { background: #e8defa; color: #542d91; }
[data-theme="dark"] .board-avatar.tone-0 { background: rgba(110, 210, 150, 0.22); color: #a7f3c5; }
[data-theme="dark"] .board-avatar.tone-1 { background: rgba(120, 175, 255, 0.22); color: #bfdbfe; }
[data-theme="dark"] .board-avatar.tone-2 { background: rgba(251, 191, 36, 0.22); color: #fde68a; }
[data-theme="dark"] .board-avatar.tone-3 { background: rgba(196, 160, 255, 0.22); color: #e9d5ff; }
#screen-study .board-info {
  min-width: 0;
  flex: 1;
}
#screen-study .board-name {
  font-size: 14.5px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#screen-study .board-meta,
#screen-study .board-score {
  font-size: 13.5px !important;
  flex-shrink: 0;
  white-space: nowrap;
}
#screen-study .timer-mode-tab,
#screen-study .board-tab-btn,
#screen-study .btn-board-all,
#screen-study .preset-btn {
  font-size: 13px !important;
}
#screen-study .streak-footer-goal {
  font-size: 13.5px !important;
}
#widget-vocab-progress .vocab-stat-row {
  font-size: 14.5px !important;
}
#widget-vocab-progress .vocab-stat-value strong {
  font-size: 15.5px !important;
}
#widget-vocab-progress .stat-pct {
  font-size: 13px !important;
}
#widget-vocab-progress .due-review-row .btn-due-quick {
  font-size: 13px !important;
}

/* Billfold Wallet Stacked Slips + Stitched Teal Pocket inside #widget-vocab-progress */
#widget-vocab-progress .vocab-stats-list {
  gap: 0 !important;
  padding-top: 2px !important;
}
#widget-vocab-progress .vocab-stat-row {
  padding: 5.5px 10px !important;
  border-radius: 11px 11px 4px 4px;
  border: 1px solid rgba(25, 50, 35, 0.08);
  transition: transform 0.2s ease;
}
#widget-vocab-progress .vocab-stat-row:nth-child(1) {
  background: #e4f4ea;
  margin-bottom: -3px;
  z-index: 1;
}
#widget-vocab-progress .vocab-stat-row:nth-child(2) {
  background: #fdf2d6;
  margin-bottom: -3px;
  z-index: 2;
}
#widget-vocab-progress .vocab-stat-row:nth-child(3) {
  background: #fce8e6;
  margin-bottom: -4px;
  z-index: 3;
}
#widget-vocab-progress:hover .vocab-stat-row:nth-child(1) { transform: translateY(-1px); }
#widget-vocab-progress:hover .vocab-stat-row:nth-child(2) { transform: translateY(-1px); }
#widget-vocab-progress .due-review-row {
  margin-top: 0 !important;
  padding: 7px 11px !important;
  border-radius: 13px !important;
  background: linear-gradient(145deg, #1b6352 0%, #134a3d 100%) !important;
  border: 1.5px dashed rgba(200, 244, 232, 0.45) !important;
  color: #f4fbf8 !important;
  z-index: 4;
  position: relative;
  box-shadow: 0 4px 12px rgba(19, 74, 61, 0.22);
}
#widget-vocab-progress .due-review-row .vocab-stat-label,
#widget-vocab-progress .due-review-row strong {
  color: #ffffff !important;
}
#widget-vocab-progress .due-review-row .btn-due-quick {
  background: #ffffff !important;
  color: #134a3d !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  padding: 2px 9px !important;
}
[data-theme="dark"] #widget-vocab-progress .vocab-stat-row {
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] #widget-vocab-progress .vocab-stat-row:nth-child(1) { background: rgba(46, 125, 79, 0.24); }
[data-theme="dark"] #widget-vocab-progress .vocab-stat-row:nth-child(2) { background: rgba(180, 130, 35, 0.22); }
[data-theme="dark"] #widget-vocab-progress .vocab-stat-row:nth-child(3) { background: rgba(185, 65, 65, 0.22); }
[data-theme="dark"] #widget-vocab-progress .due-review-row {
  background: linear-gradient(145deg, #175445 0%, #0f3a30 100%) !important;
  border-color: rgba(130, 224, 198, 0.40) !important;
}
@media (max-height: 700px) and (min-width: 1200px) {
  #widget-vocab-progress .vocab-stat-row {
    padding: 4.5px 9px !important;
  }
  #widget-vocab-progress .due-review-row {
    padding: 5.5px 10px !important;
  }
}

/* Micro-interactions from /widgets/ (Finance/Analytics & Media) */
.deck-widget.widget-theme-coral:hover .streak-bar-fill.active {
  filter: brightness(1.08);
  transform: scaleY(1.06);
  transform-origin: bottom;
}
.deck-widget.widget-theme-mint:hover .timer-display-box {
  border-color: rgba(47, 107, 50, 0.42) !important;
}

/* Mascot Spotlight Showcase (Auth + Finish Box + Task Summary) */
.celebrate-panda-img {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  object-fit: cover;
  background: #f4f7ef;
  border: 2px solid var(--card-border);
  box-shadow: 0 8px 22px rgba(47, 107, 50, 0.14);
  margin-bottom: 10px;
}
.task-summary-panda {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  object-fit: cover;
  background: #f4f7ef;
  border: 1.5px solid var(--card-border);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(47, 107, 50, 0.12);
}

/* Compact #modal-menu so it fits 1366x768 & 390x844 without vertical scrollbar */
#modal-menu .modal-card {
  max-height: 92vh;
}
#modal-menu .modal-header {
  padding: 14px 20px;
}
#modal-menu .modal-body {
  padding: 16px 20px;
}
#modal-menu .modal-body > div {
  margin-bottom: 12px !important;
}
#modal-menu .modal-body > div:first-child {
  padding-bottom: 12px !important;
}
#modal-menu .modal-body > div:last-child {
  margin-top: 12px !important;
  margin-bottom: 0 !important;
  padding-top: 12px !important;
}

/* =========================================================
   TEST 2 PART 2: IELTS SUMMARY COMPLETION WORD BOX
   ========================================================= */
.task-exam-dialog > .modal-body:has(.t2-wb-panel) {
  overflow-y: hidden !important;
  padding: 10px 22px 12px !important;
  display: flex;
  flex-direction: column;
}
#task-stage-container:has(.t2-wb-panel) {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex;
  flex-direction: column;
}
.task-card-panel.t2-wb-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 16px 26px 16px !important;
  overflow: hidden;
}
.t2-wb-panel .task-stage-progress {
  margin-bottom: 2px;
}
.t2-wb-panel .task-exam-header-row {
  margin-bottom: 0;
}
.t2-wb-box {
  background: var(--bg-soft, #f3f7ee);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 15px;
  flex-shrink: 0;
}
[data-theme="dark"] .t2-wb-box {
  background: rgba(255, 255, 255, 0.04);
}
.t2-wb-box-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 9px;
  text-transform: uppercase;
}
.t2-wb-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.t2-wb-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 13px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg, #fff);
  color: var(--text-bright);
  font-size: 18px;
  font-weight: 750;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.t2-wb-chip:active:not(:disabled) {
  cursor: grabbing;
}
.t2-wb-chip.is-source-lifted {
  opacity: 0.38;
  transform: scale(0.97);
}
.t2-wb-chip:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(47, 107, 50, 0.12);
}
.t2-wb-chip.is-used {
  opacity: 0.45;
  text-decoration: line-through;
  background: rgba(47, 107, 50, 0.08);
}
.t2-wb-chip.is-wb-ans {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}
.t2-wb-chip.is-wb-trap {
  border-color: rgba(217, 119, 6, 0.55);
  background: rgba(217, 119, 6, 0.09);
}
.t2-wb-chip.is-wb-dist {
  opacity: 0.7;
}
.t2-wb-chip-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(47, 107, 50, 0.12);
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 850;
  flex-shrink: 0;
}
.t2-wb-role-tag {
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.16);
  color: #b45309;
}
[data-theme="dark"] .t2-wb-role-tag {
  color: #fcd34d;
}
.t2-wb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-evenly;
}
.t2-wb-sent-row {
  border: 1.5px solid var(--card-border);
  border-radius: 15px;
  padding: 13px 18px;
  background: var(--card-bg, #fff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.t2-wb-sent-row.is-active-row,
.t2-wb-sent-row.is-drop-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 50, 0.14);
}
.t2-wb-sent-row.is-drop-over {
  background: rgba(47, 107, 50, 0.05);
}
.t2-wb-sent-row.is-ok-row {
  border-color: rgba(22, 163, 74, 0.5);
  background: rgba(22, 163, 74, 0.04);
}
.t2-wb-sent-row.is-err-row {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.04);
}
.t2-wb-sent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.t2-wb-num {
  display: inline-block;
  margin-right: 7px;
  font-size: 15px;
  font-weight: 850;
  color: var(--accent);
  text-transform: uppercase;
}
.t2-wb-src {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.t2-wb-sent-text {
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.58;
  color: var(--text-bright);
}
.t2-wb-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 13px;
  margin: 0 4px;
  border-radius: 10px;
  border: 1.5px dashed var(--accent);
  background: rgba(47, 107, 50, 0.07);
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  vertical-align: baseline;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.t2-wb-slot.is-active,
.t2-wb-slot.is-drop-over {
  border-style: solid;
  background: rgba(47, 107, 50, 0.18);
  box-shadow: 0 0 0 2.5px rgba(47, 107, 50, 0.22);
  transform: scale(1.02);
}
.t2-wb-slot.is-filled {
  border-style: solid;
  background: var(--accent);
  color: #fff;
}
.t2-wb-slot.is-right {
  border-style: solid;
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}
.t2-wb-slot.is-wrong {
  border-style: solid;
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.t2-wb-slot-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-size: 15px;
  line-height: 1;
  opacity: 0.88;
}
.t2-wb-slot-x:hover {
  opacity: 1;
}
.t2-wb-fb {
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.45;
  padding: 6px 11px;
  border-radius: 9px;
}
.t2-wb-fb.is-ok {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}
.t2-wb-fb.is-err {
  background: rgba(220, 38, 38, 0.09);
  color: #b91c1c;
}
[data-theme="dark"] .t2-wb-fb.is-ok { color: #86efac; }
[data-theme="dark"] .t2-wb-fb.is-err { color: #fca5a5; }
.t2-wb-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
  margin-top: auto;
  flex-shrink: 0;
}
.t2-wb-footer .btn {
  font-size: 16px;
  padding: 10px 22px;
}
@media (max-width: 1366px), (max-height: 780px) {
  .task-exam-dialog > .modal-body:has(.t2-wb-panel) { padding: 8px 18px 10px !important; }
  .task-card-panel.t2-wb-panel { padding: 12px 22px 12px !important; gap: 7px; }
  .t2-wb-panel .task-exam-title { font-size: 20px; }
  .t2-wb-box { padding: 8px 12px; border-radius: 13px; }
  .t2-wb-chip-grid { gap: 7px; }
  .t2-wb-chip { padding: 6px 12px; font-size: 17px; border-radius: 11px; gap: 6px; }
  .t2-wb-chip-key { width: 23px; height: 23px; font-size: 12.5px; }
  .t2-wb-list { gap: 6px; }
  .t2-wb-sent-row { padding: 8px 14px; border-radius: 12px; }
  .t2-wb-sent-text { font-size: 17.5px; line-height: 1.44; }
  .t2-wb-slot { padding: 2px 10px; font-size: 17px; }
  .t2-wb-fb { margin-top: 3px; padding: 3px 8px; font-size: 12.5px; line-height: 1.35; }
  .t2-wb-footer .btn { padding: 8px 20px; font-size: 15.5px; }
}
@media (max-width: 959px) {
  .task-exam-dialog > .modal-body:has(.t2-wb-panel) {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px 18px !important;
  }
  #task-stage-container:has(.t2-wb-panel) {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .task-card-panel.t2-wb-panel {
    flex: 0 0 auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 14px 14px 16px !important;
    gap: 10px !important;
  }
  .t2-wb-list {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    gap: 9px !important;
  }
  .t2-wb-chip { padding: 6px 10px; font-size: 15px; gap: 5px; }
  .t2-wb-chip-key { width: 22px; height: 22px; font-size: 12px; }
  .t2-wb-sent-row { padding: 10px 12px; }
  .t2-wb-sent-text { font-size: 15.5px; line-height: 1.5; }
  .t2-wb-slot { padding: 2px 9px; font-size: 15px; }
  .t2-wb-footer { margin-top: 6px; padding-top: 4px; }
}
@media (max-width: 640px) {
  .task-exam-dialog > .modal-body:has(.t2-wb-panel) { overflow-y: auto !important; }
  .t2-wb-panel { overflow: visible; }
  .t2-wb-box { padding: 10px 11px; }
  .t2-wb-chip { padding: 7px 11px; font-size: 15px; }
  .t2-wb-sent-text { font-size: 15.5px; line-height: 1.58; }
  .t2-wb-slot { padding: 2px 9px; font-size: 15px; }
}

/* =========================================================
   4-SUITE TASK TABS, QUICK-VI RECALL & UNIFIED SPEED-RECOGNITION MODAL
   ========================================================= */
.task-suite-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-suite-tab {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--card-border);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.task-suite-tab:hover {
  border-color: var(--accent);
  color: var(--text-bright);
}
.task-suite-tab.active {
  background: #2f6b32;
  border-color: #2f6b32;
  color: #ffffff;
}
[data-theme="dark"] .task-suite-tab.active {
  background: #52883e;
  border-color: #7eb26b;
  color: #ffffff;
}

.recall-wb-sentence {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-bright);
  margin-top: 6px;
  text-align: left;
}
.recall-wb-sentence .wb-inline-blank {
  display: inline-block;
  min-width: 72px;
  padding: 0 6px;
  border-bottom: 2.5px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  text-align: center;
}
.recall-syn-grid.is-quick-vi {
  grid-template-columns: 1fr;
  gap: 10px;
}
.recall-syn-opt.is-vi-choice {
  text-align: left;
  font-size: 15.5px;
  font-weight: 650;
  padding: 13px 16px;
  line-height: 1.4;
}

.recog-modal-card {
  max-width: 700px !important;
  width: 95vw !important;
}
.recog-intro-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recog-intro-title {
  font-size: 20px;
  font-weight: 850;
  color: var(--text-bright);
  line-height: 1.35;
}
.recog-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}
.recog-resume-banner {
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(82, 136, 62, 0.12);
  border: 1px solid rgba(82, 136, 62, 0.35);
  color: #1f5a26;
  font-size: 14px;
}
[data-theme="dark"] .recog-resume-banner {
  color: #c5e6ce;
}
.recog-intro-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.recog-quiz-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recog-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.recog-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recog-sound-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 750;
  border-radius: 999px;
  line-height: 1.25;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.recog-sound-btn.is-on {
  background: rgba(82, 136, 62, 0.14);
  color: #265022;
  border-color: rgba(82, 136, 62, 0.34);
}
.recog-sound-btn.is-off {
  opacity: 0.72;
}
[data-theme="dark"] .recog-sound-btn.is-on {
  background: #24372a;
  color: #c5e6ce;
  border-color: rgba(154, 210, 165, 0.32);
}
.recog-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: rgba(82, 136, 62, 0.14);
  color: #265022;
}
.recog-pill.is-err {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}
[data-theme="dark"] .recog-pill {
  background: #24372a;
  color: #c5e6ce;
}
[data-theme="dark"] .recog-pill.is-err {
  background: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}
.recog-timer-text {
  font-size: 15px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.recog-timer-text.is-urgent {
  color: #dc2626;
}
.recog-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.recog-progress-fill {
  height: 100%;
  background: #2f6b32;
  transition: width 0.2s ease;
}
.recog-countdown-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}
.recog-countdown-fill {
  height: 100%;
  background: #4e8c49;
}
.recog-countdown-fill.is-urgent {
  background: #dc2626;
}
.recog-word-stage {
  text-align: center;
  padding: 16px 12px 12px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
}
.recog-word-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.recog-word-main {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 850;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}
.recog-word-sub {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.recog-ipa {
  font-size: 14.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.recog-pos-chip {
  font-size: 12px;
  font-weight: 750;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(82, 136, 62, 0.14);
  color: #265022;
}
[data-theme="dark"] .recog-pos-chip {
  background: #24372a;
  color: #c5e6ce;
}
.recog-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
.recog-opt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-bright);
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.38;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.recog-opt-btn:hover {
  border-color: #6b965d;
  background: rgba(82, 136, 62, 0.07);
}
.recog-opt-btn.is-correct {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.22);
  color: #164e23;
}
.recog-opt-btn.is-wrong {
  border-color: #dc2626;
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}
[data-theme="dark"] .recog-opt-btn.is-correct {
  color: #d7f2df;
}
[data-theme="dark"] .recog-opt-btn.is-wrong {
  color: #fecaca;
}
.recog-opt-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}
.recog-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.recog-dontknow-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px dashed var(--card-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.recog-dontknow-btn:hover {
  border-color: #d97706;
  color: #b45309;
}
.recog-feedback-line {
  font-size: 13.5px;
  font-weight: 700;
  min-height: 20px;
}
.recog-feedback-line.is-ok { color: #1f6f34; }
.recog-feedback-line.is-err { color: #dc2626; }
.recog-miss-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 11px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recog-miss-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--card-border);
}
.recog-miss-row:last-child { border-bottom: none; }

/* =========================================================
   OOP MULTI-SKILL MODE MENU (SETTINGS PANEL)
   ========================================================= */
.skill-modes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.5px solid var(--card-border);
  background: var(--bg-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.skill-mode-row.is-active {
  border-color: #2f6b32;
  background: rgba(82, 136, 62, 0.12);
}
.skill-mode-row.is-upcoming {
  opacity: 0.78;
}
.skill-mode-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.skill-mode-row-main strong {
  font-size: 13.5px;
  color: var(--text-bright);
}
.skill-mode-row-main span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.skill-mode-pill {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.skill-mode-pill.is-live {
  background: #2f6b32;
  color: #ffffff;
}
.skill-mode-pill.is-soon {
  background: rgba(148, 163, 184, 0.22);
  color: var(--text-muted);
}

/* =========================================================
   UI POLISH PASS (LOCAL PREVIEW):
   1. Bottom-anchored Toast (never blocks top header/toolbar)
   2. Mobile 390px Action Bar zero-clip layout
   3. Desktop Focus Mode + Calm Side Decks + Accent CTA
   4. Balanced Flashcard Back Pairs & Real-Exam Source Tag
   5. Modern Numbered Task Cards & Suite Progress Strip
   ========================================================= */

/* 1. Sleek bottom-anchored Toast */
.toast-notice {
  top: auto !important;
  bottom: 22px !important;
  transform: translateX(-50%) translateY(14px);
  padding: 12px 24px !important;
  border-radius: 14px !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.45 !important;
  max-width: min(92vw, 680px) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24), 0 0 0 1.5px rgba(82, 136, 62, 0.45) !important;
}
.toast-notice.show {
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 640px) {
  .toast-notice {
    top: auto !important;
    bottom: 10px !important;
    font-size: 13px !important;
    padding: 8px 14px !important;
    border-radius: 12px !important;
  }
}

/* 2. Mobile 390px Action Bar — zero horizontal clipping */
@media (max-width: 640px) {
  #screen-study .study-top-actions {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }
  #screen-study .btn-deck-tool,
  #screen-study .study-progress {
    padding: 5px 9px !important;
    font-size: 12px !important;
    min-height: 31px !important;
  }
}

/* 3. Desktop Visual Hierarchy + Focus Mode */
.btn-deck-tool-accent {
  background: rgba(47, 107, 50, 0.1) !important;
  border-color: rgba(47, 107, 50, 0.36) !important;
  color: #1f5a26 !important;
  font-weight: 750 !important;
}
.btn-deck-tool-accent:hover {
  background: rgba(47, 107, 50, 0.18) !important;
  border-color: #2f6b32 !important;
}
[data-theme="dark"] .btn-deck-tool-accent {
  background: rgba(130, 184, 146, 0.16) !important;
  border-color: rgba(130, 184, 146, 0.45) !important;
  color: #d7f2df !important;
}

.btn-focus-toggle {
  display: inline-flex;
}
@media (max-width: 1199px) {
  .btn-focus-toggle {
    display: none !important;
  }
}
@media (min-width: 1200px) {
  #screen-study .study-deck .deck-widget {
    opacity: 0.92;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
    transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }
  #screen-study .study-deck .deck-widget:hover {
    opacity: 1;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08) !important;
  }
  body.study-focus-mode main.app-main,
  body.study-focus-mode main.app-main:has(#screen-study.active) {
    max-width: 1020px !important;
  }
  body.study-focus-mode #screen-study .study-deck {
    display: none !important;
  }
  body.study-focus-mode #screen-study .study-stage-row {
    justify-content: center !important;
    grid-template-columns: minmax(0, min(900px, 76vw)) !important;
  }
  body.study-focus-mode #screen-study .study-center-col {
    max-width: min(900px, 76vw) !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
  body.study-focus-mode #screen-study .fc-scene {
    max-width: min(900px, 76vw) !important;
    width: 100% !important;
    height: clamp(460px, calc(100svh - 196px), 720px) !important;
    min-height: 460px !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(24, 48, 28, 0.11), 0 4px 14px rgba(24, 48, 28, 0.05) !important;
  }
  body.study-focus-mode:has(#task-study-bar[style*="flex"]) #screen-study .fc-scene {
    height: clamp(420px, calc(100svh - 246px), 660px) !important;
    min-height: 420px !important;
  }
  body.study-focus-mode #screen-study .fc-card,
  body.study-focus-mode #screen-study .fc-face {
    border-radius: 24px !important;
  }
  body.study-focus-mode #screen-study .fc-face {
    padding: clamp(16px, 2.5svh, 26px) clamp(24px, 3.2vw, 42px) clamp(14px, 2svh, 20px) !important;
  }
  body.study-focus-mode #screen-study .fc-face-front .fc-word {
    font-size: clamp(3.3rem, 4.8vw, 4.4rem) !important;
    letter-spacing: -0.025em;
  }
  body.study-focus-mode #screen-study .fc-face-front .fc-ipa-badge {
    font-size: 1.5rem !important;
    padding: 8px 20px !important;
    border-radius: 12px !important;
  }
  body.study-focus-mode #screen-study .fc-face-front .btn-voice-speak {
    font-size: 16px !important;
    padding: 8px 20px !important;
    min-height: 42px !important;
    border-radius: 11px !important;
  }
  body.study-focus-mode #screen-study .fc-face-front .fc-pos {
    font-size: 14.5px !important;
    padding: 6px 16px !important;
  }
  body.study-focus-mode #screen-study #fc-front-sentence {
    max-width: 100% !important;
    width: 100% !important;
    font-size: clamp(19px, 2.5svh, 24px) !important;
    line-height: 1.5 !important;
    padding: clamp(11px, 1.7svh, 16px) 22px !important;
  }
  body.study-focus-mode #screen-study .fc-flip-prompt {
    font-size: 15.5px !important;
  }
  body.study-focus-mode #screen-study .fc-back-scrollable {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: clamp(4px, 1svh, 10px) !important;
    padding-right: 8px !important;
  }
  body.study-focus-mode #screen-study .fc-back-header-bar {
    width: 100% !important;
    gap: clamp(3px, 0.7svh, 8px) !important;
    padding-bottom: clamp(5px, 1svh, 11px) !important;
  }
  body.study-focus-mode #screen-study #fc-back-word {
    font-size: clamp(1.85rem, 3.3svh, 2.95rem) !important;
  }
  body.study-focus-mode #screen-study .fc-back-header-bar .fc-ipa-badge {
    font-size: clamp(1rem, 1.7svh, 1.25rem) !important;
    padding: 4px 13px !important;
  }
  body.study-focus-mode #screen-study .fc-back-header-bar .btn-voice-speak {
    font-size: 14px !important;
    padding: 5px 13px !important;
    min-height: 34px !important;
  }
  body.study-focus-mode #screen-study .btn-reading-tip {
    font-size: 13px !important;
    padding: 5px 13px !important;
  }
  body.study-focus-mode #screen-study .fc-back-body-stack {
    gap: clamp(8px, 1.6svh, 16px) !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
  }
  body.study-focus-mode #screen-study .fc-back-meaning {
    font-size: clamp(1.75rem, 3.2svh, 2.85rem) !important;
    line-height: 1.16 !important;
    padding: 0 !important;
  }
  body.study-focus-mode #screen-study .fc-pairs-grid {
    gap: clamp(12px, 1.8vw, 20px) !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body.study-focus-mode #screen-study .fc-pair-card {
    padding: clamp(9px, 1.5svh, 16px) clamp(14px, 1.8vw, 22px) !important;
    border-radius: 15px !important;
  }
  body.study-focus-mode #screen-study .fc-pair-label {
    font-size: clamp(12.5px, 1.6svh, 14px) !important;
    margin-bottom: clamp(5px, 0.9svh, 9px) !important;
  }
  body.study-focus-mode #screen-study .fc-pair-card .fc-chip {
    font-size: clamp(16px, 2.2svh, 20.5px) !important;
    padding: clamp(4px, 0.7svh, 7px) clamp(11px, 1.2vw, 15px) !important;
    border-radius: 10px !important;
  }
  body.study-focus-mode #screen-study #fc-back-sentence {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: clamp(10px, 1.6svh, 16px) clamp(14px, 1.8vw, 22px) !important;
    font-size: clamp(17.5px, 2.45svh, 22.5px) !important;
    line-height: 1.48 !important;
  }
  body.study-focus-mode #screen-study .fc-sentence-src {
    font-size: clamp(11.5px, 1.4svh, 13px) !important;
    margin-bottom: 4px !important;
  }
  body.study-focus-mode #screen-study .assessment-row {
    gap: 14px !important;
    padding-top: clamp(8px, 1.4svh, 14px) !important;
  }
  body.study-focus-mode #screen-study .btn-assess {
    padding: clamp(9px, 1.4svh, 14px) 18px !important;
    font-size: clamp(15px, 1.9svh, 17px) !important;
    border-radius: 13px !important;
  }
  body.study-focus-mode #screen-study .study-controls .btn {
    padding: clamp(9px, 1.3svh, 12px) 26px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }
  body.study-focus-mode #screen-study .study-controls .btn-flip-action {
    min-width: 185px !important;
  }
}

/* 4. Flashcard Back Face Balance + Real-Exam Source Tag */
.fc-pairs-grid {
  align-items: start !important;
}
.fc-sentence-src {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2f6b32;
  margin-bottom: 4px;
  opacity: 0.85;
}
[data-theme="dark"] .fc-sentence-src {
  color: #9dd1ab;
}

/* 5. Modern Numbered Task Cards & Suite Progress Strip */
.task-suite-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
}
.task-suite-prog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.task-suite-prog-top strong {
  color: var(--text-bright);
  font-weight: 800;
}
.task-suite-prog-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.task-suite-prog-fill {
  height: 100%;
  background: #2f6b32;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.task-card-modern {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  padding: 11px 13px !important;
}
.task-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
  flex-shrink: 0;
  background: rgba(47, 107, 50, 0.09);
  color: #265022;
  border: 1px solid rgba(47, 107, 50, 0.2);
}
.task-num-badge.is-done {
  background: #2f6b32;
  color: #ffffff;
  border-color: #2f6b32;
}
.task-num-badge.is-locked {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}
[data-theme="dark"] .task-num-badge {
  background: rgba(130, 184, 146, 0.15);
  color: #cdebd6;
  border-color: rgba(130, 184, 146, 0.3);
}
.task-card-body {
  min-width: 0;
  flex: 1;
}
.task-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: rgba(148, 163, 184, 0.45);
}
.task-status-dot.is-done { background: #2f6b32; }
.task-status-dot.is-locked { background: #dc2626; }

/* 6. Scrollbar Optimization: zero unnecessary scrollbars & zero double-scroll in Tasks modal */
#modal-student-tasks .modal-card {
  max-width: min(980px, 94vw) !important;
  max-height: 90svh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#modal-student-tasks .modal-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
#modal-student-tasks #student-task-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 4px 0 0 !important;
  padding: 2px 4px 4px 2px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 9px !important;
  overflow-y: auto !important;
}
@media (min-width: 960px) {
  #modal-student-tasks #student-task-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  #modal-student-tasks #student-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
#modal-student-tasks .task-card-modern {
  padding: 9px 11px !important;
  gap: 9px !important;
}
#modal-student-tasks .task-num-badge {
  width: 30px;
  height: 30px;
  font-size: 12px;
  border-radius: 9px;
}
#screen-study .fc-back-scrollable::-webkit-scrollbar,
#modal-student-tasks #student-task-grid::-webkit-scrollbar {
  width: 5px;
}
#screen-study .fc-back-scrollable::-webkit-scrollbar-thumb,
#modal-student-tasks #student-task-grid::-webkit-scrollbar-thumb {
  background: rgba(82, 136, 62, 0.28);
  border-radius: 999px;
}
#screen-study .fc-back-scrollable::-webkit-scrollbar-track,
#modal-student-tasks #student-task-grid::-webkit-scrollbar-track {
  background: transparent;
}

/* =========================================================
   7. V2: TEST 2 READING CLIPS + TEST 3 INVERTED 2-STEP & COMPARE VIEW
   (100% Totoro Editorial Design System Tokens — 20 Themes Compatible)
   ========================================================= */
.t2-clip-panel {
  gap: 12px;
}
.t2-clip-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.03em;
}
.t2-clip-type-badge.is-tfng {
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 26%, transparent);
}
.t2-clip-type-badge.is-ynng {
  background: var(--streak-soft);
  color: var(--streak);
  border: 1px solid color-mix(in srgb, var(--streak) 28%, transparent);
}
.t2-clip-type-badge.is-mcq {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.t2-clip-lvl-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.t2-clip-lvl-badge.is-p1 {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
}
.t2-clip-lvl-badge.is-p2 {
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 28%, transparent);
}
.t2-clip-lvl-badge.is-p3 {
  background: var(--streak-soft);
  color: var(--streak);
  border: 1px solid color-mix(in srgb, var(--streak) 30%, transparent);
}
.t2-clip-excerpt {
  padding: 16px 20px;
  border-radius: var(--radius-panel);
  background: var(--surface-panel);
  border: 1.5px solid var(--border);
  font-family: var(--font-ui);
  font-size: 17.5px;
  line-height: 1.68;
  color: var(--ink);
  text-align: justify;
}
.t2-key-hl {
  background: var(--streak-soft);
  color: var(--streak);
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 750;
}
.t2-clip-prompt {
  font-family: var(--font-ui);
  font-size: 18.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.5;
  padding: 2px 2px 0;
}
.t2-clip-q-label {
  display: inline-block;
  padding: 2px 9px;
  margin-right: 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}
.t2-clip-tfng-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.t2-clip-tfng-btn {
  padding: 14px 16px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.t2-clip-tfng-btn:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
.t2-clip-tfng-btn:not(:disabled):active {
  transform: scale(0.985);
}
.t2-clip-tfng-btn.is-right {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.t2-clip-tfng-btn.is-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.t2-clip-panel .task-q-opts {
  gap: 11px;
  margin-top: 4px;
}
.t2-clip-panel .task-q-opt {
  padding: 12px 16px;
  min-height: 54px;
  font-size: 15.5px;
  line-height: 1.42;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  transition: transform 150ms var(--ease-out), border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.t2-clip-panel .task-q-opt:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.t2-clip-panel .task-q-opt:not(:disabled):active {
  transform: scale(0.99);
}
.t2-clip-feedback {
  padding: 13px 16px;
  border-radius: var(--radius-panel);
  border: 1.5px solid var(--border);
  background: var(--surface-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.t2-clip-feedback.is-ok {
  border-color: color-mix(in srgb, var(--ok) 36%, transparent);
  background: var(--ok-soft);
}
.t2-clip-feedback.is-err {
  border-color: color-mix(in srgb, var(--danger) 36%, transparent);
  background: var(--danger-soft);
}
.t2-clip-fb-head {
  font-size: 16px;
  color: var(--ink);
}
.t2-clip-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.t2-meta-label {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--ink-2);
}
.t2-key-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--streak-soft);
  color: var(--streak);
  border: 1px solid color-mix(in srgb, var(--streak) 30%, transparent);
}
.t2-method-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 26%, transparent);
}
.t2-para-link-box {
  font-size: 14px;
  line-height: 1.48;
  color: var(--ink);
  padding: 7px 11px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: 1px solid var(--border);
}
.t2-clip-explain {
  font-size: 14.5px;
  line-height: 1.54;
  color: var(--ink-2);
}

/* Test 3 V2: Step 2 Headings & Summary (Flat No-Tab Layout + Clean Compact Editorial Scale) */
.t3-v2-step2-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-ui);
}
.t3-v2-section {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.t3-v2-section + .t3-v2-section {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.t3-v2-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.t3-v2-sec-title {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 850;
  color: var(--ink);
}
.t3-v2-headings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.56;
  color: var(--ink);
}
.t3-v2-heading-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.t3-v2-heading-roman {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}
.t3-v2-heading-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.t3-v2-heading-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.t3-v2-para-label {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.t3-v2-heading-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  padding: 9px 34px 9px 12px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237E776C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-shadow: var(--shadow-btn);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.t3-v2-heading-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.t3-v2-heading-row.is-filled .t3-v2-heading-select {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
}
#t3-v2-wb-wordbox {
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
  margin: 0;
}
#t3-v2-wb-wordbox .t2-wb-chip-grid {
  gap: 7px;
}
#t3-v2-wb-wordbox .t2-wb-chip {
  padding: 6px 11px;
  border-radius: var(--radius-btn);
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 700;
  background: var(--surface-panel);
  border: 1.5px solid var(--border);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
}
#t3-v2-wb-wordbox .t2-wb-chip:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}
#t3-v2-wb-wordbox .t2-wb-chip.is-used {
  background: var(--surface);
  opacity: 0.45;
}
#t3-v2-wb-wordbox .t2-wb-chip-key {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  font-size: 11.5px;
  background: var(--accent-soft);
  color: var(--accent);
}
#t3-v2-wb-wordbox .t2-wb-chip-grip {
  font-size: 12px;
  opacity: 0.45;
}
.t3-v2-summary-text {
  padding: 12px 14px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 2.02;
  color: var(--ink);
}
#t3-v2-wb-list .t2-wb-slot {
  padding: 2px 10px;
  margin: 0 3px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.35;
  background: var(--accent-soft);
  border: 1.5px dashed var(--accent);
  color: var(--accent);
}
#t3-v2-wb-list .t2-wb-slot.is-active,
#t3-v2-wb-list .t2-wb-slot.is-drop-over {
  border-style: solid;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#t3-v2-wb-list .t2-wb-slot.is-filled {
  border-style: solid;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#t3-v2-wb-list .t2-wb-slot.is-right {
  border-style: solid;
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
#t3-v2-wb-list .t2-wb-slot.is-wrong {
  border-style: solid;
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* Test 3 V2: 2-Column Compare View */
.t3-compare-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.t3-compare-block-title {
  font-size: 14px;
  font-weight: 850;
  color: var(--ink);
  margin: 14px 0 8px;
}
.t3-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.t3-compare-card {
  padding: 12px 14px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.t3-compare-col-head {
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.t3-compare-student-text,
.t3-compare-model-text {
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink);
  white-space: pre-line;
  word-break: break-word;
}
.t3-compare-items-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.t3-compare-item {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.t3-compare-item.is-ok {
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
}
.t3-compare-item.is-err {
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  background: var(--danger-soft);
}
.t3-compare-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.t3-compare-note {
  color: var(--ink-2);
  margin-top: 2px;
  font-size: 12.5px;
}
.t3-compare-banner {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: var(--radius-btn);
  font-size: 14.5px;
  color: var(--ink);
}
.t3-compare-banner.is-pass {
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 34%, transparent);
}
.t3-compare-banner.is-warn {
  background: var(--streak-soft);
  border: 1px solid color-mix(in srgb, var(--streak) 34%, transparent);
}

#t3-v2-step1-wrap {
  flex: 1 1 auto;
  min-height: 0;
  gap: 14px;
}
#t3-v2-step1-wrap .t3-trans-field {
  flex: 1 1 auto !important;
  min-height: 300px;
}
#t3-v2-step1-wrap .translation-input {
  min-height: 265px;
  padding: 16px 18px;
  line-height: 1.72;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
#t3-v2-step1-wrap .summary-input {
  min-height: 116px;
  height: 122px;
  padding: 14px 18px;
  line-height: 1.65;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
#t3-v2-step1-wrap .translation-input:focus,
#t3-v2-step1-wrap .summary-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Global Slim Totoro Scrollbars across the entire web app */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent, #4e724d) 26%, transparent);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent, #4e724d) 50%, transparent);
}
*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent, #4e724d) 30%, transparent) transparent;
  }
}

/* Practice screen: fit cleanly in viewport with no visible scrollbar */
#screen-practice.active .tot-section-shell {
  min-height: calc(100dvh - 122px) !important;
}
html:has(#screen-practice.active) {
  overflow-x: hidden;
}
html:has(#screen-practice.active),
body:has(#screen-practice.active),
#screen-practice,
#screen-practice * {
  scrollbar-width: none !important;
}
html:has(#screen-practice.active)::-webkit-scrollbar,
body:has(#screen-practice.active)::-webkit-scrollbar,
#screen-practice::-webkit-scrollbar,
#screen-practice *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
@media (max-width: 767px) {
  #screen-practice.active .tot-section-shell {
    min-height: auto !important;
  }
}

@media (max-width: 960px) {
  #t3-v2-step1-wrap .translation-input {
    min-height: 220px !important;
  }
  #t3-v2-step1-wrap .summary-input {
    min-height: 108px !important;
  }
}

@media (max-width: 768px) {
  .t2-clip-excerpt {
    padding: 12px 14px;
    font-size: 15.5px;
    line-height: 1.6;
  }
  .t2-clip-prompt {
    font-size: 16px;
  }
  .t2-clip-tfng-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .t2-clip-tfng-btn {
    padding: 11px 14px;
    font-size: 15px;
  }
  .t3-v2-heading-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .t3-compare-grid {
    grid-template-columns: 1fr;
  }
}
