:root {
  --polish-ink: #172033;
  --polish-muted: #69748c;
  --polish-soft: #f7faff;
  --polish-work: #eef4ff;
  --polish-line: #dbe5f6;
  --polish-blue: #3b68f2;
  --polish-blue-hover: #315de8;
  --polish-green: #d9f5ee;
  --polish-green-mark: #a7e8dc;
  --polish-purple: #d8c8ff;
  --polish-purple-soft: #eee8ff;
  --polish-yellow: #fff0a9;
  --polish-red: #d94d61;
  --polish-red-soft: #fff0f2;
  --polish-shell: min(1480px, calc(100vw - 32px));
  --polish-side: clamp(310px, 24vw, 380px);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

body {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh;
  margin: 0;
  padding: 12px 0 24px !important;
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 104, 242, .055), transparent 28%),
    linear-gradient(180deg, #fbfcff 0%, #f5f8ff 100%) !important;
  color: var(--polish-ink) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body > .topbar {
  order: 1 !important;
}

body > .date-panel {
  order: 2 !important;
}

body > .app-shell {
  order: 3 !important;
}

[hidden],
.listen-button[hidden],
#lessonSummary[hidden] {
  display: none !important;
}

.date-panel,
.topbar,
.app-shell,
.app-shell.sidebar-collapsed {
  width: var(--polish-shell) !important;
  max-width: var(--polish-shell) !important;
  margin-right: auto !important;
  margin-left: auto !important;
  transform: none !important;
}

.date-panel,
.app-shell.sidebar-collapsed .date-panel {
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  display: grid !important;
  grid-template-columns: 132px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 58px !important;
  margin-bottom: 8px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.sidebar-toggle,
.app-shell.sidebar-collapsed .sidebar-toggle {
  display: none !important;
}

.panel-head,
.app-shell.sidebar-collapsed .panel-head {
  display: block !important;
  min-width: 0;
  padding-left: 2px;
}

.panel-head .eyebrow {
  margin: 0 0 2px !important;
  color: var(--polish-blue) !important;
  font-size: 11px !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

.panel-head h1 {
  margin: 0 !important;
  color: var(--polish-ink) !important;
  font-size: 16px !important;
  font-weight: 620 !important;
  line-height: 1.05 !important;
}

.date-list,
.app-shell.sidebar-collapsed .date-list {
  display: flex !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 2px 2px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;
}

.date-list::-webkit-scrollbar {
  display: none;
}

.date-button {
  width: auto !important;
  min-width: 150px !important;
  min-height: 52px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  padding: 8px 12px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: var(--polish-muted) !important;
  box-shadow: none !important;
}

.date-button strong {
  color: inherit !important;
  font-size: 17px !important;
  font-weight: 650 !important;
}

.date-button span span,
.date-score {
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 560 !important;
}

.date-button.active {
  border-color: var(--polish-blue) !important;
  background: #edf4ff !important;
  color: var(--polish-ink) !important;
  box-shadow: inset 0 0 0 1px rgba(59, 104, 242, .18) !important;
}

.date-button.completed {
  border-color: #bfe8de !important;
  background: var(--polish-green) !important;
  color: var(--polish-ink) !important;
}

.topbar {
  position: relative !important;
  top: auto !important;
  display: flex !important;
  align-items: center !important;
  min-height: 108px !important;
  margin-top: 0 !important;
  padding: 22px 34px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 24px 24px 0 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 16px !important;
  min-width: 0 !important;
  color: inherit !important;
  text-decoration: none !important;
}

.brand-mark {
  width: 58px !important;
  height: 58px !important;
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  border-radius: 18px !important;
  background: var(--polish-blue) !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 520 !important;
}

.brand strong,
.brand small {
  display: block !important;
}

.brand strong {
  color: var(--polish-ink) !important;
  font-size: 24px !important;
  font-weight: 620 !important;
  line-height: 1.08 !important;
}

.brand small {
  margin-top: 6px !important;
  color: var(--polish-muted) !important;
  font-size: 17px !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
}

.header-tools,
.header-progress {
  display: flex !important;
  align-items: center !important;
}

.header-tools {
  gap: 20px !important;
}

.header-progress {
  gap: 18px !important;
}

.header-progress-track {
  width: 190px !important;
  height: 9px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #e7eefb !important;
}

.header-progress-track span {
  display: block !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: var(--polish-blue) !important;
}

.header-progress strong {
  min-width: 110px !important;
  color: var(--polish-ink) !important;
  font-size: 25px !important;
  font-weight: 620 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.user-button {
  width: auto !important;
  min-width: 60px !important;
  min-height: 60px !important;
  padding: 0 18px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 20px !important;
  background: #fff !important;
  color: var(--polish-ink) !important;
  font-size: 16px !important;
  font-weight: 620 !important;
}

.user-button.is-authenticated {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  height: 60px !important;
  padding: 0 !important;
  border-radius: 20px !important;
  font-size: 0 !important;
}

.app-shell,
.app-shell.sidebar-collapsed {
  display: block !important;
  height: calc(100vh - 190px) !important;
  min-height: 650px !important;
  overflow: hidden !important;
  border: 1px solid var(--polish-line) !important;
  border-top: 0 !important;
  border-radius: 0 0 24px 24px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.task-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--polish-side) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "hero steps"
    "task steps" !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--polish-work) !important;
}

.lesson-hero {
  grid-area: hero !important;
  display: block !important;
  min-width: 0 !important;
  padding: 18px clamp(30px, 3vw, 46px) 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--polish-work) !important;
  box-shadow: none !important;
}

.lesson-hero .eyebrow {
  margin: 0 0 7px !important;
  color: var(--polish-blue) !important;
  font-size: 13px !important;
  font-weight: 760 !important;
}

.lesson-hero h2 {
  margin: 0 0 10px !important;
  color: var(--polish-ink) !important;
  font-size: clamp(22px, 1.7vw, 28px) !important;
  font-weight: 580 !important;
  line-height: 1.12 !important;
}

.lesson-summary-row {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

#lessonSummary {
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  min-width: 0 !important;
}

.dictionary-label {
  color: var(--polish-muted) !important;
  font-size: 14px !important;
  font-weight: 560 !important;
}

.dictionary-chips {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 2px !important;
  scrollbar-width: none !important;
}

.dictionary-chips::-webkit-scrollbar {
  display: none !important;
}

.dictionary-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 34px !important;
  padding: 7px 11px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--polish-ink) !important;
  font-size: 14px !important;
  flex: 0 0 auto !important;
}

.dictionary-chip strong {
  font-weight: 650 !important;
  white-space: nowrap !important;
}

.dictionary-chip em {
  color: var(--polish-muted) !important;
  font-style: normal !important;
}

.lesson-tools {
  display: flex !important;
  flex: 0 0 auto !important;
  gap: 10px !important;
}

.task-card {
  grid-area: task !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--polish-work) !important;
  box-shadow: none !important;
}

.task-card::before {
  display: none !important;
}

#taskContent {
  width: min(880px, 100%) !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow: auto !important;
  padding: 8px clamp(30px, 3vw, 46px) 0 !important;
}

.task-actions {
  width: min(880px, 100%) !important;
  flex: 0 0 auto !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: 0 clamp(30px, 3vw, 46px) 0 !important;
  padding: 18px clamp(26px, 2.7vw, 38px) 24px !important;
  border: 0 !important;
  border-top: 1px solid var(--polish-line) !important;
  border-radius: 0 0 26px 26px !important;
  background: #fff !important;
}

.task-title {
  margin: 0 0 10px !important;
  color: var(--polish-ink) !important;
  font-size: clamp(34px, 2.8vw, 46px) !important;
  font-weight: 560 !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

.task-note {
  margin: 0 0 clamp(20px, 2.4vh, 30px) !important;
  color: var(--polish-muted) !important;
  font-size: clamp(18px, 1.35vw, 23px) !important;
  font-weight: 460 !important;
  line-height: 1.35 !important;
}

.focus-card,
.chatgpt-card {
  width: 100% !important;
  display: grid !important;
  gap: clamp(13px, 1.5vh, 20px) !important;
  padding: clamp(20px, 2.3vh, 28px) clamp(26px, 2.7vw, 38px) 0 !important;
  border: 0 !important;
  border-radius: 26px 26px 0 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.focus-head,
.task-inline-tools {
  display: flex !important;
  align-items: center !important;
}

.focus-head {
  justify-content: space-between !important;
  gap: 18px !important;
}

.focus-head .micro-head {
  display: block !important;
  margin: 0 !important;
  color: var(--polish-muted) !important;
  font-size: clamp(16px, 1.25vw, 20px) !important;
  font-weight: 520 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.focus-head .micro-head strong {
  display: none !important;
}

.task-inline-tools {
  flex: 0 0 auto !important;
  gap: 12px !important;
}

.listen-button,
.task-inline-tools .listen-button {
  width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 17px !important;
  background: #fff !important;
  color: var(--polish-ink) !important;
  font-size: 19px !important;
  box-shadow: none !important;
}

.lesson-chatgpt-button,
.task-inline-tools .lesson-chatgpt-button {
  border-color: transparent !important;
  background: var(--polish-purple) !important;
}

.prompt-word {
  min-height: clamp(58px, 6vh, 74px) !important;
  display: flex !important;
  align-items: center !important;
  padding: 16px 24px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #e7efff !important;
  color: var(--polish-ink) !important;
  font-size: clamp(30px, 2.5vw, 40px) !important;
  font-weight: 650 !important;
  line-height: 1.1 !important;
}

.gap-sentence {
  display: block !important;
  padding: 4px 0 8px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--polish-ink) !important;
  font-size: clamp(28px, 2.4vw, 38px) !important;
  font-weight: 520 !important;
  line-height: 1.28 !important;
}

.gap-blank {
  display: inline-block !important;
  width: clamp(68px, 5vw, 88px) !important;
  height: .85em !important;
  margin: 0 11px -3px !important;
  border-bottom: 4px solid var(--polish-blue) !important;
  vertical-align: baseline !important;
}

.answer-label {
  margin: 2px 0 -10px !important;
  color: var(--polish-ink) !important;
  font-size: clamp(17px, 1.3vw, 21px) !important;
  font-weight: 560 !important;
}

input,
textarea {
  min-height: clamp(56px, 5.8vh, 70px) !important;
  padding: 0 24px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 17px !important;
  background: var(--polish-soft) !important;
  color: var(--polish-ink) !important;
  font-size: clamp(18px, 1.5vw, 24px) !important;
  font-weight: 460 !important;
}

input:focus,
textarea:focus {
  border-color: var(--polish-blue) !important;
  box-shadow: 0 0 0 4px rgba(59, 104, 242, .12) !important;
}

input.answer-correct,
textarea.answer-correct {
  border-color: #74d8bf !important;
  background: var(--polish-green) !important;
}

input.answer-incorrect,
textarea.answer-incorrect {
  border-color: #f0a5ae !important;
  background: var(--polish-red-soft) !important;
}

.option-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.option-chip {
  min-height: 44px !important;
  padding: 8px 17px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #e8f0ff !important;
  color: var(--polish-ink) !important;
  font-size: clamp(16px, 1.2vw, 19px) !important;
  font-weight: 560 !important;
}

.option-chip:nth-child(2n) {
  background: var(--polish-green) !important;
}

.option-chip:nth-child(3n) {
  background: var(--polish-purple-soft) !important;
}

.option-chip:nth-child(4n) {
  background: var(--polish-yellow) !important;
}

.option-chip.selected {
  box-shadow: inset 0 0 0 2px var(--polish-blue) !important;
}

.feedback {
  min-height: 22px !important;
  color: var(--polish-muted) !important;
  font-size: 16px !important;
}

.feedback.good {
  color: #259776 !important;
}

.feedback.bad {
  color: var(--polish-red) !important;
}

.primary-button,
.ghost-button {
  min-height: 54px !important;
  padding: 0 30px !important;
  border-radius: 18px !important;
  font-size: clamp(18px, 1.5vw, 23px) !important;
  font-weight: 520 !important;
}

.primary-button {
  border-color: transparent !important;
  background: var(--polish-blue) !important;
  color: #fff !important;
}

.primary-button:hover:not(:disabled) {
  background: var(--polish-blue-hover) !important;
}

.ghost-button {
  border: 1px solid var(--polish-line) !important;
  background: #fff !important;
  color: var(--polish-ink) !important;
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: .5 !important;
}

#prevBtn::before {
  content: "←";
  margin-right: 12px;
}

#nextBtn::after {
  content: "→";
  margin-left: 12px;
}

