.academy-shell[hidden],
.lesson-shell[hidden] {
  display: none !important;
}

html.lesson-route,
body.lesson-route {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.lesson-route {
  display: block !important;
}

body.lesson-route * {
  box-sizing: border-box;
}

.lesson-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0 clamp(16px, 2.4vw, 36px) 40px;
  color: #4b2f18;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 242, 178, 0.46), transparent 28%),
    radial-gradient(circle at 92% 2%, rgba(152, 209, 199, 0.18), transparent 26%),
    linear-gradient(135deg, #f4e3bd 0%, #f8edcf 46%, #ead2a1 100%);
  overflow: visible;
}

.lesson-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(90deg, rgba(114, 73, 30, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(114, 73, 30, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, transparent 18%, black 100%);
}

.lesson-topbar,
.lesson-hero,
.lesson-step-flow,
.lesson-layout {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.lesson-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 0 12px;
  background: linear-gradient(180deg, rgba(245, 226, 189, 0.97), rgba(245, 226, 189, 0.8) 74%, transparent);
  backdrop-filter: blur(8px);
}

.lesson-brand,
.lesson-actions,
.lesson-button-row,
.question-footer {
  display: flex;
  align-items: center;
}

.lesson-brand {
  gap: 12px;
}

.lesson-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(154, 105, 36, 0.42);
  border-radius: 50%;
  color: #6e4219;
  font-weight: 900;
  background: linear-gradient(145deg, #fff4c9, #d8a64b);
  box-shadow: 0 10px 22px rgba(107, 63, 20, 0.16);
}

.lesson-brand p,
.lesson-kicker {
  margin: 0;
  color: #9b6a2a;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.lesson-brand strong {
  display: block;
  margin-top: 3px;
  color: #4b2f18;
  font-size: 1.02rem;
}

.lesson-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-actions button,
.lesson-secondary-button {
  border: 1px solid rgba(154, 105, 36, 0.35);
  border-radius: 999px;
  color: #6b421e;
  background: rgba(255, 248, 222, 0.82);
  box-shadow: 0 8px 18px rgba(104, 64, 20, 0.1);
  cursor: pointer;
}

.lesson-actions button {
  min-height: 38px;
  padding: 0 14px;
  font-weight: 850;
}

.lesson-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(166, 117, 44, 0.32);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 249, 224, 0.94), rgba(244, 220, 166, 0.82)),
    radial-gradient(circle at 90% 12%, rgba(255, 211, 91, 0.18), transparent 28%);
  box-shadow: 0 20px 42px rgba(97, 60, 22, 0.14);
}

.lesson-complete-stamp,
.status-stamp {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(126, 28, 24, 0.58);
  color: rgba(126, 28, 24, 0.78);
  background: rgba(255, 246, 226, 0.38);
  font-weight: 950;
  transform: rotate(-8deg);
  letter-spacing: 0.06em;
  pointer-events: none;
}

.lesson-complete-stamp {
  right: 28px;
  bottom: 24px;
  min-width: 156px;
  min-height: 54px;
  border-radius: 12px;
  font-size: 1.2rem;
}

.status-stamp {
  top: 18px;
  right: 18px;
  min-width: 76px;
  min-height: 34px;
  border-radius: 9px;
  font-size: 0.94rem;
}

.status-stamp.is-complete {
  border-color: rgba(58, 105, 42, 0.58);
  color: rgba(58, 105, 42, 0.82);
  transform: rotate(-6deg);
}

.lesson-hero h1 {
  margin: 10px 0 8px;
  color: #3f2614;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1.06;
}

.lesson-subtitle,
.lesson-copy {
  margin: 0;
  max-width: 780px;
  color: #73522b;
  font-size: 1.02rem;
  line-height: 1.8;
}

.lesson-status-board {
  min-width: 230px;
  padding: 18px;
  border: 1px solid rgba(167, 112, 32, 0.26);
  border-radius: 18px;
  background: rgba(255, 249, 224, 0.76);
}

.lesson-status-board span,
.lesson-status-board small,
.resource-board span {
  color: #9b6a2a;
  font-weight: 850;
}

.lesson-status-board strong {
  display: block;
  margin: 8px 0;
  color: #3f2614;
  font-size: 1.8rem;
}

.lesson-status-board small b {
  color: #b86d08;
  font-size: 1.05rem;
}

.lesson-step-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.lesson-step-flow article {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 90px;
  padding: 14px 18px;
  border: 1px solid rgba(159, 109, 35, 0.28);
  border-radius: 18px;
  background: rgba(255, 249, 225, 0.78);
  box-shadow: 0 12px 28px rgba(101, 64, 23, 0.1);
}

.lesson-step-flow article.is-complete {
  border-color: rgba(118, 156, 58, 0.45);
  background: rgba(247, 252, 222, 0.84);
}

.lesson-step-flow article.is-current {
  border-color: rgba(214, 146, 27, 0.7);
  box-shadow: 0 14px 30px rgba(183, 111, 21, 0.16), inset 0 0 0 1px rgba(255, 217, 116, 0.45);
}

.lesson-step-flow span,
.task-intro b,
.task-goal b,
.reward-line {
  color: #9b6a2a;
  font-weight: 900;
}

.lesson-step-flow h2 {
  margin: 4px 0;
  color: #3f2614;
  font-size: 1.18rem;
}

.lesson-step-flow p {
  margin: 0;
  color: #72502b;
  line-height: 1.65;
}

.lesson-step-flow strong {
  display: block;
  margin-top: 10px;
  color: #7c4b15;
}

.lesson-step-flow em {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #684118;
  background: rgba(236, 205, 131, 0.68);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
  margin-top: 18px;
}

.lesson-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.lesson-card,
.lesson-progress-sidebar {
  border: 1px solid rgba(159, 109, 35, 0.32);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 228, 0.94), rgba(246, 228, 184, 0.9)),
    radial-gradient(circle at 6% 8%, rgba(255, 255, 255, 0.42), transparent 22%);
  box-shadow: 0 16px 34px rgba(101, 64, 23, 0.12);
}

.lesson-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.1vw, 28px);
  scroll-margin-top: 92px;
}

.lesson-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.lesson-section-head h2 {
  margin: 6px 0 0;
  color: #3f2614;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.2;
}

.lesson-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(177, 121, 32, 0.34);
  border-radius: 999px;
  color: #754412;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(255, 236, 174, 0.82);
}

.lesson-pill.is-complete {
  color: #436222;
  background: rgba(221, 244, 183, 0.85);
}

.task-intro {
  display: grid;
  gap: 8px;
  margin: 12px 0 2px;
  max-width: 840px;
}

.task-intro p,
.task-goal,
.reward-line {
  margin: 0;
  color: #60401e;
  line-height: 1.72;
}

.reward-line {
  margin-top: 10px;
}

.resource-board,
.recorded-resource-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  max-width: 760px;
}

.resource-board div,
.recorded-resource-card > div {
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: rgba(255, 247, 214, 0.74);
}

.resource-board strong,
.recorded-resource-card strong {
  display: block;
  margin-top: 6px;
  color: #3f2614;
  font-size: 1.2rem;
}

.course-check-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-width: 900px;
}

.course-check-item {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid rgba(146, 96, 27, 0.26);
  border-radius: 16px;
  color: #60401e;
  background: rgba(255, 249, 225, 0.74);
}

button.course-check-item,
.course-check-item > button {
  min-height: 62px;
  padding: 14px 16px 14px 48px;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

button.course-check-item::before,
.course-check-item > button::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 21px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(142, 96, 34, 0.58);
  border-radius: 50%;
  background: rgba(255, 250, 228, 0.8);
}

button.course-check-item.is-complete::before,
.course-check-item.is-complete > button::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: rgba(77, 128, 45, 0.66);
  color: #3e6f22;
  font-size: 0.8rem;
  font-weight: 950;
}

.course-check-item span {
  display: block;
  color: #3f2614;
  font-size: 1.04rem;
  font-weight: 900;
}

.course-check-item small {
  display: block;
  margin-top: 4px;
  color: #8b765f;
  font-size: 0.82rem;
  line-height: 1.5;
}

.course-check-item.is-disabled,
.course-check-item.is-disabled > button {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.recorded-item {
  padding-bottom: 2px;
}

.recorded-resource-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 14px 14px 48px;
}