.steps {
  grid-area: steps !important;
  position: relative !important;
  top: auto !important;
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(34px, 5vh, 58px) clamp(20px, 1.7vw, 30px) !important;
  overflow: auto !important;
  border: 0 !important;
  border-left: 1px solid var(--polish-line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.steps::before {
  content: attr(data-caption) !important;
  display: block !important;
  margin: 0 10px 20px !important;
  color: var(--polish-muted) !important;
  font-size: clamp(20px, 1.55vw, 26px) !important;
  font-weight: 460 !important;
}

.step-tab.route-group {
  width: 100% !important;
  min-height: 86px !important;
  display: grid !important;
  grid-template-columns: 50px minmax(0, 1fr) !important;
  gap: 16px !important;
  padding: 12px 14px !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: transparent !important;
  color: var(--polish-muted) !important;
  text-align: left !important;
}

.step-tab.route-group span {
  width: 50px !important;
  height: 50px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 15px !important;
  background: #edf4ff !important;
  color: var(--polish-blue) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
}

.step-tab.route-group small {
  display: block !important;
  color: inherit !important;
  line-height: 1.18 !important;
}

.step-tab.route-group small strong,
.step-tab.route-group small em {
  display: block !important;
  font-style: normal !important;
}

.step-tab.route-group small strong {
  margin-bottom: 4px !important;
  color: inherit !important;
  font-size: clamp(20px, 1.45vw, 25px) !important;
  font-weight: 580 !important;
}

.step-tab.route-group small em {
  color: inherit !important;
  font-size: clamp(16px, 1.15vw, 20px) !important;
  font-weight: 460 !important;
}

.step-tab.route-group.completed {
  background: var(--polish-green) !important;
  color: var(--polish-ink) !important;
}

.step-tab.route-group.completed span {
  background: var(--polish-green-mark) !important;
  color: var(--polish-ink) !important;
}

.step-tab.route-group.active,
.step-tab.route-group.completed.active {
  background: var(--polish-blue) !important;
  color: #fff !important;
}

.step-tab.route-group.active span,
.step-tab.route-group.completed.active span {
  background: rgba(255, 255, 255, .2) !important;
  color: #fff !important;
}

.step-tab.route-group:disabled {
  opacity: .54 !important;
}

.word-list {
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.word-list li {
  display: flex !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  background: #f6f9ff !important;
}

.result-box,
.share-card-button {
  border-radius: 18px !important;
}

.sentence-order-list {
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.sentence-order-row {
  list-style: none !important;
}

.sentence-order-row.is-dragging {
  opacity: .58 !important;
}

.sentence-order-row.is-correct .sentence-order-item {
  border-color: #74d8bf !important;
  background: var(--polish-green) !important;
}

.sentence-order-row.is-wrong .sentence-order-item {
  border-color: #f0a5ae !important;
  background: var(--polish-red-soft) !important;
}

.sentence-order-item {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 44px 38px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
  padding: 12px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .82) !important;
  color: inherit !important;
  text-align: left !important;
  user-select: none !important;
}

.order-drag-handle {
  width: 44px !important;
  height: 44px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: var(--polish-blue) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  cursor: grab !important;
  touch-action: none !important;
}

.sentence-order-row.is-dragging .order-drag-handle {
  cursor: grabbing !important;
}

.sentence-order-item span {
  width: 38px !important;
  height: 38px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  background: #edf4ff !important;
  color: var(--polish-blue) !important;
  font-size: 17px !important;
  font-weight: 650 !important;
}

.sentence-order-item p {
  margin: 0 !important;
  color: var(--polish-ink) !important;
  font-size: clamp(15px, 1.05vw, 17px) !important;
  font-weight: 520 !important;
  line-height: 1.35 !important;
}

@media (max-height: 820px) and (min-width: 981px) {
  body {
    padding-top: 8px !important;
  }

  .date-panel,
  .app-shell.sidebar-collapsed .date-panel {
    min-height: 50px !important;
    margin-bottom: 6px !important;
  }

  .topbar {
    min-height: 92px !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }

  .brand-mark {
    width: 52px !important;
    height: 52px !important;
  }

  .brand strong {
    font-size: 22px !important;
  }

  .brand small {
    font-size: 15px !important;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    height: calc(100vh - 156px) !important;
    min-height: 560px !important;
  }

  .lesson-hero {
    padding-top: 12px !important;
    padding-bottom: 8px !important;
  }

  .lesson-hero h2 {
    margin-bottom: 8px !important;
    font-size: 22px !important;
  }

  #taskContent {
    padding-top: 8px !important;
  }

  .task-title {
    font-size: 32px !important;
  }

  .task-note {
    margin-bottom: 14px !important;
    font-size: 16px !important;
  }

  .focus-card,
  .chatgpt-card {
    gap: 10px !important;
    padding-top: 16px !important;
  }

  .prompt-word,
  input,
  textarea {
    min-height: 50px !important;
  }

  .option-chip {
    min-height: 40px !important;
    font-size: 15px !important;
  }

  .task-actions {
    padding-top: 14px !important;
    padding-bottom: 18px !important;
  }

  .primary-button,
  .ghost-button {
    min-height: 48px !important;
    font-size: 18px !important;
  }
}

/* Minimal E123 pass */
body {
  gap: 8px !important;
  background: #f6f8fc !important;
}

.topbar,
.date-panel,
.app-shell,
.app-shell.sidebar-collapsed {
  box-shadow: none !important;
}

.topbar,
.date-panel {
  background: #fff !important;
}

.topbar {
  min-height: 72px !important;
  padding: 12px 18px !important;
  border-radius: 18px !important;
}

.brand-mark {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

.brand small,
.panel-head .eyebrow,
.dictionary-label,
.task-note,
.lesson-hero .eyebrow,
.steps::before,
.feedback:empty {
  display: none !important;
}

.date-panel,
.app-shell.sidebar-collapsed .date-panel {
  min-height: 56px !important;
  padding: 7px 10px !important;
  border-radius: 16px !important;
}

.panel-head,
.app-shell.sidebar-collapsed .panel-head {
  min-width: 72px !important;
}

.panel-head h1 {
  color: var(--polish-muted) !important;
  font-size: 13px !important;
  font-weight: 620 !important;
  text-transform: uppercase !important;
}

.date-button {
  min-width: 128px !important;
  min-height: 42px !important;
  padding: 6px 10px !important;
  border-radius: 13px !important;
}

.date-button strong {
  font-size: 15px !important;
}

.date-score,
.date-button span span {
  font-size: 11px !important;
}

.app-shell,
.app-shell.sidebar-collapsed {
  height: calc(100vh - 160px) !important;
  min-height: 540px !important;
  border-radius: 18px !important;
}

.task-panel {
  background: #f1f6ff !important;
}

.lesson-hero {
  padding: 18px clamp(22px, 2.7vw, 38px) 10px !important;
}

.lesson-hero h2 {
  margin-bottom: 10px !important;
  font-size: clamp(21px, 1.55vw, 27px) !important;
  font-weight: 610 !important;
}

.dictionary-chips {
  gap: 7px !important;
}

.dictionary-chip {
  min-height: 30px !important;
  padding: 5px 9px !important;
  border-radius: 10px !important;
  background: #fff !important;
  font-size: 13px !important;
}

.lesson-tools,
.task-inline-tools {
  display: none !important;
}

#taskContent {
  padding: 10px clamp(22px, 2.7vw, 38px) 0 !important;
}

.task-title {
  margin-bottom: 16px !important;
  font-size: clamp(32px, 2.6vw, 42px) !important;
  font-weight: 620 !important;
}

.focus-card,
.chatgpt-card {
  padding: 22px clamp(22px, 2.5vw, 34px) 0 !important;
  border-radius: 18px 18px 0 0 !important;
}

.prompt-word {
  min-height: 64px !important;
  border-radius: 14px !important;
  font-size: clamp(28px, 2.45vw, 38px) !important;
}

input,
textarea {
  min-height: 58px !important;
  border-radius: 14px !important;
}

.steps {
  padding: 24px 18px !important;
}

.step-tab.route-group {
  min-height: 70px !important;
  border-radius: 14px !important;
}

.step-tab.route-group small em:empty {
  display: none !important;
}

.task-actions {
  padding-top: 14px !important;
  padding-bottom: 18px !important;
}

@media (max-width: 980px) {
  body {
    gap: 0 !important;
    background: #f6f8fc !important;
  }

  .topbar {
    min-height: 58px !important;
    padding: 8px 10px !important;
  }

  .date-panel,
  .app-shell.sidebar-collapsed .date-panel {
    min-height: 54px !important;
    padding: 7px 10px !important;
  }

  .panel-head {
    display: none !important;
  }

  .date-button {
    min-width: 106px !important;
    min-height: 40px !important;
  }

  .lesson-hero {
    padding: 12px 10px 8px !important;
  }

  .lesson-hero h2 {
    font-size: 20px !important;
  }

  .task-title {
    margin-bottom: 14px !important;
    font-size: 27px !important;
  }

  .focus-card,
  .chatgpt-card {
    padding-top: 14px !important;
  }
}

/* Sentence order without inner buttons */
.order-drag-handle {
  display: none !important;
}

.sentence-order-row {
  touch-action: none !important;
}

.sentence-order-item {
  grid-template-columns: 38px minmax(0, 1fr) !important;
  cursor: grab !important;
  touch-action: none !important;
}

.sentence-order-row.is-dragging .sentence-order-item {
  cursor: grabbing !important;
  opacity: .72 !important;
  background: #eef4ff !important;
  border-color: var(--polish-blue) !important;
}

.sentence-order-row.is-selected .sentence-order-item {
  border-color: var(--polish-blue) !important;
  background: #eef4ff !important;
  box-shadow: inset 0 0 0 1px rgba(61, 104, 242, .2) !important;
}

@media (max-width: 980px) {
  .sentence-order-item {
    grid-template-columns: 32px minmax(0, 1fr) !important;
  }
}

@media (max-width: 980px) {
  body {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 0 calc(76px + env(safe-area-inset-bottom)) !important;
    overflow: auto !important;
  }

  .topbar {
    order: 1 !important;
  }

  .date-panel {
    order: 2 !important;
  }

  .app-shell {
    order: 3 !important;
  }

  .date-panel,
  .topbar,
  .app-shell,
  .app-shell.sidebar-collapsed {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
  }

  .date-panel,
  .app-shell.sidebar-collapsed .date-panel {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding: 8px 10px !important;
  }

  .panel-head {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .date-button {
    min-width: 128px !important;
    min-height: 46px !important;
  }

  .topbar {
    min-height: 64px !important;
    padding: 9px 10px !important;
  }

  .brand {
    gap: 9px !important;
  }

  .brand-mark {
    width: 40px !important;
    height: 40px !important;
    border-radius: 11px !important;
    font-size: 13px !important;
  }

  .brand strong {
    font-size: 18px !important;
  }

  .brand small,
  .header-progress-track {
    display: none !important;
  }

  .header-tools {
    gap: 8px !important;
  }

  .header-progress strong {
    min-width: auto !important;
    font-size: 14px !important;
  }

  .user-button,
  .user-button.is-authenticated {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
  }

  .user-button.is-authenticated {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .task-panel {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "hero"
      "steps"
      "task" !important;
    min-height: 0 !important;
  }

  .lesson-hero {
    padding: 14px 12px 10px !important;
  }

  .lesson-hero .eyebrow {
    margin-bottom: 5px !important;
  }

  .lesson-hero h2 {
    margin-bottom: 8px !important;
    font-size: 20px !important;
  }

  .lesson-summary-row {
    display: grid !important;
    gap: 10px !important;
  }

  .dictionary-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .dictionary-chip {
    width: auto !important;
    min-height: 32px !important;
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    border-radius: 999px !important;
    font-size: 13px !important;
  }

  .lesson-tools {
    justify-content: flex-start !important;
  }

  .steps {
    position: relative !important;
    display: flex !important;
    gap: 8px !important;
    height: auto !important;
    padding: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--polish-line) !important;
  }

  .steps::before {
    display: none !important;
  }

  .step-tab.route-group {
    width: auto !important;
    min-width: 122px !important;
    min-height: 54px !important;
    flex: 0 0 auto !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    padding: 7px 8px !important;
  }

  .step-tab.route-group span {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  .step-tab.route-group small strong,
  .step-tab.route-group small em {
    font-size: 12px !important;
  }

  .task-card {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  #taskContent {
    width: 100% !important;
    padding: 24px 10px 0 !important;
    overflow: visible !important;
  }

  .task-title {
    font-size: 28px !important;
  }

  .task-note {
    margin-bottom: 18px !important;
    font-size: 17px !important;
  }

  .focus-card,
  .chatgpt-card {
    gap: 16px !important;
    padding: 18px 14px 0 !important;
    border-radius: 14px 14px 0 0 !important;
  }

  .focus-head .micro-head {
    font-size: 15px !important;
  }

  .listen-button,
  .task-inline-tools .listen-button {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
  }

  .prompt-word,
  input,
  textarea {
    min-height: 58px !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 18px !important;
  }

  .gap-sentence {
    font-size: 24px !important;
  }

  .gap-blank {
    width: 62px !important;
    border-bottom-width: 4px !important;
  }

  .answer-label {
    font-size: 18px !important;
  }

  .option-grid {
    gap: 8px !important;
  }

  .option-chip {
    min-height: 42px !important;
    padding: 8px 14px !important;
    font-size: 16px !important;
  }

  .sentence-order-list {
    gap: 8px !important;
  }

  .sentence-order-item {
    grid-template-columns: 40px 32px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 10px !important;
    border-radius: 14px !important;
  }

  .order-drag-handle {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
  }

  .sentence-order-item span {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  .sentence-order-item p {
    font-size: 14px !important;
  }

  .task-actions {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 20 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-top: 1px solid var(--polish-line) !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .primary-button,
  .ghost-button {
    min-height: 48px !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 980px) {
  body {
    display: flex !important;
    flex-direction: column !important;
  }

  body > .topbar {
    order: 1 !important;
  }

  body > .date-panel {
    order: 2 !important;
  }

  body > .app-shell {
    order: 3 !important;
  }
}

/* Clean E123 interface pass */
:root {
  --polish-ink: #162033;
  --polish-muted: #66738c;
  --polish-soft: #f7f9fd;
  --polish-work: #edf4ff;
  --polish-line: #d9e4f5;
  --polish-blue: #3d68f2;
  --polish-blue-hover: #315ade;
  --polish-green: #d8f4ec;
  --polish-green-mark: #a4e6d7;
  --polish-purple: #d6c4fb;
  --polish-purple-soft: #efe9ff;
  --polish-yellow: #fff0a8;
  --polish-shell: min(1480px, calc(100vw - 32px));
  --polish-side: clamp(300px, 22vw, 350px);
}

html,
body {
  min-width: 0 !important;
}

body {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 100vh !important;
  padding: 14px 0 18px !important;
  overflow-x: hidden !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(61, 104, 242, .08), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f3f7ff 100%) !important;
  color: var(--polish-ink) !important;
}

body > .topbar {
  order: 1 !important;
}

body > .date-panel {
  order: 2 !important;
}

body > .app-shell {
  order: 3 !important;
}

.topbar,
.date-panel,
.app-shell,
.app-shell.sidebar-collapsed {
  width: var(--polish-shell) !important;
  max-width: var(--polish-shell) !important;
  margin: 0 auto !important;
  transform: none !important;
}

.topbar {
  min-height: 82px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 22px !important;
  padding: 16px 22px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 18px 48px rgba(66, 90, 130, .08) !important;
}

.brand {
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.brand-mark {
  width: 54px !important;
  height: 54px !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, #4774ff 0%, #345ff0 100%) !important;
  color: #fff !important;
  font-size: 17px !important;
  font-weight: 560 !important;
  box-shadow: 0 10px 24px rgba(61, 104, 242, .24) !important;
}

.brand strong {
  font-size: 24px !important;
  font-weight: 620 !important;
  letter-spacing: 0 !important;
}

.brand small {
  margin-top: 4px !important;
  color: var(--polish-muted) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

.header-tools {
  gap: 18px !important;
}

.header-progress {
  gap: 15px !important;
}

.header-progress-track {
  width: clamp(140px, 15vw, 220px) !important;
  height: 8px !important;
  background: #e7eefb !important;
}

.header-progress strong {
  min-width: 104px !important;
  font-size: clamp(20px, 1.7vw, 29px) !important;
  font-weight: 610 !important;
}

.user-button,
.user-button.is-authenticated {
  width: auto !important;
  min-width: 54px !important;
  max-width: 210px !important;
  height: 54px !important;
  min-height: 54px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 16px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 17px !important;
  background: #fff !important;
  color: var(--polish-ink) !important;
  font-size: 14px !important;
  font-weight: 620 !important;
  white-space: nowrap !important;
}

.user-button.is-authenticated {
  font-size: 0 !important;
}

.user-button.is-authenticated::before {
  content: "◎";
  font-size: 27px !important;
  line-height: 1 !important;
}

.date-panel,
.app-shell.sidebar-collapsed .date-panel {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 68px !important;
  padding: 10px 14px !important;
  overflow: hidden !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: 0 14px 36px rgba(66, 90, 130, .06) !important;
}

.sidebar-toggle {
  display: none !important;
}

.panel-head,
.app-shell.sidebar-collapsed .panel-head {
  display: grid !important;
  gap: 0 !important;
  min-width: 104px !important;
  padding: 0 4px !important;
}

.panel-head .eyebrow {
  margin: 0 !important;
  font-size: 11px !important;
  font-weight: 780 !important;
  color: var(--polish-blue) !important;
}

.panel-head h1 {
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 620 !important;
  line-height: 1.05 !important;
}

.date-list,
.app-shell.sidebar-collapsed .date-list {
  display: flex !important;
  gap: 10px !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 1px 2px 2px !important;
  scroll-padding-left: 8px !important;
}

.date-button {
  min-width: 142px !important;
  min-height: 48px !important;
  padding: 7px 12px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 15px !important;
  background: #fff !important;
  color: var(--polish-muted) !important;
}

.date-button strong {
  font-size: 17px !important;
  font-weight: 650 !important;
}

.date-score,
.date-button span span {
  font-size: 12px !important;
  font-weight: 560 !important;
}

.date-button.active {
  border-color: var(--polish-blue) !important;
  background: #edf4ff !important;
  color: var(--polish-ink) !important;
  box-shadow: inset 0 0 0 1px rgba(61, 104, 242, .16) !important;
}

.date-button.completed {
  border-color: #bde6dd !important;
  background: var(--polish-green) !important;
}

.app-shell,
.app-shell.sidebar-collapsed {
  height: calc(100vh - 214px) !important;
  min-height: 560px !important;
  overflow: hidden !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 24px !important;
  background: #fff !important;
  box-shadow: 0 24px 70px rgba(66, 90, 130, .1) !important;
}

.task-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--polish-side) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "hero steps"
    "task steps" !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  background: var(--polish-work) !important;
}

.lesson-hero {
  grid-area: hero !important;
  padding: 22px clamp(24px, 3.2vw, 48px) 14px !important;
  background: var(--polish-work) !important;
}

.lesson-hero .eyebrow {
  margin: 0 0 6px !important;
  font-size: 13px !important;
  font-weight: 760 !important;
}

.lesson-hero h2 {
  margin: 0 0 12px !important;
  font-size: clamp(22px, 1.9vw, 30px) !important;
  font-weight: 600 !important;
  line-height: 1.08 !important;
}

.lesson-summary-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
}

#lessonSummary {
  min-width: 0 !important;
  overflow: hidden !important;
}

.dictionary-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--polish-muted) !important;
}

.dictionary-chips {
  max-width: 100% !important;
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 2px !important;
}

.dictionary-chip {
  min-height: 32px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  background: rgba(255, 255, 255, .86) !important;
}

.lesson-tools {
  gap: 10px !important;
}

.listen-button,
.task-inline-tools .listen-button {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  border-radius: 15px !important;
}

.task-card {
  grid-area: task !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: var(--polish-work) !important;
}

#taskContent {
  width: min(860px, 100%) !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 12px clamp(24px, 3.2vw, 48px) 0 !important;
}

.task-title {
  margin: 0 0 8px !important;
  font-size: clamp(34px, 3vw, 46px) !important;
  font-weight: 610 !important;
  line-height: 1.05 !important;
}

.task-note {
  margin: 0 0 clamp(18px, 2.2vh, 28px) !important;
  font-size: clamp(17px, 1.35vw, 22px) !important;
  line-height: 1.35 !important;
}

.focus-card,
.chatgpt-card {
  gap: clamp(14px, 1.8vh, 20px) !important;
  padding: clamp(20px, 2.4vh, 28px) clamp(24px, 2.8vw, 38px) 0 !important;
  border-radius: 24px 24px 0 0 !important;
  background: rgba(255, 255, 255, .98) !important;
}

.prompt-word {
  min-height: clamp(62px, 7vh, 82px) !important;
  padding: 16px 24px !important;
  border-radius: 18px !important;
  font-size: clamp(28px, 2.8vw, 42px) !important;
}

input,
textarea {
  min-height: clamp(58px, 6vh, 72px) !important;
  border-radius: 17px !important;
  font-size: clamp(18px, 1.45vw, 23px) !important;
}

.task-actions {
  width: min(860px, 100%) !important;
  margin: 0 clamp(24px, 3.2vw, 48px) !important;
  padding: 16px clamp(24px, 2.8vw, 38px) 22px !important;
  border-top: 1px solid var(--polish-line) !important;
  background: #fff !important;
}

.primary-button,
.ghost-button {
  min-height: 52px !important;
  border-radius: 17px !important;
  font-size: clamp(17px, 1.3vw, 21px) !important;
}

.steps {
  grid-area: steps !important;
  height: 100% !important;
  padding: 32px 22px !important;
  overflow: auto !important;
  border-left: 1px solid var(--polish-line) !important;
  background: #fff !important;
}

.steps::before {
  margin: 0 10px 20px !important;
  font-size: clamp(18px, 1.4vw, 23px) !important;
  color: var(--polish-muted) !important;
}

.step-tab.route-group {
  min-height: 78px !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 11px 13px !important;
  border-radius: 18px !important;
}

.step-tab.route-group span {
  width: 46px !important;
  height: 46px !important;
  border-radius: 14px !important;
  font-size: 20px !important;
}

.step-tab.route-group small strong {
  font-size: clamp(18px, 1.25vw, 22px) !important;
}

.step-tab.route-group small em {
  font-size: clamp(14px, 1vw, 18px) !important;
}

.sentence-order-list {
  gap: 9px !important;
}

.sentence-order-item {
  grid-template-columns: 42px 34px minmax(0, 1fr) !important;
  padding: 11px !important;
}

@media (max-height: 820px) and (min-width: 981px) {
  body {
    gap: 8px !important;
    padding-top: 8px !important;
  }

  .topbar {
    min-height: 72px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  .date-panel {
    min-height: 58px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    height: calc(100vh - 176px) !important;
    min-height: 500px !important;
  }
}

@media (max-width: 980px) {
  body {
    gap: 0 !important;
    padding: 0 0 calc(72px + env(safe-area-inset-bottom)) !important;
    background: #f3f7ff !important;
  }

  .topbar,
  .date-panel,
  .app-shell,
  .app-shell.sidebar-collapsed {
    width: 100% !important;
    max-width: 100% !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .topbar {
    min-height: 62px !important;
    padding: 9px 10px !important;
    border-top: 0 !important;
  }

  .brand {
    gap: 9px !important;
  }

  .brand-mark {
    width: 42px !important;
    height: 42px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
  }

  .brand strong {
    font-size: 19px !important;
  }

  .brand small,
  .header-progress-track {
    display: none !important;
  }

  .header-tools {
    gap: 8px !important;
  }

  .header-progress strong {
    min-width: auto !important;
    font-size: 15px !important;
  }

  .user-button,
  .user-button.is-authenticated {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    font-size: 0 !important;
  }

  .user-button::before {
    content: "◎";
    font-size: 24px !important;
    line-height: 1 !important;
  }

  .date-panel,
  .app-shell.sidebar-collapsed .date-panel {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    min-height: 78px !important;
    padding: 8px 10px 9px !important;
    border-top: 0 !important;
  }

  .panel-head {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 0 !important;
  }

  .panel-head .eyebrow {
    font-size: 10px !important;
  }

  .panel-head h1 {
    font-size: 15px !important;
  }

  .date-list {
    gap: 8px !important;
  }

  .date-button {
    min-width: 116px !important;
    min-height: 44px !important;
    padding: 6px 9px !important;
    border-radius: 14px !important;
  }

  .date-button strong {
    font-size: 15px !important;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    border-bottom: 0 !important;
  }

  .task-panel {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "hero"
      "steps"
      "task" !important;
    min-height: 0 !important;
  }

  .lesson-hero {
    padding: 14px 12px 10px !important;
  }

  .lesson-hero h2 {
    font-size: 21px !important;
  }

  .lesson-summary-row {
    grid-template-columns: 1fr !important;
  }

  .dictionary-chip {
    font-size: 13px !important;
  }

  .lesson-tools {
    justify-content: flex-start !important;
  }

  .steps {
    display: flex !important;
    gap: 8px !important;
    height: auto !important;
    padding: 8px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--polish-line) !important;
  }

  .steps::before {
    display: none !important;
  }

  .step-tab.route-group {
    width: auto !important;
    min-width: 118px !important;
    min-height: 54px !important;
    flex: 0 0 auto !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 7px 8px !important;
  }

  .step-tab.route-group span {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  .step-tab.route-group small strong,
  .step-tab.route-group small em {
    font-size: 12px !important;
  }

  #taskContent {
    width: 100% !important;
    padding: 18px 10px 0 !important;
    overflow: visible !important;
  }

  .task-title {
    font-size: 28px !important;
  }

  .task-note {
    margin-bottom: 16px !important;
    font-size: 16px !important;
  }

  .focus-card,
  .chatgpt-card {
    gap: 14px !important;
    padding: 16px 12px 0 !important;
    border-radius: 18px 18px 0 0 !important;
  }

  .prompt-word,
  input,
  textarea {
    min-height: 56px !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    font-size: 18px !important;
  }

  .prompt-word {
    font-size: 28px !important;
  }

  .gap-sentence {
    font-size: 22px !important;
  }

  .task-actions {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 20 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important;
  }

  .primary-button,
  .ghost-button {
    min-height: 48px !important;
    padding: 0 15px !important;
    border-radius: 14px !important;
    font-size: 16px !important;
  }
}

/* Final order task polish */
.sentence-order-list {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.sentence-order-placeholder {
  width: 100% !important;
  border: 2px dashed rgba(61, 104, 242, .34) !important;
  border-radius: 16px !important;
  background: rgba(61, 104, 242, .06) !important;
  list-style: none !important;
}

.sentence-order-row {
  width: 100% !important;
  min-width: 0 !important;
  list-style: none !important;
  touch-action: none !important;
}

.sentence-order-item {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--polish-line) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .96) !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
}

.sentence-order-item span {
  width: 42px !important;
  height: 42px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  background: #edf4ff !important;
  color: var(--polish-blue) !important;
  font-size: 18px !important;
  font-weight: 650 !important;
}

.sentence-order-item p {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  color: var(--polish-ink) !important;
  font-size: clamp(17px, 1.2vw, 20px) !important;
  font-weight: 520 !important;
  line-height: 1.38 !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

.sentence-order-row.is-dragging {
  opacity: 1 !important;
}

.sentence-order-row.is-dragging .sentence-order-item {
  cursor: grabbing !important;
  border-color: rgba(61, 104, 242, .5) !important;
  background: #fff !important;
  box-shadow: 0 18px 42px rgba(54, 80, 130, .2) !important;
  transform: scale(1.015) !important;
}

.sentence-order-row.is-selected .sentence-order-item {
  border-color: var(--polish-blue) !important;
  background: #eef4ff !important;
}

@media (max-width: 980px) {
  .sentence-order-list {
    gap: 8px !important;
  }

  .sentence-order-item {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 15px !important;
  }

  .sentence-order-item span {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
  }

  .sentence-order-item p {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }
}

/* Dictionary manager */
.user-dropdown {
  min-width: 220px !important;
}

.dictionary-card {
  width: min(620px, calc(100vw - 28px)) !important;
  max-height: calc(100dvh - 28px) !important;
  overflow: auto !important;
  gap: 12px !important;
}

.cabinet-status {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 14px !important;
  border: 1px solid rgba(61, 104, 242, .16) !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, rgba(61, 104, 242, .08), rgba(206, 244, 235, .5)) !important;
}

.cabinet-status div {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

.cabinet-status strong {
  color: var(--polish-ink, #172033) !important;
  font-size: 17px !important;
  font-weight: 760 !important;
}

.cabinet-status span {
  color: var(--polish-muted, #68738a) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.dictionary-card label {
  display: grid !important;
  gap: 7px !important;
  color: var(--polish-muted, #68738a) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.dictionary-card input,
.dictionary-card select,
.dictionary-card textarea {
  width: 100% !important;
  border: 1px solid var(--polish-line, #dbe6f7) !important;
  border-radius: 14px !important;
  background: rgba(248, 251, 255, .96) !important;
  color: var(--polish-ink, #172033) !important;
  outline: 0 !important;
}

.dictionary-card input,
.dictionary-card select {
  min-height: 48px !important;
  padding: 0 14px !important;
}

.dictionary-card textarea {
  min-height: 150px !important;
  padding: 14px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
}

.dictionary-card input:focus,
.dictionary-card select:focus,
.dictionary-card textarea:focus {
  border-color: var(--polish-blue, #3d68f2) !important;
  box-shadow: 0 0 0 4px rgba(61, 104, 242, .12) !important;
}

.dictionary-meta,
.dictionary-message {
  min-height: 20px !important;
  margin: 0 !important;
  color: var(--polish-muted, #68738a) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}

.dictionary-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.dictionary-divider {
  height: 1px !important;
  background: var(--polish-line, #dbe6f7) !important;
  margin: 2px 0 !important;
}

.ghost-button.danger {
  color: #d64545 !important;
}

.ghost-button.danger:disabled {
  color: rgba(104, 115, 138, .45) !important;
}

.dictionary-file input {
  padding: 11px 14px !important;
}

@media (max-width: 600px) {
  .dictionary-card {
    width: calc(100vw - 18px) !important;
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .dictionary-actions {
    grid-template-columns: 1fr !important;
  }

  .cabinet-status {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .dictionary-card textarea {
    min-height: 170px !important;
  }
}

/* Touch answer bank and order handles */
.answer-workbench {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, .9fr) minmax(260px, 1.1fr) !important;
  gap: 12px !important;
  align-items: start !important;
}

.answer-source,
.answer-target {
  min-width: 0 !important;
}

.answer-dropzone {
  width: 100% !important;
  min-height: 62px !important;
  display: flex !important;
  align-items: center !important;
  border: 2px dashed transparent !important;
  border-radius: 17px !important;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease !important;
}

.answer-dropzone input {
  width: 100% !important;
  margin: 0 !important;
}

.answer-dropzone.is-drop-ready {
  border-color: rgba(61, 104, 242, .55) !important;
  background: rgba(61, 104, 242, .07) !important;
  box-shadow: 0 12px 30px rgba(61, 104, 242, .14) !important;
}

.answer-dropzone.has-placed-answer {
  padding: 7px !important;
  border-color: rgba(61, 104, 242, .28) !important;
  background: rgba(247, 250, 255, .98) !important;
}

.answer-dropzone.has-placed-answer.is-correct {
  border-color: rgba(25, 160, 110, .42) !important;
  background: rgba(225, 249, 241, .82) !important;
}

.answer-dropzone.has-placed-answer.is-wrong {
  border-color: rgba(220, 63, 66, .42) !important;
  background: rgba(255, 239, 240, .86) !important;
}

.placed-answer-chip {
  width: 100% !important;
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(61, 104, 242, .18) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #eaf1ff, #d2f3eb) !important;
  color: var(--polish-ink, #172033) !important;
  font-size: 19px !important;
  font-weight: 780 !important;
  text-align: left !important;
  cursor: pointer !important;
  box-shadow: 0 10px 24px rgba(61, 104, 242, .12) !important;
}

.placed-answer-chip span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.placed-answer-chip em {
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .68) !important;
  color: rgba(23, 32, 51, .62) !important;
  font-style: normal !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.answer-shadow-input {
  display: none !important;
}

.interactive-gap-sentence {
  display: block !important;
  color: var(--polish-ink, #172033) !important;
}

.inline-gap-input-wrap {
  display: inline-flex !important;
  width: min(210px, 62vw) !important;
  vertical-align: middle !important;
  margin: 0 6px !important;
}

.inline-gap-input {
  width: 100% !important;
  min-height: 38px !important;
  padding: 0 6px 3px !important;
  border: 0 !important;
  border-bottom: 2px solid rgba(61, 104, 242, .42) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--polish-ink, #172033) !important;
  font-size: inherit !important;
  font-weight: 760 !important;
  text-align: center !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.inline-gap-input:focus {
  border-bottom-color: var(--polish-blue, #3d68f2) !important;
  box-shadow: none !important;
}

.inline-gap-input.answer-correct {
  border-bottom-color: rgba(25, 160, 110, .85) !important;
  background: transparent !important;
}

.inline-gap-input.answer-incorrect {
  border-bottom-color: rgba(220, 63, 66, .85) !important;
  background: transparent !important;
}

.inline-gap-drop {
  min-width: min(260px, 100%) !important;
  display: inline-flex !important;
  vertical-align: middle !important;
  margin: 0 8px !important;
}

.inline-gap-drop .answer-dropzone {
  min-width: 220px !important;
  min-height: 54px !important;
}

.inline-gap-drop .answer-dropzone input {
  min-height: 50px !important;
  text-align: center !important;
}

.inline-gap-drop .placed-answer-chip {
  min-height: 46px !important;
  font-size: 18px !important;
}

.gap-answer-bank {
  margin-top: 18px !important;
}

@media (max-width: 600px) {
  .inline-gap-input-wrap {
    width: min(190px, 100%) !important;
    margin: 4px 3px !important;
  }

  .inline-gap-input {
    min-height: 36px !important;
    font-size: inherit !important;
  }
}

.answer-bank {
  width: 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 0 !important;
}

.answer-option {
  touch-action: none !important;
  user-select: none !important;
  cursor: grab !important;
}

.answer-option.is-dragging {
  opacity: .38 !important;
}

.answer-option-ghost {
  position: fixed !important;
  z-index: 3000 !important;
  pointer-events: none !important;
  list-style: none !important;
  touch-action: none !important;
  opacity: .96 !important;
  box-shadow: 0 18px 40px rgba(43, 72, 136, .2) !important;
  transform-origin: top left !important;
}

.text-audio-button {
  min-height: 42px !important;
  padding: 0 16px !important;
  border: 1px solid var(--polish-line, #dbe6f7) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, .92) !important;
  color: var(--polish-blue, #3d68f2) !important;
  font-size: 15px !important;
  font-weight: 760 !important;
  cursor: pointer !important;
}

.sentence-order-row {
  touch-action: auto !important;
}

.sentence-order-item {
  cursor: default !important;
  touch-action: auto !important;
}

.sentence-order-handle {
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
}

.sentence-order-row.is-dragging .sentence-order-handle {
  cursor: grabbing !important;
}

.sentence-order-item p[data-listen-order-text] {
  cursor: pointer !important;
}

@media (min-width: 981px) {
  .answer-bank {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .answer-bank .option-chip {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 600px) {
  .answer-workbench {
    display: flex !important;
    flex-direction: column !important;
  }

  .answer-target {
    order: 1 !important;
  }

  .answer-source {
    order: 2 !important;
  }

  .answer-bank {
    gap: 8px !important;
  }

  .answer-bank .option-chip {
    min-height: 44px !important;
    padding: 0 13px !important;
    font-size: 15px !important;
  }

  .text-audio-button {
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }
}

/* Unified visual system */
:root {
  --ui-bg: #f6f8fc;
  --ui-surface: #ffffff;
  --ui-surface-soft: #eef4ff;
  --ui-ink: #162033;
  --ui-muted: #68738a;
  --ui-line: #dce6f5;
  --ui-blue: #3d68f2;
  --ui-blue-dark: #2f57d7;
  --ui-mint: #c9f0e7;
  --ui-mint-strong: #7dd8c6;
  --ui-lavender: #d8c7ff;
  --ui-lemon: #fff1a8;
  --ui-red: #d84a5d;
  --ui-red-soft: #fff0f2;
  --ui-radius: 16px;
  --ui-radius-sm: 12px;
  --ui-shadow: 0 18px 48px rgba(50, 70, 115, .08);
  --polish-ink: var(--ui-ink);
  --polish-muted: var(--ui-muted);
  --polish-line: var(--ui-line);
  --polish-blue: var(--ui-blue);
  --polish-blue-hover: var(--ui-blue-dark);
}

body {
  background: var(--ui-bg) !important;
  color: var(--ui-ink) !important;
}

.topbar,
.task-panel,
.task-card,
.focus-card,
.chatgpt-card,
.auth-card {
  border-color: var(--ui-line) !important;
  background: var(--ui-surface) !important;
  box-shadow: var(--ui-shadow) !important;
}

.topbar {
  min-height: 92px !important;
  border-radius: 20px 20px 0 0 !important;
}

.brand-mark {
  border-radius: 16px !important;
  background: var(--ui-blue) !important;
  box-shadow: none !important;
}

.brand strong,
.lesson-hero h2,
.task-title,
.focus-head strong,
.step-tab strong,
.date-button strong,
.header-progress strong,
.prompt-word,
.gap-sentence,
.sentence-order-item p {
  color: var(--ui-ink) !important;
  font-weight: 680 !important;
  letter-spacing: 0 !important;
}

.brand small,
.micro-head span,
.focus-head span,
.step-tab em,
.date-button span span,
.date-score,
.answer-label,
.feedback,
.word-list span,
.dictionary-meta,
.dictionary-message {
  color: var(--ui-muted) !important;
}

.header-progress-track {
  background: #e7eefb !important;
}

.header-progress-track span,
.primary-button,
.step-tab.active,
.date-button.active {
  background: var(--ui-blue) !important;
}

.date-button,
.step-tab,
.option-chip,
.ghost-button,
.user-button,
.text-audio-button,
.share-card-button,
.word-list li,
.result-box,
.dictionary-chip,
.sentence-order-item {
  border-color: var(--ui-line) !important;
  border-radius: var(--ui-radius) !important;
  background: var(--ui-surface) !important;
  box-shadow: none !important;
}

.primary-button,
.share-card-button {
  border: 0 !important;
  color: #fff !important;
  background: var(--ui-blue) !important;
}

.primary-button:hover,
.share-card-button:hover {
  background: var(--ui-blue-dark) !important;
}

.ghost-button,
.user-button,
.text-audio-button {
  color: var(--ui-ink) !important;
}

.primary-button:disabled,
.ghost-button:disabled,
.step-tab:disabled {
  opacity: .45 !important;
  cursor: default !important;
}

.date-button.active,
.step-tab.active {
  color: #fff !important;
}

.date-button.active *,
.step-tab.active * {
  color: #fff !important;
}

.date-button.completed,
.step-tab.completed:not(.active),
.result-box.done {
  border-color: rgba(125, 216, 198, .72) !important;
  background: rgba(201, 240, 231, .72) !important;
  color: var(--ui-ink) !important;
}

.step-tab.completed:not(.active) span,
.date-button.completed strong {
  color: var(--ui-ink) !important;
}

.lesson-hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.lesson-summary-row {
  gap: 12px !important;
}

.dictionary-chip,
.option-chip {
  min-height: 42px !important;
  border-radius: 999px !important;
  background: #fff !important;
}

.option-chip:nth-child(2n),
.option-chip:nth-child(3n),
.option-chip:nth-child(4n) {
  background: #fff !important;
}

.option-chip:hover,
.option-chip:focus-visible {
  border-color: rgba(61, 104, 242, .36) !important;
  background: #f2f6ff !important;
}

.answer-workbench {
  gap: 14px !important;
}

.answer-dropzone {
  border: 1px solid var(--ui-line) !important;
  background: #fff !important;
}

.answer-dropzone.is-drop-ready {
  border-color: rgba(61, 104, 242, .52) !important;
  background: #f2f6ff !important;
  box-shadow: 0 12px 30px rgba(61, 104, 242, .12) !important;
}

.answer-dropzone.has-placed-answer {
  border-color: rgba(61, 104, 242, .24) !important;
  background: #f9fbff !important;
}

.placed-answer-chip {
  border: 1px solid rgba(61, 104, 242, .18) !important;
  border-radius: var(--ui-radius-sm) !important;
  background: #edf4ff !important;
  box-shadow: none !important;
}

.answer-dropzone.has-placed-answer.is-correct,
.answer-correct,
.feedback.good {
  border-color: rgba(125, 216, 198, .85) !important;
  background: rgba(201, 240, 231, .36) !important;
}

.answer-dropzone.has-placed-answer.is-wrong,
.answer-incorrect,
.feedback.bad {
  border-color: rgba(216, 74, 93, .58) !important;
  background: rgba(255, 240, 242, .64) !important;
}

.inline-gap-input {
  border-bottom-color: rgba(61, 104, 242, .42) !important;
  color: var(--ui-ink) !important;
}

.inline-gap-input.answer-correct,
.inline-gap-input.answer-incorrect {
  background: transparent !important;
}

.sentence-order-item {
  grid-template-columns: 42px minmax(0, 1fr) !important;
  gap: 14px !important;
}

.sentence-order-handle {
  background: #edf4ff !important;
  color: var(--ui-blue) !important;
  border-radius: var(--ui-radius-sm) !important;
}

.sentence-order-handle {
  width: 42px !important;
  height: 58px !important;
  display: inline-grid !important;
  grid-template-rows: 12px repeat(3, 4px) 12px !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 3px !important;
  padding: 5px 0 !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
}

.sentence-order-handle em {
  color: var(--ui-blue, #3d68f2) !important;
  font-style: normal !important;
  font-size: 15px !important;
  font-weight: 760 !important;
  line-height: 1 !important;
}

.sentence-order-handle i {
  width: 18px !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: rgba(61, 104, 242, .48) !important;
}

.sentence-order-row.is-correct .sentence-order-item {
  border-color: rgba(125, 216, 198, .85) !important;
  background: rgba(201, 240, 231, .3) !important;
}

.sentence-order-row.is-wrong .sentence-order-item {
  border-color: rgba(216, 74, 93, .5) !important;
  background: rgba(255, 240, 242, .5) !important;
}

.task-actions {
  border-color: var(--ui-line) !important;
  background: rgba(255, 255, 255, .94) !important;
}

.cabinet-status {
  border-color: rgba(61, 104, 242, .16) !important;
  background: #f4f8ff !important;
}

.dictionary-card input,
.dictionary-card select,
.dictionary-card textarea,
.auth-card input {
  border-color: var(--ui-line) !important;
  border-radius: var(--ui-radius-sm) !important;
  background: #fff !important;
}

@media (max-width: 980px) {
  .topbar,
  .task-panel,
  .task-card,
  .focus-card,
  .chatgpt-card {
    border-radius: var(--ui-radius) !important;
  }

  .topbar {
    min-height: 76px !important;
  }

  .task-title {
    font-size: clamp(30px, 8vw, 42px) !important;
  }
}

/* Remove extra visual layers */
.app-shell,
.app-shell.sidebar-collapsed {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.task-panel {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.lesson-hero {
  margin: 0 !important;
  padding: 16px 0 14px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.lesson-hero > div {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.task-card {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

#taskContent {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.focus-card,
.chatgpt-card {
  width: 100% !important;
  margin: 0 !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 20px !important;
  background: var(--ui-surface) !important;
  box-shadow: none !important;
}

.task-title {
  margin-top: 0 !important;
  margin-bottom: 16px !important;
}

.steps {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.task-actions {
  margin-top: 14px !important;
  padding: 12px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.answer-dropzone,
.word-list li,
.sentence-order-item,
.result-box {
  box-shadow: none !important;
}

.prompt-word,
.prompt-word.english {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Stable word colors: bank chips and sentence gaps use the same tone. */
.word-tone-0 {
  --word-tint: rgba(232, 240, 255, .94);
  --word-tint-strong: rgba(221, 232, 255, .98);
  --word-border: rgba(59, 104, 242, .28);
  --word-accent: #3b68f2;
}

.word-tone-1 {
  --word-tint: rgba(216, 246, 237, .94);
  --word-tint-strong: rgba(198, 239, 229, .98);
  --word-border: rgba(57, 174, 145, .28);
  --word-accent: #35a98c;
}

.word-tone-2 {
  --word-tint: rgba(238, 232, 255, .96);
  --word-tint-strong: rgba(227, 216, 255, .98);
  --word-border: rgba(139, 105, 226, .26);
  --word-accent: #8667df;
}

.word-tone-3 {
  --word-tint: rgba(255, 241, 173, .88);
  --word-tint-strong: rgba(255, 235, 137, .94);
  --word-border: rgba(218, 171, 40, .28);
  --word-accent: #d5a12b;
}

.word-tone-4 {
  --word-tint: rgba(255, 231, 237, .92);
  --word-tint-strong: rgba(255, 218, 228, .96);
  --word-border: rgba(210, 91, 117, .24);
  --word-accent: #cf5b75;
}

.answer-bank .option-chip[class*="word-tone-"] {
  border: 1px solid var(--word-border) !important;
  background: var(--word-tint) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72) !important;
}

.answer-bank .option-chip[class*="word-tone-"]:hover,
.answer-bank .option-chip[class*="word-tone-"]:focus-visible {
  border-color: var(--word-accent) !important;
  background: var(--word-tint-strong) !important;
}

.gap-card .gap-sentence,
.interactive-gap-sentence {
  font-size: clamp(20px, 1.45vw, 27px) !important;
  font-weight: 560 !important;
  line-height: 1.48 !important;
}

.inline-gap-input-wrap[class*="word-tone-"] {
  width: clamp(72px, calc((var(--gap-ch, 7) * 1ch) + 24px), 156px) !important;
  display: inline-block !important;
  margin: 0 .18em !important;
  padding: 0 !important;
  border: 1px solid var(--word-border) !important;
  border-radius: 12px !important;
  background: var(--word-tint) !important;
  vertical-align: -.18em !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .68) !important;
}

.inline-gap-input[class*="word-tone-"] {
  min-height: 34px !important;
  height: 36px !important;
  padding: 0 8px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ui-ink, #172033) !important;
  font-size: .9em !important;
  font-weight: 680 !important;
  line-height: 36px !important;
  text-align: center !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.inline-gap-input-wrap[class*="word-tone-"]:focus-within {
  border-color: var(--word-accent) !important;
  background: var(--word-tint-strong) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72), 0 0 0 3px rgba(59, 104, 242, .08) !important;
}

.inline-gap-input[class*="word-tone-"].answer-correct {
  background: rgba(201, 240, 231, .46) !important;
  color: var(--ui-ink, #172033) !important;
}

.inline-gap-input[class*="word-tone-"].answer-incorrect {
  background: transparent !important;
  color: var(--ui-ink, #172033) !important;
}

.inline-gap-input-wrap.is-correct,
.inline-gap-input-wrap:has(.inline-gap-input.answer-correct) {
  border-color: rgba(68, 180, 142, .7) !important;
  background: rgba(201, 240, 231, .64) !important;
}

.inline-gap-input-wrap.is-wrong,
.inline-gap-input-wrap:has(.inline-gap-input.answer-incorrect) {
  border-color: rgba(216, 74, 93, .58) !important;
  background: rgba(255, 240, 242, .52) !important;
}

@media (max-width: 980px) {
  .lesson-hero {
    padding: 10px 0 12px !important;
  }

  .focus-card,
  .chatgpt-card {
    border-radius: 18px !important;
  }

  .task-actions {
    background: rgba(246, 248, 252, .94) !important;
    backdrop-filter: blur(14px) !important;
  }

  .gap-card .gap-sentence,
  .interactive-gap-sentence {
    font-size: clamp(20px, 5vw, 26px) !important;
    line-height: 1.5 !important;
  }

  .inline-gap-input-wrap[class*="word-tone-"] {
    width: clamp(66px, calc((var(--gap-ch, 7) * 1ch) + 18px), 132px) !important;
    margin: 0 .12em !important;
    border-radius: 10px !important;
  }

  .inline-gap-input[class*="word-tone-"] {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 6px !important;
    line-height: 34px !important;
  }
}

/* Compact audio controls */
.audio-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
}

.audio-button,
.listen-button.audio-play-button,
.listen-button.audio-pause-button,
.listen-button.audio-stop-button {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid var(--ui-line, #dbe6f7) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, .92) !important;
  color: var(--ui-ink, #172033) !important;
  font-size: 17px !important;
  font-weight: 720 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.audio-button:hover,
.audio-button:focus-visible,
.listen-button.audio-play-button:hover,
.listen-button.audio-pause-button:hover,
.listen-button.audio-stop-button:hover {
  border-color: rgba(59, 104, 242, .32) !important;
  background: #f2f6ff !important;
}

.audio-button.is-active,
.listen-button.is-active {
  border-color: rgba(59, 104, 242, .2) !important;
  background: var(--ui-blue, #3d68f2) !important;
  color: #fff !important;
}

.audio-button:disabled,
.listen-button.audio-pause-button:disabled,
.listen-button.audio-stop-button:disabled {
  opacity: .34 !important;
}

.lesson-tools .audio-pause-button,
.lesson-tools .audio-stop-button {
  display: none !important;
}

@media (max-width: 980px) {
  .audio-controls {
    gap: 6px !important;
  }

  .audio-button {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 13px !important;
    font-size: 16px !important;
  }
}

/* Polished reorder handle */
.sentence-order-item {
  grid-template-columns: 48px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
}

.sentence-order-handle {
  position: relative !important;
  width: 44px !important;
  height: 60px !important;
  display: grid !important;
  grid-template-rows: 12px repeat(3, 4px) 12px !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 4px !important;
  padding: 6px 0 !important;
  border: 1px solid rgba(59, 104, 242, .14) !important;
  border-radius: 17px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(237, 244, 255, .82)) !important;
  color: var(--ui-blue, #3d68f2) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72) !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
}

.sentence-order-handle::before,
.sentence-order-handle::after {
  content: "" !important;
  width: 9px !important;
  height: 9px !important;
  border-color: var(--ui-blue, #3d68f2) !important;
  opacity: .86 !important;
}

.sentence-order-handle::before {
  border-top: 3px solid !important;
  border-left: 3px solid !important;
  transform: rotate(45deg) translate(1px, 2px) !important;
}

.sentence-order-handle::after {
  border-right: 3px solid !important;
  border-bottom: 3px solid !important;
  transform: rotate(45deg) translate(-1px, -2px) !important;
}

.sentence-order-handle i {
  width: 18px !important;
  height: 3px !important;
  display: block !important;
  border-radius: 999px !important;
  background: rgba(59, 104, 242, .48) !important;
}

.sentence-order-row.is-dragging .sentence-order-handle,
.sentence-order-handle:active {
  border-color: rgba(59, 104, 242, .32) !important;
  background: linear-gradient(180deg, rgba(237, 244, 255, .98), rgba(218, 230, 255, .96)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .76), 0 8px 18px rgba(59, 104, 242, .12) !important;
  cursor: grabbing !important;
}

@media (max-width: 980px) {
  .sentence-order-item {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .sentence-order-handle {
    width: 40px !important;
    height: 54px !important;
    border-radius: 15px !important;
    gap: 3px !important;
  }

  .sentence-order-handle i {
    width: 16px !important;
  }
}

/* Step note under the day heading, not the old dictionary chip panel. */
#lessonSummary {
  display: block !important;
  margin: 4px 0 0 !important;
  color: var(--ui-muted, #66708a) !important;
  font-size: clamp(15px, 4vw, 18px) !important;
  font-weight: 520 !important;
  line-height: 1.35 !important;
}

#lessonSummary[hidden],
#lessonSummary:empty {
  display: none !important;
}

.lesson-summary-row {
  align-items: flex-start !important;
}

.task-tool-strip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
}

.chatgpt-action-button {
  background: rgba(238, 232, 255, .92) !important;
  color: #5f46c7 !important;
  border-color: rgba(139, 105, 226, .22) !important;
}

.chatgpt-action-button:hover,
.chatgpt-action-button:focus-visible {
  background: rgba(227, 216, 255, .98) !important;
  border-color: rgba(139, 105, 226, .42) !important;
}

/* Calm mobile polish: fewer nested frames and clearer typography. */
.share-status {
  display: none !important;
}

.english-task-card,
.russian-task-card {
  border-color: rgba(214, 225, 244, .78) !important;
}

.english-task-card .focus-head,
.russian-task-card .focus-head {
  align-items: center !important;
}

.english-task-card .micro-head span,
.russian-task-card .micro-head span {
  font-size: 17px !important;
  font-weight: 600 !important;
}

.english-task-card .micro-head strong,
.russian-task-card .micro-head strong {
  display: none !important;
}

.prompt-word,
.prompt-word.english {
  font-size: clamp(28px, 6.8vw, 38px) !important;
  font-weight: 650 !important;
  line-height: 1.16 !important;
}

.answer-label {
  margin: 12px 0 6px !important;
  font-size: clamp(17px, 4.4vw, 20px) !important;
  font-weight: 610 !important;
}

.answer-workbench {
  gap: 16px !important;
}

.answer-dropzone.has-placed-answer,
.answer-dropzone.has-placed-answer.is-correct,
.answer-dropzone.has-placed-answer.is-wrong {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.placed-answer-chip {
  width: auto !important;
  min-width: min(240px, 100%) !important;
  min-height: 52px !important;
  padding: 0 12px 0 18px !important;
  border: 1px solid rgba(59, 104, 242, .16) !important;
  border-radius: 16px !important;
  background: rgba(237, 244, 255, .92) !important;
  color: var(--ui-ink, #172033) !important;
  font-size: clamp(21px, 5vw, 28px) !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}

.placed-answer-chip em {
  background: rgba(255, 255, 255, .72) !important;
  color: rgba(23, 32, 51, .45) !important;
}

.option-chip {
  min-height: 44px !important;
  padding: 8px 16px !important;
  font-size: clamp(18px, 4.6vw, 22px) !important;
  font-weight: 560 !important;
}

.feedback.good,
.feedback.bad {
  padding: 4px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  font-size: clamp(17px, 4.4vw, 20px) !important;
  font-weight: 650 !important;
}

.chatgpt-action-button {
  width: auto !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  white-space: nowrap !important;
}

.chatgpt-action-button span {
  display: inline !important;
}

.order-word-highlight {
  display: inline !important;
  padding: .04em .28em .1em !important;
  border: 1px solid var(--word-border) !important;
  border-radius: .42em !important;
  background: var(--word-tint) !important;
  box-decoration-break: clone !important;
  -webkit-box-decoration-break: clone !important;
}

@media (max-width: 980px) {
  .task-title {
    margin-bottom: 18px !important;
    font-size: clamp(32px, 8.5vw, 42px) !important;
    font-weight: 650 !important;
  }

  .focus-card {
    padding: 22px 20px 0 !important;
  }

  .prompt-word,
  .prompt-word.english {
    font-size: clamp(29px, 7.2vw, 38px) !important;
  }

  .task-tool-strip {
    margin-left: auto !important;
  }

  .chatgpt-action-button {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
  }
}

/* Unified type pass: one family, fewer weights, calmer hierarchy. */
:root {
  --e123-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

body,
button,
input,
textarea,
select {
  font-family: var(--e123-font) !important;
  letter-spacing: 0 !important;
}

.task-title {
  display: none !important;
}

.brand strong,
#lessonTitle,
.prompt-word,
.prompt-word.english,
.placed-answer-chip,
.sentence-order-item p,
.step-tab small strong {
  font-weight: 650 !important;
}

.brand small,
#lessonSummary,
.date-button small,
.step-tab small em,
.micro-head span,
.answer-label,
.feedback,
.option-chip,
.primary-button,
.ghost-button,
.chatgpt-action-button {
  font-weight: 550 !important;
}

.brand strong {
  font-size: clamp(21px, 2.1vw, 28px) !important;
  line-height: 1.05 !important;
}

.brand small {
  font-size: clamp(13px, 1.2vw, 15px) !important;
  line-height: 1.2 !important;
}

#lessonDate {
  font-size: 13px !important;
  font-weight: 650 !important;
}

#lessonTitle {
  font-size: clamp(25px, 3vw, 36px) !important;
  line-height: 1.08 !important;
}

#lessonSummary {
  max-width: 720px !important;
  font-size: clamp(16px, 1.5vw, 18px) !important;
  line-height: 1.35 !important;
}

.micro-head span {
  font-size: clamp(15px, 1.35vw, 17px) !important;
  line-height: 1.25 !important;
}

.micro-head strong {
  display: none !important;
}

.prompt-word,
.prompt-word.english {
  font-size: clamp(28px, 5.8vw, 38px) !important;
  line-height: 1.14 !important;
}

.answer-label {
  font-size: clamp(16px, 3.9vw, 18px) !important;
  line-height: 1.25 !important;
}

.answer-dropzone input,
.placed-answer-chip,
.option-chip {
  font-size: clamp(18px, 4.5vw, 22px) !important;
  line-height: 1.18 !important;
}

.gap-card .gap-sentence,
.interactive-gap-sentence {
  font-size: clamp(19px, 1.65vw, 24px) !important;
  font-weight: 560 !important;
  line-height: 1.42 !important;
}

.inline-gap-input[class*="word-tone-"] {
  font-size: .88em !important;
  font-weight: 600 !important;
}

.sentence-order-item p {
  font-size: clamp(18px, 1.8vw, 23px) !important;
  line-height: 1.36 !important;
}

.step-tab small strong {
  font-size: clamp(15px, 1.4vw, 18px) !important;
  line-height: 1.1 !important;
}

.step-tab small em {
  font-size: clamp(13px, 1.1vw, 15px) !important;
  line-height: 1.15 !important;
}

.date-button strong {
  font-size: clamp(18px, 1.7vw, 22px) !important;
  font-weight: 650 !important;
}

.date-button small {
  font-size: clamp(13px, 1.15vw, 15px) !important;
}

.primary-button,
.ghost-button {
  font-size: clamp(17px, 4.3vw, 20px) !important;
  line-height: 1 !important;
}

.chatgpt-action-button {
  font-size: 13px !important;
  line-height: 1 !important;
}

@media (max-width: 700px) {
  #lessonTitle {
    font-size: clamp(23px, 6.2vw, 31px) !important;
  }

  #lessonSummary {
    font-size: 16px !important;
  }

  .prompt-word,
  .prompt-word.english {
    font-size: clamp(29px, 7.4vw, 37px) !important;
  }

  .gap-card .gap-sentence,
  .interactive-gap-sentence {
    font-size: clamp(18px, 5vw, 23px) !important;
  }

  .sentence-order-item p {
    font-size: clamp(18px, 5vw, 23px) !important;
  }
}

/* Final order task pass: inline marker colors, compact text, neutral drag handle. */
.sentence-order-list {
  gap: 10px !important;
}

.sentence-order-item {
  grid-template-columns: 32px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 0 !important;
  padding: 14px !important;
}

.sentence-order-item p {
  margin: 0 !important;
  text-align: left !important;
  font-size: clamp(17px, 1.35vw, 21px) !important;
  font-weight: 570 !important;
  line-height: 1.34 !important;
}

.sentence-order-handle {
  width: 30px !important;
  height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: rgba(122, 132, 150, .025) !important;
  color: rgba(86, 98, 118, .18) !important;
  box-shadow: none !important;
}

.sentence-order-handle::before,
.sentence-order-handle::after {
  display: block !important;
  width: 7px !important;
  height: 7px !important;
  border-color: currentColor !important;
  opacity: .34 !important;
}

.sentence-order-handle::before {
  border-top-width: 2px !important;
  border-left-width: 2px !important;
}

.sentence-order-handle::after {
  border-right-width: 2px !important;
  border-bottom-width: 2px !important;
}

.sentence-order-handle i {
  width: 16px !important;
  height: 2px !important;
  background: rgba(86, 98, 118, .16) !important;
}

.sentence-order-row.is-dragging .sentence-order-handle,
.sentence-order-handle:active {
  background: rgba(122, 132, 150, .07) !important;
  color: rgba(86, 98, 118, .28) !important;
  box-shadow: none !important;
}

.order-word-highlight {
  display: inline !important;
  padding: .01em .16em .04em !important;
  border: 0 !important;
  border-radius: .22em !important;
  color: var(--ui-ink, #172033) !important;
  font: inherit !important;
  font-weight: 620 !important;
  line-height: inherit !important;
  box-decoration-break: clone !important;
  -webkit-box-decoration-break: clone !important;
}

.order-word-highlight.word-tone-0 {
  background: rgba(221, 232, 255, .84) !important;
}

.order-word-highlight.word-tone-1 {
  background: rgba(198, 239, 229, .82) !important;
}

.order-word-highlight.word-tone-2 {
  background: rgba(227, 216, 255, .82) !important;
}

.order-word-highlight.word-tone-3 {
  background: rgba(255, 235, 137, .76) !important;
}

.order-word-highlight.word-tone-4 {
  background: rgba(255, 218, 228, .80) !important;
}

@media (max-width: 700px) {
  .sentence-order-list {
    gap: 8px !important;
  }

  .sentence-order-item {
    grid-template-columns: 28px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 12px !important;
  }

  .sentence-order-item p {
    font-size: 16px !important;
    font-weight: 560 !important;
    line-height: 1.3 !important;
  }

  .sentence-order-handle {
    width: 26px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }

  .sentence-order-handle i {
    width: 14px !important;
  }
}

/* Stronger learned-word marker: one consistent fill, no blue text. */
.sentence-order-item p .order-word-highlight {
  display: inline !important;
  margin: 0 .02em !important;
  padding: .04em .20em .07em !important;
  border: 0 !important;
  border-radius: .32em !important;
  color: var(--ui-ink, #172033) !important;
  font-family: inherit !important;
  font-size: 1em !important;
  font-style: normal !important;
  font-weight: 700 !important;
  line-height: inherit !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .28) !important;
  box-decoration-break: clone !important;
  -webkit-box-decoration-break: clone !important;
}

.sentence-order-item p .order-word-highlight,
.sentence-order-item p .order-word-highlight.word-tone-0 {
  background: rgba(255, 228, 128, .88) !important;
  box-shadow: inset 0 0 0 1px rgba(213, 161, 43, .18) !important;
}

.sentence-order-item p .order-word-highlight.word-tone-1 {
  background: rgba(255, 228, 128, .88) !important;
  box-shadow: inset 0 0 0 1px rgba(213, 161, 43, .18) !important;
}

.sentence-order-item p .order-word-highlight.word-tone-2 {
  background: rgba(255, 228, 128, .88) !important;
  box-shadow: inset 0 0 0 1px rgba(213, 161, 43, .18) !important;
}

.sentence-order-item p .order-word-highlight.word-tone-3 {
  background: rgba(255, 228, 128, .88) !important;
  box-shadow: inset 0 0 0 1px rgba(213, 161, 43, .18) !important;
}

.sentence-order-item p .order-word-highlight.word-tone-4 {
  background: rgba(255, 228, 128, .88) !important;
  box-shadow: inset 0 0 0 1px rgba(213, 161, 43, .18) !important;
}

.sentence-order-item .sentence-order-handle {
  opacity: .66 !important;
  background: rgba(122, 132, 150, .09) !important;
  color: rgba(72, 84, 104, .52) !important;
}

.sentence-order-item .sentence-order-handle::before,
.sentence-order-item .sentence-order-handle::after {
  opacity: .58 !important;
}

.sentence-order-item .sentence-order-handle i {
  opacity: .72 !important;
  background: rgba(72, 84, 104, .46) !important;
}

.sentence-order-row.is-dragging .sentence-order-handle,
.sentence-order-handle:active {
  opacity: .82 !important;
  background: rgba(122, 132, 150, .14) !important;
  color: rgba(72, 84, 104, .68) !important;
}

@media (max-width: 700px) {
  .sentence-order-item p .order-word-highlight {
    padding: .035em .18em .06em !important;
    border-radius: .28em !important;
  }
}

/* Consistent word chips across all exercises: same shape, stable per-word color. */
.word-tone-0 {
  --word-tint: rgba(222, 233, 255, .90) !important;
  --word-tint-strong: rgba(207, 222, 255, .96) !important;
  --word-border: rgba(80, 116, 220, .20) !important;
  --word-accent: #496ed4 !important;
}

.word-tone-1 {
  --word-tint: rgba(205, 242, 232, .90) !important;
  --word-tint-strong: rgba(185, 233, 221, .96) !important;
  --word-border: rgba(58, 157, 132, .20) !important;
  --word-accent: #34947c !important;
}

.word-tone-2 {
  --word-tint: rgba(229, 220, 255, .90) !important;
  --word-tint-strong: rgba(216, 203, 255, .96) !important;
  --word-border: rgba(126, 99, 202, .20) !important;
  --word-accent: #735cc6 !important;
}

.word-tone-3 {
  --word-tint: rgba(255, 233, 139, .88) !important;
  --word-tint-strong: rgba(255, 222, 97, .94) !important;
  --word-border: rgba(191, 142, 34, .20) !important;
  --word-accent: #b98516 !important;
}

.word-tone-4 {
  --word-tint: rgba(255, 219, 229, .90) !important;
  --word-tint-strong: rgba(255, 204, 219, .96) !important;
  --word-border: rgba(190, 83, 106, .18) !important;
  --word-accent: #b94f66 !important;
}

.answer-bank .option-chip[class*="word-tone-"],
.placed-answer-chip[class*="word-tone-"],
.inline-gap-input-wrap[class*="word-tone-"],
.sentence-order-item p .order-word-highlight {
  min-height: 0 !important;
  padding: .18em .48em .24em !important;
  border: 1px solid var(--word-border) !important;
  border-radius: .48em !important;
  background: var(--word-tint) !important;
  color: var(--ui-ink, #172033) !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-style: normal !important;
  font-weight: 680 !important;
  line-height: 1.08 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42) !important;
}

.answer-bank .option-chip[class*="word-tone-"]:hover,
.answer-bank .option-chip[class*="word-tone-"]:focus-visible,
.inline-gap-input-wrap[class*="word-tone-"]:focus-within {
  background: var(--word-tint-strong) !important;
  border-color: var(--word-accent) !important;
}

.placed-answer-chip[class*="word-tone-"] {
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.inline-gap-input-wrap[class*="word-tone-"] {
  width: auto !important;
  min-width: clamp(72px, calc((var(--gap-ch, 7) * 1ch) + 22px), 156px) !important;
  vertical-align: baseline !important;
}

.inline-gap-input[class*="word-tone-"] {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  font: inherit !important;
  font-weight: 680 !important;
  line-height: 1.08 !important;
}

.sentence-order-item p .order-word-highlight,
.sentence-order-item p .order-word-highlight.word-tone-0,
.sentence-order-item p .order-word-highlight.word-tone-1,
.sentence-order-item p .order-word-highlight.word-tone-2,
.sentence-order-item p .order-word-highlight.word-tone-3,
.sentence-order-item p .order-word-highlight.word-tone-4 {
  display: inline !important;
  margin: 0 .02em !important;
  text-shadow: none !important;
  box-decoration-break: clone !important;
  -webkit-box-decoration-break: clone !important;
}

@media (max-width: 700px) {
  .answer-bank .option-chip[class*="word-tone-"],
  .placed-answer-chip[class*="word-tone-"],
  .inline-gap-input-wrap[class*="word-tone-"],
  .sentence-order-item p .order-word-highlight {
    padding: .16em .42em .22em !important;
    border-radius: .44em !important;
  }
}

/* Use the first-step word bank palette everywhere. */
.word-tone-0 {
  --word-tint: rgba(232, 240, 255, .94) !important;
  --word-tint-strong: rgba(221, 232, 255, .98) !important;
  --word-border: rgba(59, 104, 242, .28) !important;
  --word-accent: #3b68f2 !important;
}

.word-tone-1 {
  --word-tint: rgba(216, 246, 237, .94) !important;
  --word-tint-strong: rgba(198, 239, 229, .98) !important;
  --word-border: rgba(57, 174, 145, .28) !important;
  --word-accent: #35a98c !important;
}

.word-tone-2 {
  --word-tint: rgba(238, 232, 255, .96) !important;
  --word-tint-strong: rgba(227, 216, 255, .98) !important;
  --word-border: rgba(139, 105, 226, .26) !important;
  --word-accent: #8667df !important;
}

.word-tone-3 {
  --word-tint: rgba(255, 241, 173, .88) !important;
  --word-tint-strong: rgba(255, 235, 137, .94) !important;
  --word-border: rgba(218, 171, 40, .28) !important;
  --word-accent: #d5a12b !important;
}

.word-tone-4 {
  --word-tint: rgba(255, 231, 237, .92) !important;
  --word-tint-strong: rgba(255, 218, 228, .96) !important;
  --word-border: rgba(210, 91, 117, .24) !important;
  --word-accent: #cf5b75 !important;
}

.answer-bank .option-chip[class*="word-tone-"],
.placed-answer-chip[class*="word-tone-"],
.inline-gap-input-wrap[class*="word-tone-"],
.sentence-order-item p .order-word-highlight.word-tone-0,
.sentence-order-item p .order-word-highlight.word-tone-1,
.sentence-order-item p .order-word-highlight.word-tone-2,
.sentence-order-item p .order-word-highlight.word-tone-3,
.sentence-order-item p .order-word-highlight.word-tone-4 {
  border: 1px solid var(--word-border) !important;
  background: var(--word-tint) !important;
  color: var(--ui-ink, #172033) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72) !important;
}

.sentence-order-item p .order-word-highlight.word-tone-0,
.sentence-order-item p .order-word-highlight.word-tone-1,
.sentence-order-item p .order-word-highlight.word-tone-2,
.sentence-order-item p .order-word-highlight.word-tone-3,
.sentence-order-item p .order-word-highlight.word-tone-4 {
  padding: .10em .34em .14em !important;
  border-radius: .44em !important;
  font-weight: 680 !important;
  line-height: 1.08 !important;
}

/* Clear progress states. */
.header-progress {
  gap: 10px !important;
}

.header-progress-label {
  display: inline-flex !important;
  align-items: center !important;
  color: var(--ui-muted, #657087) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.date-button.started:not(.active):not(.completed) {
  border-color: rgba(59, 104, 242, .20) !important;
  background: rgba(245, 249, 255, .96) !important;
  color: var(--ui-ink, #172033) !important;
}

.date-button.completed:not(.active) {
  border-color: rgba(83, 190, 164, .40) !important;
  background: rgba(216, 246, 237, .80) !important;
  color: var(--ui-ink, #172033) !important;
}

.date-button.completed:not(.active) strong,
.date-button.completed:not(.active) .date-score,
.date-button.completed:not(.active) span span {
  color: var(--ui-ink, #172033) !important;
}

.date-button.active:not(.completed) {
  border-color: var(--ui-blue, #3b68f2) !important;
  background: var(--ui-blue, #3b68f2) !important;
  color: #fff !important;
}

.date-button.completed.active {
  border-color: var(--ui-blue, #3b68f2) !important;
  background: rgba(216, 246, 237, .88) !important;
  color: var(--ui-ink, #172033) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 104, 242, .22) !important;
}

.date-button.completed.active * {
  color: var(--ui-ink, #172033) !important;
}

@media (max-width: 700px) {
  .header-progress-label {
    font-size: 12px !important;
  }
}

/* The batch strip already carries progress, so keep the top bar clean. */
.topbar .header-progress {
  display: none !important;
}

.topbar .header-tools {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  justify-content: flex-end !important;
}

.topbar .user-menu {
  min-width: 0 !important;
}

.topbar .user-button,
.topbar .user-button.is-authenticated {
  width: auto !important;
  min-width: 76px !important;
  max-width: min(30vw, 180px) !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 0 18px !important;
  overflow: hidden !important;
  border-radius: 17px !important;
  font-size: 15px !important;
  font-weight: 640 !important;
  line-height: 1 !important;
  text-align: left !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.topbar .user-button::before,
.topbar .user-button.is-authenticated::before {
  content: none !important;
  display: none !important;
}

@media (max-width: 700px) {
  .topbar .user-button,
  .topbar .user-button.is-authenticated {
    min-width: 70px !important;
    max-width: 32vw !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
  }
}

/* One typography system, matching the exercise text. */
:root {
  --e123-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif !important;
}

html,
body,
button,
input,
textarea,
select,
.brand,
.brand *,
.date-button,
.date-button *,
.lesson-hero,
.lesson-hero *,
.step-tab,
.step-tab *,
.focus-card,
.focus-card *,
.bottom-actions,
.bottom-actions *,
.auth-card,
.auth-card *,
.user-dropdown,
.user-dropdown *,
.result-box,
.result-box *,
.grade,
.grade * {
  font-family: var(--e123-font) !important;
  letter-spacing: 0 !important;
}

.stage-result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.stage-result-box {
  display: grid !important;
  gap: 10px !important;
  align-content: start !important;
  min-height: 116px !important;
  padding: 18px !important;
  border-radius: 18px !important;
  background: #fff !important;
}

.stage-result-head {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.stage-result-head span {
  color: var(--ui-muted, #657087) !important;
  font-size: 14px !important;
  font-weight: 640 !important;
  line-height: 1.1 !important;
  min-width: 0 !important;
}

.stage-result-box strong {
  color: var(--ui-ink, #172033) !important;
  font-size: clamp(28px, 4vw, 38px) !important;
  font-weight: 680 !important;
  line-height: 1 !important;
}

.stage-result-head em,
.stage-result-box small {
  color: var(--ui-muted, #657087) !important;
  font-size: 14px !important;
  font-style: normal !important;
  font-weight: 560 !important;
  line-height: 1.2 !important;
}

.stage-result-head em {
  flex: 0 0 auto !important;
  text-align: right !important;
  white-space: nowrap !important;
}

.stage-result-box.done {
  border-color: rgba(83, 190, 164, .42) !important;
  background: rgba(216, 246, 237, .58) !important;
}

@media (max-width: 700px) {
  .stage-result-grid {
    grid-template-columns: 1fr !important;
  }

  .stage-result-box {
    min-height: 96px !important;
    padding: 16px !important;
  }
}

/* Single text size pass. */
:root {
  --e123-type-size: 19px !important;
}

body,
body *,
body *::before,
body *::after {
  font-size: var(--e123-type-size) !important;
}

#lessonTitle,
.brand strong,
.date-button strong,
.step-tab strong,
.prompt-word,
.prompt-word.english,
.stage-result-box strong,
.grade strong,
.primary-button,
.ghost-button {
  font-weight: 720 !important;
}

.lesson-summary,
.date-score,
.step-tab em,
.stage-result-head em,
.stage-result-box small,
.grade p,
.brand small {
  font-weight: 520 !important;
}

/* Hard override: no small-print sizes anywhere in the app UI. */
html body .topbar,
html body .topbar *,
html body .topbar *::before,
html body .topbar *::after,
html body #dateList,
html body #dateList *,
html body #dateList *::before,
html body #dateList *::after,
html body #appShell,
html body #appShell *,
html body #appShell *::before,
html body #appShell *::after,
html body .bottom-actions,
html body .bottom-actions *,
html body .bottom-actions *::before,
html body .bottom-actions *::after,
html body .auth-modal,
html body .auth-modal *,
html body .auth-modal *::before,
html body .auth-modal *::after,
html body .user-dropdown,
html body .user-dropdown *,
html body .user-dropdown *::before,
html body .user-dropdown *::after {
  font-size: var(--e123-type-size) !important;
}

html body .steps .step-tab,
html body .steps .step-tab span,
html body .steps .step-tab small,
html body .steps .step-tab strong,
html body .steps .step-tab em,
html body .result-grid .result-box,
html body .result-grid .result-box span,
html body .result-grid .result-box strong,
html body .result-grid .result-box em,
html body .result-grid .result-box small,
html body .grade,
html body .grade span,
html body .grade strong,
html body .grade p {
  font-size: var(--e123-type-size) !important;
}

html body .topbar .user-button,
html body .topbar .user-button.is-authenticated,
html body .topbar .brand,
html body .topbar .brand * {
  font-size: var(--e123-type-size) !important;
}

/* Tighter vertical rhythm after the single-size type pass. */
html body #appShell,
html body #appShell *,
html body #dateList,
html body #dateList *,
html body .topbar,
html body .topbar *,
html body .bottom-actions,
html body .bottom-actions * {
  line-height: 1.15 !important;
}

html body .lesson-hero {
  gap: 10px !important;
  padding-top: 16px !important;
  padding-bottom: 12px !important;
}

html body #lessonTitle {
  margin-bottom: 6px !important;
}

html body #lessonSummary {
  margin-top: 0 !important;
}

html body .steps {
  gap: 10px !important;
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

html body .steps .step-tab {
  min-height: 58px !important;
  height: auto !important;
  gap: 10px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

html body .steps .step-tab small {
  gap: 2px !important;
}

html body .focus-card {
  gap: 10px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

html body .focus-head {
  margin-bottom: 0 !important;
}

html body .prompt-word,
html body .prompt-word.english {
  min-height: auto !important;
  height: auto !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

html body .answer-label {
  margin-top: 6px !important;
  margin-bottom: 4px !important;
}

html body .answer-workbench {
  gap: 10px !important;
}

html body .answer-bank {
  gap: 8px !important;
}

html body .stage-result-grid {
  gap: 10px !important;
}

html body .stage-result-box {
  min-height: 90px !important;
  gap: 6px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

html body .grade {
  margin-top: 12px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

/* Phone bottom controls and compact rhythm. */
@media (max-width: 980px) {
  html body .lesson-hero {
    gap: 6px !important;
    padding-top: 10px !important;
    padding-bottom: 8px !important;
  }

  html body #lessonTitle {
    margin-bottom: 4px !important;
  }

  html body #lessonSummary,
  html body .task-note {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  html body .steps {
    gap: 8px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  html body .steps .step-tab {
    min-height: 52px !important;
    gap: 8px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  html body #taskContent {
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body .focus-card,
  html body .chatgpt-card {
    gap: 8px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  html body .task-title {
    margin-bottom: 8px !important;
  }

  html body .prompt-word,
  html body .prompt-word.english {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  html body .stage-result-box {
    min-height: 82px !important;
    gap: 4px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  html body .grade {
    margin-top: 10px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  html body .task-actions {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 19px) !important;
    z-index: 80 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 0 !important;
    border-top: 1px solid rgba(216, 226, 244, .72) !important;
    border-radius: 20px 20px 0 0 !important;
    background: rgba(246, 248, 252, .94) !important;
    box-shadow: 0 -10px 24px rgba(35, 60, 110, .07) !important;
    backdrop-filter: blur(16px) !important;
  }

  html body .task-actions .primary-button,
  html body .task-actions .ghost-button {
    min-height: 50px !important;
  }
}

@media (max-width: 700px) {
  html body .lesson-hero {
    padding-top: 8px !important;
    padding-bottom: 6px !important;
  }

  html body .steps {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  html body .focus-card,
  html body .chatgpt-card {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  html body #taskContent {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Final task word accents: match the word-bank chips exactly. */
html body .sentence-order-item p .order-word-highlight[class*="word-tone-"] {
  display: inline !important;
  margin: 0 .02em !important;
  padding: .18em .48em .24em !important;
  border: 1px solid var(--word-border) !important;
  border-radius: .48em !important;
  background: var(--word-tint) !important;
  color: var(--ui-ink, #172033) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72) !important;
  font: inherit !important;
  font-weight: 680 !important;
  line-height: 1.08 !important;
  text-shadow: none !important;
  box-decoration-break: clone !important;
  -webkit-box-decoration-break: clone !important;
}

@media (max-width: 700px) {
  html body .sentence-order-item p .order-word-highlight[class*="word-tone-"] {
    padding: .16em .42em .22em !important;
    border-radius: .44em !important;
  }
}

/* Final task dropdowns: word-bank colors, but still a real select. */
html body .sentence-order-item p .order-word-select[class*="word-tone-"] {
  display: inline-block !important;
  width: auto !important;
  max-width: min(46vw, 180px) !important;
  margin: 0 .08em !important;
  padding: .18em .54em .24em !important;
  border: 1px solid var(--word-border) !important;
  border-radius: .48em !important;
  background-color: var(--word-tint) !important;
  color: var(--ui-ink, #172033) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72) !important;
  font: inherit !important;
  font-weight: 680 !important;
  line-height: 1.08 !important;
  vertical-align: baseline !important;
}

html body .sentence-order-item p .order-word-select[class*="word-tone-"]:focus {
  outline: 2px solid rgba(59, 104, 242, .24) !important;
  outline-offset: 2px !important;
}

html body .sentence-order-item p .order-word-select.is-correct {
  border-color: rgba(53, 169, 140, .58) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72), 0 0 0 2px rgba(53, 169, 140, .12) !important;
}

html body .sentence-order-item p .order-word-select.is-wrong {
  border-color: rgba(207, 91, 117, .58) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72), 0 0 0 2px rgba(207, 91, 117, .12) !important;
}

html body .result-export {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 10px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(209, 222, 245, .9) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, .82) !important;
}

html body .result-export-text {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

html body .result-export-text strong,
html body .result-export-text small {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.15 !important;
  margin: 0 !important;
}

html body .result-export-text strong {
  color: var(--ink) !important;
  font-weight: 700 !important;
}

html body .result-export-text small {
  color: var(--muted) !important;
}

html body .result-chatgpt-button {
  width: auto !important;
  min-width: 0 !important;
  padding-inline: 16px !important;
}

@media (max-width: 700px) {
  html body .sentence-order-item p .order-word-select[class*="word-tone-"] {
    max-width: 52vw !important;
    padding: .16em .42em .22em !important;
    border-radius: .44em !important;
  }

  html body .result-export {
    justify-content: stretch !important;
    align-items: stretch !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
  }

  html body .result-chatgpt-button {
    width: auto !important;
    min-height: 48px !important;
  }
}

/* Compact two-line result badges. */
html body .stage-result-box {
  display: grid !important;
  grid-template-rows: auto auto !important;
  gap: 6px !important;
  min-height: 68px !important;
  padding: 10px 14px !important;
  align-content: center !important;
}

html body .stage-result-line {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  min-width: 0 !important;
}

html body .stage-result-head,
html body .stage-result-score {
  margin: 0 !important;
}

html body .stage-result-box span,
html body .stage-result-box em,
html body .stage-result-box strong,
html body .stage-result-box small {
  line-height: 1.05 !important;
  margin: 0 !important;
}

html body .stage-result-box strong {
  white-space: nowrap !important;
}

html body .stage-result-box small {
  text-align: right !important;
  white-space: nowrap !important;
}

html body .grade.total-result-box {
  margin-top: 10px !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  gap: 6px !important;
  min-height: 68px !important;
  padding: 10px 14px !important;
  align-content: center !important;
}

html body .grade.total-result-box span,
html body .grade.total-result-box em,
html body .grade.total-result-box strong,
html body .grade.total-result-box small {
  display: inline !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

html body .grade.total-result-box strong,
html body .grade.total-result-box small {
  white-space: nowrap !important;
}

@media (max-width: 700px) {
  html body .stage-result-box {
    min-height: 62px !important;
    padding: 9px 12px !important;
    gap: 5px !important;
  }

  html body .grade.total-result-box {
    min-height: 62px !important;
    padding: 9px 12px !important;
    gap: 5px !important;
  }
}