.recorded-resource-card .compact-row {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.lesson-button-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.lesson-primary-button,
.completion-button {
  border: 0;
  border-radius: 999px;
  color: #3d230e;
  background: linear-gradient(135deg, #ffe28a, #f0a92b);
  box-shadow: 0 12px 22px rgba(163, 91, 21, 0.18);
  cursor: pointer;
  font-weight: 900;
}

.lesson-primary-button {
  min-height: 44px;
  padding: 0 22px;
}

.lesson-secondary-button {
  min-height: 42px;
  padding: 0 18px;
  font-weight: 850;
}

.lesson-primary-button:hover,
.lesson-secondary-button:hover,
.lesson-actions button:hover,
.completion-button:hover,
.lesson-progress-sidebar button:hover {
  transform: translateY(-1px);
}

.homework-progress-note,
.exam-note,
.prompt-hint {
  margin: 16px 0;
  padding: 13px 16px;
  border: 1px solid rgba(180, 128, 46, 0.22);
  border-radius: 16px;
  color: #70491f;
  background: rgba(255, 242, 189, 0.62);
  line-height: 1.7;
}

.homework-progress-note:empty {
  display: none;
}

.task-feedback {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid rgba(118, 156, 58, 0.28);
  border-radius: 14px;
  color: #476223;
  background: rgba(241, 250, 213, 0.76);
  font-weight: 850;
  line-height: 1.6;
}

.question-card {
  position: relative;
  margin-top: 18px;
  margin-bottom: 24px;
  padding: clamp(16px, 2vw, 24px);
  border: none;
  border-radius: 18px;
  background: rgba(255, 249, 225, 0.78);
  scroll-margin-top: 92px;
}

.question-card.is-complete {
  border-color: rgba(118, 156, 58, 0.46);
  box-shadow: inset 0 0 0 1px rgba(212, 237, 164, 0.52);
}

.question-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #5b3614;
  font-weight: 900;
  background: #f2ca74;
}

.question-head h3 {
  margin: 0;
  color: #3f2614;
  font-size: 1.32rem;
}

.question-head p {
  margin: 4px 0 0;
  color: #8c5f24;
  font-weight: 850;
}

.question-prompt {
  max-width: 880px;
  margin: 12px 0 14px;
  color: #5e3c1d;
  line-height: 1.85;
}

.homework-field {
  display: block;
}

.homework-field textarea {
  width: 100%;
  min-height: 168px;
  max-width: 100%;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(144, 95, 31, 0.28);
  border-radius: 16px;
  color: #3f2614;
  background:
    linear-gradient(rgba(255, 250, 230, 0.92), rgba(255, 246, 215, 0.92)),
    repeating-linear-gradient(transparent 0, transparent 33px, rgba(161, 109, 35, 0.1) 34px);
  outline: none;
  font: inherit;
  line-height: 1.8;
}

.homework-field textarea:focus {
  border-color: rgba(204, 139, 31, 0.74);
  box-shadow: 0 0 0 3px rgba(232, 178, 69, 0.14);
}

.homework-field span {
  display: block;
  margin-top: 8px;
  color: #8e6635;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: right;
}

.visibility-section {
  margin-top: 14px;
}

.visibility-section h4 {
  margin: 0 0 10px;
  color: #3f2614;
}

.visibility-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(520px, 100%);
  padding: 4px;
  border: 1px solid rgba(146, 96, 27, 0.2);
  border-radius: 999px;
  background: rgba(140, 96, 35, 0.08);
}

.visibility-options button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: #60401e;
  text-align: center;
  background: transparent;
  cursor: pointer;
}

.visibility-options button strong {
  display: block;
}

.visibility-options button strong {
  color: #442916;
  font-size: 0.88rem;
}

.visibility-options button.is-selected {
  color: #4d2c10;
  background: rgba(255, 236, 171, 0.78);
  box-shadow: inset 0 0 0 1px rgba(213, 144, 28, 0.5);
}

.visibility-hint {
  margin: 8px 0 0;
  color: #8a8176;
  font-size: 0.86rem;
  line-height: 1.55;
}

.question-footer {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.completion-button {
  min-height: 40px;
  padding: 0 18px;
}

.completion-button.is-complete {
  background: linear-gradient(135deg, #d5f2b5, #83bf62);
}

.question-warning {
  margin: 0;
  color: #9e3f1a;
  font-weight: 850;
}

.lesson-save-time {
  color: #835c2d;
  font-size: 0.9rem;
}

.lesson-progress-sidebar {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 102px);
  overflow-y: auto;
  padding: 18px;
}

.lesson-progress-sidebar h2 {
  margin: 6px 0 14px;
  color: #3f2614;
  font-size: 1.32rem;
}

.lesson-progress-sidebar button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(146, 96, 27, 0.22);
  border-radius: 14px;
  color: #593719;
  background: rgba(255, 249, 225, 0.72);
  cursor: pointer;
}

.lesson-progress-sidebar button span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.lesson-progress-sidebar button small {
  color: #987037;
  font-size: 0.74rem;
  font-weight: 800;
}

.lesson-progress-sidebar button b {
  color: #95601e;
  font-size: 0.82rem;
}

.lesson-progress-sidebar button.is-complete b {
  color: #55752d;
}

.lesson-progress-sidebar button.is-current {
  border-color: rgba(207, 134, 23, 0.52);
  background: rgba(255, 236, 169, 0.64);
}

.sidebar-reward,
.magic-power-card,
.sidebar-advice {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  color: #69461f;
  background: rgba(255, 236, 169, 0.48);
  line-height: 1.55;
  font-weight: 800;
}

.magic-power-card {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.magic-power-card span,
.sidebar-advice span {
  color: #9b6a2a;
  font-size: 0.82rem;
  font-weight: 900;
}

.magic-power-card strong {
  color: #3f2614;
  font-size: 2rem;
  line-height: 1;
}

.magic-power-card strong b {
  color: #b86d08;
}

.magic-power-card i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(142, 104, 47, 0.22);
}

.magic-power-card i em {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #eab846, #8fba54);
  transition: width 0.24s ease;
}

.sidebar-advice p {
  margin: 7px 0 0;
  color: #5d3c1d;
  line-height: 1.65;
}

.lesson-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: min(680px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid rgba(159, 109, 35, 0.32);
  border-radius: 999px;
  color: #4b2f18;
  background: rgba(255, 244, 202, 0.96);
  box-shadow: 0 12px 28px rgba(78, 48, 16, 0.18);
  font-weight: 900;
}

.lesson-completion-card .modal-copy span {
  display: block;
  margin-top: 10px;
}

.lesson-completion-card small {
  display: block;
  margin-top: 10px;
  color: #8a765f;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 980px) {
  .lesson-shell {
    padding: 0 12px 28px;
  }

  .lesson-topbar,
  .lesson-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .lesson-status-board {
    width: 100%;
    min-width: 0;
  }

  .lesson-layout,
  .lesson-step-flow,
  .resource-board,
  .recorded-resource-card,
  .visibility-options {
    grid-template-columns: 1fr;
  }

  .visibility-options {
    border-radius: 16px;
  }

  .recorded-resource-card {
    margin-left: 14px;
  }

  .lesson-progress-sidebar {
    position: static;
    order: -1;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .lesson-button-row,
  .question-footer,
  .lesson-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-primary-button,
  .lesson-secondary-button,
  .completion-button,
  .lesson-actions button {
    width: 100%;
  }

  .lesson-section-head {
    flex-direction: column;
  }
}

/* Lesson compact pass */
.lesson-shell [hidden] {
  display: none !important;
}

.lesson-shell {
  padding: 0 clamp(14px, 2vw, 28px) 32px;
}

.lesson-topbar {
  margin-bottom: 12px;
  padding: 12px 0 10px;
}

.lesson-mark {
  width: 38px;
  height: 38px;
}

.lesson-brand strong {
  font-size: 0.96rem;
}

.lesson-actions button,
.lesson-secondary-button,
.lesson-primary-button,
.completion-button {
  font-size: 0.9rem;
}

.lesson-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.lesson-hero {
  padding: clamp(18px, 2.4vw, 26px);
}

.lesson-hero h1 {
  margin: 8px 0 6px;
  font-size: clamp(1.75rem, 2.6vw, 2.55rem);
}

.lesson-subtitle,
.lesson-copy {
  font-size: 0.96rem;
  line-height: 1.65;
}

.lesson-status-board {
  min-width: 190px;
  padding: 14px;
}

.lesson-status-board strong {
  font-size: 1.42rem;
}

.lesson-complete-stamp {
  min-width: 138px;
  min-height: 46px;
  font-size: 1.04rem;
}

.status-stamp {
  top: 14px;
  right: 14px;
  min-width: 68px;
  min-height: 30px;
  font-size: 0.82rem;
}

.lesson-step-flow {
  gap: 10px;
  margin-top: 12px;
}

.lesson-step-flow article {
  min-height: 78px;
  padding: 12px 14px;
}

.lesson-step-flow h2 {
  font-size: 1rem;
  margin: 4px 0;
}

.lesson-step-flow p,
.lesson-step-flow strong {
  font-size: 0.9rem;
  line-height: 1.45;
}

.lesson-step-flow strong {
  margin-top: 8px;
}

.lesson-layout {
  gap: 18px;
  margin-top: 14px;
}

.lesson-main {
  gap: 14px;
}

.lesson-card {
  padding: clamp(16px, 1.7vw, 22px);
}

.lesson-section-head {
  gap: 12px;
  margin-bottom: 8px;
  padding-right: 82px;
}

.question-head {
  gap: 12px;
  margin-bottom: 28px;
  padding-right: 82px;
}

.lesson-section-head h2 {
  margin: 5px 0 0;
  font-size: clamp(1.2rem, 1.55vw, 1.55rem);
}

.lesson-pill {
  min-height: 26px;
  padding: 0 10px;
}

.reward-line,
.task-intro p,
.task-goal {
  font-size: 0.94rem;
  line-height: 1.55;
}

.reward-line {
  margin-top: 6px;
}

.course-check-list {
  gap: 10px;
  margin-top: 12px;
}

button.course-check-item,
.course-check-item > button {
  min-height: 48px;
  padding: 11px 48px 11px 44px;
}

button.course-check-item::before,
.course-check-item > button::before {
  left: 14px;
  top: 15px;
  width: 17px;
  height: 17px;
}

.course-check-item span {
  font-size: 0.98rem;
}

.recorded-resource-card.compact-resource {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  margin: 0 12px 12px 44px;
  padding: 10px;
  border: 1px dashed rgba(147, 93, 24, 0.24);
  border-radius: 14px;
  background: rgba(255, 247, 214, 0.64);
}

.recorded-resource-card.compact-resource > * {
  margin: 0;
}

.recorded-resource-card.compact-resource span {
  color: #6d4a24;
  font-size: 0.92rem;
  font-weight: 850;
}

.recorded-resource-card.compact-resource b {
  color: #3f2614;
  font-size: 0.96rem;
}

.lesson-button-row {
  gap: 8px;
  margin-top: 12px;
}

.lesson-primary-button {
  min-height: 38px;
  padding: 0 16px;
}

.lesson-secondary-button {
  min-height: 36px;
  padding: 0 14px;
}

.homework-progress-note,
.exam-note,
.prompt-hint {
  margin: 12px 0;
  padding: 10px 12px;
  font-size: 0.94rem;
  line-height: 1.55;
}

.task-feedback {
  margin: 10px 0 0;
  padding: 9px 12px;
  font-size: 0.92rem;
}

.question-card {
  margin-top: 14px;
  padding: clamp(14px, 1.65vw, 20px);
}

.question-badge {
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.88rem;
}

.question-head h3 {
  font-size: 1.08rem;
}

.question-prompt {
  margin: 10px 0 12px;
  font-size: 0.95rem;
  line-height: 1.62;
}

.homework-field textarea {
  min-height: 138px;
  padding: 12px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.homework-field textarea[rows="9"] {
  min-height: 180px;
}

.homework-field span {
  margin-top: 6px;
}

.visibility-section {
  margin-top: 10px;
}

.visibility-section h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.visibility-options {
  width: min(430px, 100%);
  padding: 3px;
}

.visibility-options button {
  min-height: 30px;
  padding: 0 8px;
}

.visibility-options button strong {
  font-size: 0.82rem;
}

.visibility-hint {
  margin: 6px 0 0;
}

.visibility-admin-note {
  margin: 3px 0 0;
  color: #9a9289;
  font-size: 0.78rem;
  line-height: 1.45;
}

.question-footer {
  gap: 10px;
  margin-top: 12px;
}

.completion-button {
  min-height: 36px;
  padding: 0 16px;
}

.lesson-progress-sidebar {
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 108px);
  padding: 14px;
}

.lesson-progress-sidebar h2 {
  font-size: 1.08rem;
}

.lesson-progress-sidebar button {
  min-height: 42px;
  padding: 7px 10px;
}

.magic-power-card strong {
  font-size: 1.55rem;
}

.user-switch {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(154, 105, 36, 0.35);
  border-radius: 999px;
  color: #6b421e;
  background: rgba(255, 248, 222, 0.86);
  font-weight: 850;
}

.admin-shell[hidden] {
  display: none !important;
}

html.admin-route,
body.admin-route {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
}

.admin-shell {
  height: 100vh;
  min-height: 100vh;
  padding: 24px clamp(16px, 3vw, 40px) 48px;
  color: #432815;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 236, 161, 0.45), transparent 26%),
    linear-gradient(135deg, #f5e3bd, #faefd2 48%, #ead09d);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(121, 78, 31, 0.7) rgba(232, 199, 130, 0.38);
}

.admin-shell::-webkit-scrollbar {
  width: 14px;
}

.admin-shell::-webkit-scrollbar-track {
  background: rgba(232, 199, 130, 0.38);
}

.admin-shell::-webkit-scrollbar-thumb {
  border: 3px solid rgba(250, 239, 210, 0.95);
  border-radius: 999px;
  background: rgba(121, 78, 31, 0.72);
}

.admin-topbar,
.admin-main,
.admin-denied {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-topbar h1 {
  margin: 6px 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.admin-topbar p {
  margin: 0;
  color: #76512b;
}

.admin-actions,
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-actions button,
.admin-tabs button,
.admin-table button,
.admin-back-link {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(154, 105, 36, 0.34);
  border-radius: 999px;
  color: #5e3718;
  background: rgba(255, 248, 222, 0.82);
  cursor: pointer;
  font-weight: 850;
}

.admin-tabs {
  margin-bottom: 14px;
}

.admin-card,
.admin-denied {
  border: 1px solid rgba(154, 105, 36, 0.28);
  border-radius: 20px;
  background: rgba(255, 250, 228, 0.9);
  box-shadow: 0 16px 34px rgba(94, 59, 20, 0.12);
}

.admin-card {
  padding: 18px;
}

.admin-denied {
  padding: 28px;
}

.admin-card h2,
.admin-card h3 {
  margin: 0 0 12px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-metrics article,
.admin-detail-grid article {
  padding: 14px;
  border: 1px solid rgba(154, 105, 36, 0.18);
  border-radius: 16px;
  background: rgba(255, 244, 203, 0.64);
}

.admin-metrics span,
.admin-detail-grid span {
  display: block;
  color: #9b6a2a;
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-metrics strong,
.admin-detail-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(122, 82, 29, 0.14);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #8b5d25;
  font-weight: 900;
  background: rgba(238, 205, 137, 0.35);
}

.admin-status {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  color: #80401c;
  background: rgba(229, 189, 120, 0.52);
  font-weight: 850;
}

.admin-status.is-done {
  color: #3d6f33;
  background: rgba(215, 239, 183, 0.78);
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.admin-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-chip-list span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 236, 171, 0.68);
  font-weight: 850;
}

.admin-homework-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-homework-list article {
  padding: 12px;
  border: 1px solid rgba(154, 105, 36, 0.18);
  border-radius: 14px;
  background: rgba(255, 248, 222, 0.72);
}

.admin-homework-list header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #6d421c;
  font-weight: 900;
}

.admin-homework-list p {
  white-space: pre-line;
  line-height: 1.65;
}

.admin-long-cell {
  max-width: 360px;
  white-space: pre-line;
}

.admin-homework-boards {
  display: grid;
  gap: 14px;
}

.admin-homework-header,
.admin-board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.admin-homework-header p,
.admin-board-head p {
  margin: 4px 0 0;
  color: #76512b;
  line-height: 1.6;
}

.admin-homework-header button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid rgba(154, 105, 36, 0.34);
  border-radius: 999px;
  color: #5e3718;
  background: rgba(255, 248, 222, 0.82);
  font-weight: 850;
}

.admin-board-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: #a16d25;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.admin-board-filter {
  width: min(360px, 100%);
  flex: 0 0 min(360px, 42%);
  color: #70491e;
  font-size: 0.84rem;
  font-weight: 900;
}

.admin-board-filter select {
  min-height: 44px;
  margin-top: 6px;
  border-radius: 12px;
  background: rgba(255, 247, 220, 0.92);
}

.admin-board-summary {
  margin: 14px 0 10px;
  padding: 9px 12px;
  border-left: 4px solid rgba(180, 119, 35, 0.72);
  border-radius: 0 10px 10px 0;
  color: #67401a;
  background: rgba(246, 222, 162, 0.38);
  font-weight: 900;
}

.admin-answer-table {
  min-width: 680px;
}

.admin-student-answer-table {
  min-width: 860px;
}

.admin-student-cell {
  width: 210px;
}

.admin-student-cell strong,
.admin-student-cell small {
  display: block;
}

.admin-student-cell small {
  margin-top: 4px;
  color: #8b6d3f;
  font-size: 0.78rem;
  font-weight: 650;
}

.admin-answer-table .admin-long-cell {
  max-width: none;
  min-width: 360px;
  line-height: 1.65;
}

.admin-empty-state {
  padding: 24px !important;
  color: #8b6d3f;
  text-align: center !important;
}

@media (max-width: 980px) {
  .admin-topbar {
    flex-direction: column;
  }

  .admin-metrics,
  .admin-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-homework-header,
  .admin-board-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-board-filter {
    width: 100%;
    flex-basis: auto;
  }
}

/* 2026-05-28 polish pass: logo, compact lesson density, simpler task labels */
.logo-mark,
.lesson-mark {
  overflow: hidden;
  background: #fff4cf !important;
}

.logo-mark img,
.lesson-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.lesson-shell {
  padding-bottom: 30px;
}

.lesson-topbar {
  margin-bottom: 12px;
  padding: 10px 0 8px;
}

.lesson-hero {
  padding: 20px 22px;
  border-radius: 18px;
}

.lesson-hero h1 {
  font-size: clamp(1.75rem, 2.6vw, 2.55rem);
}

.lesson-subtitle,
.lesson-copy,
.question-prompt,
.lesson-step-flow p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.lesson-status-board {
  min-width: 170px;
  padding: 14px;
}

.lesson-status-board strong {
  font-size: 1.45rem;
}

.lesson-step-flow {
  gap: 10px;
  margin-top: 12px;
}

.lesson-step-flow article {
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 15px;
}

.lesson-step-flow h2 {
  font-size: 1.04rem;
  margin: 4px 0;
}

.lesson-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  margin-top: 14px;
}

.lesson-main {
  gap: 14px;
}

.lesson-card {
  padding: 18px;
  border-radius: 17px;
}

.lesson-section-head {
  margin-bottom: 8px;
}

.lesson-section-head h2 {
  font-size: clamp(1.18rem, 1.55vw, 1.55rem);
}

.lesson-section-head .lesson-kicker {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(171, 111, 31, 0.26);
  border-radius: 999px;
  color: #593315;
  background: linear-gradient(180deg, #ffe49a, #edbd56);
  box-shadow: 0 8px 14px rgba(133, 82, 21, 0.12);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.compact-reward,
.reward-line {
  font-size: 0.9rem;
}

.course-check-list {
  gap: 9px;
  margin-top: 12px;
}

button.course-check-item,
.course-check-item > button {
  min-height: 54px;
  padding: 11px 14px 11px 44px;
}

button.course-check-item::before,
.course-check-item > button::before {
  left: 14px;
  top: 17px;
}

.course-check-item span {
  font-size: 0.96rem;
}

.course-check-item small {
  font-size: 0.78rem;
}

.recorded-resource-card {
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
  margin: 0 12px 12px 44px;
}

.recorded-resource-card .lesson-primary-button,
.recorded-resource-card .lesson-secondary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.recorded-resource-card span {
  font-size: 0.9rem;
  white-space: nowrap;
}

.homework-progress-note,
.exam-note,
.prompt-hint {
  margin: 10px 0;
  padding: 9px 11px;
  border-radius: 13px;
  font-size: 0.9rem;
}

.question-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
}

.question-badge {
  min-height: 32px;
  padding: 0 12px;
  font-size: 1rem;
}

.question-head h3 {
  font-size: 1.12rem;
}

.homework-field textarea {
  min-height: 126px;
  padding: 11px;
  font-size: 0.93rem;
}

.homework-field textarea[rows="9"] {
  min-height: 168px;
}

.visibility-section {
  margin-top: 9px;
}

.visibility-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(330px, 100%);
}

.visibility-options button strong {
  font-size: 0.82rem;
}

.visibility-admin-note {
  display: none;
}

.lesson-progress-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 104px);
  padding: 13px;
}

.lesson-progress-sidebar h2 {
  font-size: 1.1rem;
}

.lesson-progress-sidebar button {
  min-height: 42px;
  padding: 7px 10px;
}

@media (max-width: 980px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-progress-sidebar {
    position: static;
    max-height: none;
  }
}
