:root {
  --bg: #f5f5f5;
  --text: #3c3c3c;
  --muted: #6b6b6b;
  --supermuted: #d6d6d6;
  --theme: #158349;
  --mutedtheme: rgba(21, 131, 73, 0.1);
  --white: #ffffff;
  --black: #000000;
  --radius: 12px;
  font-size: 14px;
}

html,
body {
  margin: 0 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  font-family: "Aptos Narrow", "Segoe UI", Calibri, Thonburi, Arial;
  color: var(--text);
  background: var(--bg);
}

.topbar {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.topbar-icon {
  height: 2rem;
  width: 2rem;
}

.header-icon .topbar-icon {
  height: 2.5rem;
  width: auto;
}

.save-btn {
  display: flex;
  align-items: center;
}

.homepage-title {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  color: inherit;
  font: inherit;
}

.header,
.ribbon,
.ribbon-options,
.formula-bar {
  width: 100%;
}

.header {
  height: 3.5rem;
  display: flex;
  background-color: var(--bg);
  align-items: center;
}

.header-left {
  display: flex;
  gap: 1.5rem;
  margin-right: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.contact-btn {
  height: 2.25rem;
  padding: 0 0.8rem;
  border: 1px solid #12683a;
  border-radius: 6px;
  background: #e9f8ef;
  color: #0f4425;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.contact-btn:hover {
  background: #d9f2e3;
}

.contact-btn:focus-visible,
.setting-btn:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
}

.setting-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--supermuted);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.setting-btn {
  cursor: pointer;
  position: relative;
}

.setting-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ribbon {
  display: flex;
  height: 2rem;
  gap: 1.5rem;
  background-color: var(--bg);
}

#ribbon-home {
  font-weight: 700;
  border-bottom: 2px solid var(--theme);
}

.ribbon-options {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  border-radius: var(--radius);
  background-color: var(--white);
  border: 1px solid var(--white);
  height: 2rem;

  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 0 0.75rem;
  -webkit-overflow-scrolling: touch;
}

#restart-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.formula-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--bg);
  height: 2rem;
}

/* ── Site announcement and cookie cards ── */

.site-notice-stack {
  position: fixed;
  left: 50%;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(36rem, calc(100vw - 2rem));
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
  transform: translateX(-50%);
}

.announcement-toast,
.cookie-consent-card {
  --announcement-toast-padding-top: 0.75rem;
  --announcement-toast-padding-inline: 1rem;
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  background: var(--white);
  border: 1px solid #b7c5bd;
  border-left: 5px solid var(--theme);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 68, 37, 0.18);
  color: var(--text);
  padding: var(--announcement-toast-padding-top)
    var(--announcement-toast-padding-inline) 0.8rem;
  pointer-events: auto;
  animation: announcement-toast-in 180ms ease-out;
}

.announcement-toast[hidden],
.cookie-consent-card[hidden] {
  display: none;
}

.announcement-toast-content {
  min-width: 0;
}

.announcement-toast-kicker {
  color: var(--theme);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.announcement-toast-title {
  margin-top: 0.18rem;
  padding-right: 2.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.announcement-toast-message {
  margin-top: 0.28rem;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: justify;
  text-justify: inter-word;
  white-space: pre-wrap;
}

.announcement-toast-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 0.55rem;
  border: 1px solid #12683a;
  border-radius: 5px;
  background: var(--theme);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  pointer-events: auto;
  text-decoration: none;
}

.announcement-toast-cta[hidden] {
  display: none;
}

.announcement-toast-cta:visited,
.announcement-toast-cta:hover,
.announcement-toast-cta:focus,
.announcement-toast-cta:active {
  color: var(--white);
}

.announcement-toast-cta:hover {
  filter: brightness(1.06);
}

.announcement-toast-cta:focus-visible,
.announcement-toast-close:focus-visible,
.help-cookie-btn:focus-visible,
.help-cookie-policy-link:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
}

.announcement-toast-close {
  position: absolute;
  top: var(--announcement-toast-padding-top);
  right: var(--announcement-toast-padding-inline);
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: auto;
}

.announcement-toast-close:hover {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--supermuted);
  color: var(--text);
}

@keyframes announcement-toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-consent-card .help-cookie-consent {
  margin: 0.38rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.cookie-consent-card .help-cookie-title {
  color: #334155;
  font-size: 0.82rem;
}

.cookie-consent-card .help-cookie-copy {
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .site-notice-stack {
    width: calc(100vw - 1.25rem);
  }

  .announcement-toast,
  .cookie-consent-card {
    --announcement-toast-padding-top: 0.7rem;
    --announcement-toast-padding-inline: 0.8rem;
    padding-bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-toast,
  .cookie-consent-card {
    animation: none;
  }
}

#formula-bar-input {
  flex: 1;
}

#formula-bar-input input {
  width: 100%;
  color: #6b7280;
  font-style: italic;
}

.grid-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -20px;
  overflow: hidden;
}

.grid {
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  font-family: Aptos, "Segoe UI", Calibri, Thonburi, Arial, sans-serif;
}

/* ── How-to worksheet ── */

.how-to-sheet .colA {
  width: 2.5rem !important;
}

.how-to-sheet .colB {
  width: 13rem !important;
}

.how-to-sheet .colC {
  width: clamp(27rem, 54vw, 46rem) !important;
}

.how-to-sheet .row > div {
  box-sizing: border-box;
}

.how-to-sheet .how-to-cell {
  min-height: 2.1rem;
  padding: 0.42rem 0.65rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.how-to-label {
  color: #0f172a;
  font-weight: 700;
}

.how-to-copy {
  color: #475569;
}

.how-to-copy-strong {
  font-weight: 700;
}

.how-to-hero {
  min-height: 2.65rem !important;
  border-color: #000d3f !important;
  background: #000d3f !important;
  color: #ffffff !important;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.how-to-hero-copy {
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.how-to-label.how-to-hero-copy {
  font-weight: 800;
}

.how-to-section {
  margin-top: 0.15rem;
  border-color: #193a61 !important;
  background: #193a61 !important;
  color: #ffffff !important;
  font-weight: 800;
}

.how-to-label.how-to-section {
  font-size: 0.62rem;
  letter-spacing: 0.025em;
}

.how-to-callout {
  border-color: #9fd4b4 !important;
  background: #ecfdf3 !important;
  color: #166534 !important;
  font-weight: 700;
}

.how-to-challenge {
  border-left-color: #f4c542 !important;
  background: #fffbea !important;
}

.how-to-practice {
  border-left-color: #38bdf8 !important;
  background: #f0f9ff !important;
}

.how-to-learn {
  border-left-color: #a78bfa !important;
  background: #f5f3ff !important;
}

.how-to-comps {
  border-left-color: #fb7185 !important;
  background: #fff1f2 !important;
}

.how-to-analytics {
  border-left-color: #22c55e !important;
  background: #f0fdf4 !important;
}

.how-to-link,
.how-to-link:visited,
.how-to-link:hover,
.how-to-link:focus,
.how-to-link:active {
  color: var(--theme);
  font-weight: 700;
  text-decoration: underline;
}

.how-to-link:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .how-to-sheet .colA {
    width: 0.75rem !important;
  }

  .how-to-sheet .colB {
    width: 8.5rem !important;
  }

  .how-to-sheet .colC {
    width: 15rem !important;
  }

  .how-to-sheet .how-to-cell {
    padding: 0.38rem 0.5rem;
    font-size: 0.78rem;
  }

  .how-to-sheet .how-to-hero {
    font-size: 0.92rem;
  }

  .how-to-sheet .how-to-label.how-to-section {
    font-size: 1rem;
    letter-spacing: 0.015em;
  }
}

.sheet-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 245, 0.78);
  backdrop-filter: blur(1px);
  cursor: progress;
}

.sheet-loading-overlay[hidden] {
  display: none;
}

.sheet-loading-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 12rem;
  padding: 0.8rem 1rem;
  border: 1px solid #b7c5bd;
  border-left: 4px solid var(--theme);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(15, 68, 37, 0.18);
  color: var(--text);
  font-weight: 700;
}

.sheet-loading-grid {
  display: grid;
  grid-template-columns: repeat(3, 0.38rem);
  grid-template-rows: repeat(3, 0.38rem);
  gap: 0.12rem;
}

.sheet-loading-grid span {
  border: 1px solid rgba(21, 131, 73, 0.35);
  background: var(--mutedtheme);
  animation: sheet-loading-cell 900ms ease-in-out infinite;
}

.sheet-loading-grid span:nth-child(2),
.sheet-loading-grid span:nth-child(4) {
  animation-delay: 100ms;
}

.sheet-loading-grid span:nth-child(3),
.sheet-loading-grid span:nth-child(5),
.sheet-loading-grid span:nth-child(7) {
  animation-delay: 200ms;
}

.sheet-loading-grid span:nth-child(6),
.sheet-loading-grid span:nth-child(8) {
  animation-delay: 300ms;
}

.sheet-loading-grid span:nth-child(9) {
  animation-delay: 400ms;
}

@keyframes sheet-loading-cell {
  0%,
  55%,
  100% {
    background: var(--mutedtheme);
  }
  25% {
    background: var(--theme);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-loading-grid span {
    animation: none;
  }

  .sheet-loading-grid span:nth-child(5) {
    background: var(--theme);
  }
}

.analytics-chart-overlay {
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.row {
  display: flex;
}

.row .row1,
.row>div:first-child {
  background-color: var(--bg);
}

.row .row1 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.row>div:first-child {
  display: flex;
  align-items: center;
  justify-content: right;
}

.row>div:not(:first-child) {
  width: 7rem;
}

.row>div {
  border: 1px solid var(--supermuted);
  background-color: var(--white);
  min-height: 1.5rem;
  height: auto;
  width: 3rem;
  flex-shrink: 0;
}

.challenge-submit-note-row > div {
  min-height: 4.5rem;
}

.challenge-submit-note-cell {
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.challenge-submit-note-continuation {
  display: none;
}

.row>div:focus {
  outline: 2px solid var(--theme);
  outline-offset: -2px;
}

.selected-primary {
  outline: 2px solid var(--theme);
  outline-offset: -2px;
}

.selected {
  background-color: var(--mutedtheme) !important;
  outline: 1px solid var(--theme);
  outline-offset: -1px;
}

/* ── Interactive Learn sheet ── */

.learn-sheet {
  -webkit-user-select: text;
  user-select: text;
}

.learn-sheet .row > div {
  min-height: 1.65rem;
  box-sizing: border-box;
}

.learn-cell {
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.35;
}

.learn-course-heading,
.learn-panel-heading {
  border-color: #000d3f !important;
  background: #000d3f !important;
  color: #ffffff !important;
  font-weight: 700;
}

.learn-course-heading {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.learn-course-heading.learn-cell,
.learn-module-heading.learn-cell,
.learn-panel-heading.learn-cell {
  position: relative;
  z-index: 5;
  overflow: visible;
  white-space: nowrap;
}

.learn-course-progress {
  overflow: visible;
  background: #f1f5f9 !important;
  color: #475569;
  font-weight: 700;
  white-space: nowrap;
}

.learn-course-availability {
  background: #f8fafc !important;
  color: #44546a !important;
  font-size: 0.72rem;
  font-weight: 700;
}

.learn-progress-track {
  position: relative;
  display: block;
  width: 12.4rem;
  height: 0.48rem;
  margin: 0.55rem 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4df;
}

.learn-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--theme);
  transition: width 180ms ease;
}

.learn-course-panel {
  position: absolute;
  bottom: 0.2rem;
  z-index: 1510;
  display: flex;
  min-height: 15rem;
  box-sizing: border-box;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 2px 0 7px rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 1rem;
}

.learn-course-panel-title {
  display: grid;
  min-height: 1.65rem;
  box-sizing: border-box;
  flex: 0 0 auto;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid #000d3f;
  background: #000d3f;
  color: #ffffff;
  font-size: 1rem;
  white-space: nowrap;
}

.learn-course-panel-title > span {
  text-align: center;
}

.learn-course-panel-title > strong {
  overflow: hidden;
  padding-right: 0.4rem;
  text-overflow: ellipsis;
}

.learn-course-panel-progress-copy {
  display: flex;
  min-height: 1.65rem;
  box-sizing: border-box;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 0.35rem;
  border-bottom: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.learn-course-panel-progress-bar {
  position: relative;
  height: 0.48rem;
  flex: 0 0 auto;
  margin: 0.55rem 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4df;
}

.learn-course-panel-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--theme);
  transition: width 180ms ease;
}

.learn-course-nav {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #94a3b8 #f1f5f9;
  scrollbar-width: thin;
}

.learn-course-module-row,
.learn-course-lesson-row {
  display: grid;
  width: 100%;
  min-height: 1.65rem;
  box-sizing: border-box;
  grid-template-columns: 4.75rem minmax(0, 1fr) 5.2rem;
  align-items: stretch;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.learn-course-module-row,
button.learn-course-lesson-row {
  cursor: pointer;
}

.learn-course-module-row > span,
.learn-course-lesson-row > span {
  display: flex;
  min-width: 0;
  align-items: center;
  box-sizing: border-box;
  padding: 0 0.3rem;
  border-right: 1px solid #cbd5e1;
}

.learn-course-module-row > span:last-child,
.learn-course-lesson-row > span:last-child {
  border-right: 0;
}

.learn-course-row-leading,
.learn-course-row-status {
  justify-content: center;
}

.learn-course-row-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.learn-course-module-row {
  background: #dfe7e2;
  color: #0f5132;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

button.learn-course-module-row:hover,
button.learn-course-module-row:focus-visible {
  background: #cfddd4;
}

.learn-course-module-row[aria-expanded="true"] {
  background: #c9dfd1;
}

.learn-course-module-row.is-current {
  color: #0b3d25;
  box-shadow: inset 3px 0 0 var(--theme);
}

.learn-course-module-row.is-coming-soon {
  background: #f1f5f9;
  color: #64748b;
}

.learn-course-module-row.has-availability-date {
  min-height: 2.35rem;
}

.learn-course-module-row.has-availability-date .learn-coming-soon-copy {
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.learn-course-module-row.is-unavailable,
.learn-course-lesson-row.is-unavailable {
  background-color: #ededed;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.48) 0,
    rgba(255, 255, 255, 0.48) 4px,
    transparent 4px,
    transparent 8px
  );
  color: #666666;
}

.learn-course-lesson-row {
  background: #ffffff;
  color: #475569;
  font-size: 1rem;
}

.learn-course-lesson-row:hover,
.learn-course-lesson-row:focus-visible {
  background: #f3f8f5;
}

.learn-course-lesson-row.is-current {
  background: #e8f5ed;
  color: #0f5132;
  font-weight: 700;
}

.learn-course-lesson-row.is-mastered {
  color: #12683a;
}

.learn-module-heading {
  background: #dfe7e2 !important;
  color: #0f5132 !important;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.learn-module-heading:not(.learn-module-coming-soon):hover {
  background: #cfddd4 !important;
}

.learn-module-active {
  background: #b9d9c5 !important;
  color: #0b3d25 !important;
  box-shadow: inset 3px 0 0 var(--theme);
}

.learn-module-unavailable {
  border-color: #a6a6a6 !important;
  background-color: #d9e1f2 !important;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.34) 0,
    rgba(255, 255, 255, 0.34) 4px,
    transparent 4px,
    transparent 8px
  ) !important;
  color: #44546a !important;
}

.learn-module-coming-soon {
  border-color: #cbd5e1 !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
  box-shadow: none !important;
}

.learn-coming-soon-copy {
  color: #64748b !important;
  font-size: 0.62rem !important;
  font-weight: 800;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.learn-lesson-row {
  background: #ffffff !important;
  color: #475569;
}

.learn-lesson-row:hover {
  background: #f3f8f5 !important;
}

.learn-lesson-active {
  background: #e8f5ed !important;
  color: #0f5132 !important;
  font-weight: 700;
}

.learn-lesson-mastered {
  color: #12683a;
}

.learn-lesson-unavailable {
  border-color: #c9c9c9 !important;
  background-color: #ededed !important;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.48) 0,
    rgba(255, 255, 255, 0.48) 4px,
    transparent 4px,
    transparent 8px
  ) !important;
  color: #666666 !important;
}

.learn-lesson-unavailable.learn-lesson-active {
  box-shadow: inset 3px 0 0 #4472c4;
}

.learn-panel {
  position: relative;
  z-index: 3;
  overflow: visible;
  white-space: nowrap;
}

.learn-panel-heading {
  position: relative;
  z-index: 2;
  overflow: visible;
  white-space: nowrap;
}

.learn-cell.learn-overflow-source {
  position: relative;
  z-index: 6;
}

.learn-overflow-open-right {
  border-right-color: transparent !important;
}

.learn-overflow-open-left {
  border-left-color: transparent !important;
}

.learn-keycap-label {
  margin-right: 0.6rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.learn-keycap-panel {
  white-space: normal;
}

.learn-keycap-options {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem 0.8rem;
}

.learn-keycap-option {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.learn-keycap-option + .learn-keycap-option {
  padding-left: 0.75rem;
  border-left: 1px solid #cbd5e1;
}

.learn-keycap {
  display: inline-flex;
  min-width: 1.7rem;
  min-height: 1.65rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.48rem;
  border: 1px solid #94a3b8;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #f8fafc;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.learn-keycap-plus {
  display: inline-block;
  margin: 0 0.3rem;
  color: #64748b;
  font-weight: 800;
}

.learn-keycap-stroke {
  display: inline-flex;
  align-items: center;
}

.learn-keycap-then {
  display: inline-block;
  margin: 0 0.42rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
}

.learn-keycap-active {
  border-color: #12683a;
  background: #dff3e7;
  transform: translateY(2px);
}

.learn-keycap-complete {
  border-color: #158349;
  background: #e8f5ed;
  color: #0f5132;
}

.learn-scenario-corner,
.learn-scenario-header {
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: #cbd5e1 !important;
  background: #eef2f4 !important;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.learn-scenario-cell {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 0.35rem;
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155;
  cursor: default;
  outline: none;
  white-space: nowrap;
}

.learn-scenario-cell.learn-overflow-source {
  z-index: 6;
  overflow: visible;
}

.learn-scenario-cell.learn-overflow-open-right {
  border-right-color: transparent !important;
}

.learn-scenario-cell.learn-overflow-open-left {
  border-left-color: transparent !important;
}

.learn-autofit-row-wrapped-cell {
  height: 1.65rem !important;
  max-height: 1.65rem;
  align-items: flex-start;
  overflow: hidden;
  white-space: normal;
}

.learn-autofit-row-wrapped-cell.learn-visual-autofit-row {
  height: auto !important;
  max-height: none;
}

.learn-clipboard-copy-source {
  outline: 2px dotted #158349;
  outline-offset: -3px;
}

.learn-clipboard-formula-source {
  background: #eaf2f8 !important;
  color: #1f4e78 !important;
}

.learn-clipboard-format-sample {
  justify-content: flex-end;
  background: #fff2cc !important;
  color: #0f5132 !important;
  font-weight: 800;
}

.learn-copy-note {
  color: #1f4e78 !important;
  font-weight: 700;
}

.learn-keyboard-note {
  color: #1f4e78 !important;
  font-weight: 700;
}

.learn-tip-note {
  font-style: italic;
}

.learn-selected-cell {
  box-shadow: inset 0 0 0 1px rgba(21, 131, 73, 0.28);
}

.learn-active-cell {
  z-index: 4;
  box-shadow: inset 0 0 0 2px var(--theme);
}

.learn-active-cell:focus {
  outline: 2px solid #0f5132;
  outline-offset: 2px;
}

.learn-selected-header {
  background: #d4edda !important;
  color: #0f5132 !important;
}

.learn-action-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: #91aa9b !important;
  border-radius: 4px;
  background: #ffffff !important;
  color: #12683a !important;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.learn-action-cell:hover,
.learn-action-cell:focus {
  background: #e8f5ed !important;
  outline: 2px solid var(--theme);
  outline-offset: -2px;
}

.learn-action-disabled {
  border-color: #d6d6d6 !important;
  background: #f5f5f5 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
}

.learn-success {
  color: #12683a !important;
  font-weight: 700;
}

.learn-error {
  color: #b42318 !important;
  font-weight: 700;
}

.learn-platform-note {
  color: #44546a !important;
  font-weight: 700;
}

.learn-platform-badge-cell {
  display: flex;
  align-items: center;
  overflow: visible;
  white-space: nowrap;
}

.learn-platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.38rem;
  border: 1px solid #4472c4;
  border-radius: 999px;
  background: #d9e1f2;
  color: #203864;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1.25;
  white-space: nowrap;
}

.learn-demo-badge-cell .learn-platform-badge {
  border-color: #b7791f;
  background: #fff4cc;
  color: #744210;
}

.learn-demo-note {
  color: #744210 !important;
  font-weight: 700;
}

.learn-dialog-note {
  color: #1f4e78 !important;
  font-weight: 700;
}

.learn-excel-mock-layer {
  position: absolute;
  z-index: 24;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  pointer-events: none;
}

.learn-excel-mock {
  display: flex;
  width: min(27rem, calc(100% - 0.5rem));
  max-height: calc(100% - 0.3rem);
  box-sizing: border-box;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #8b8b8b;
  border-radius: 2px;
  background: #f7f7f7;
  color: #202020;
  font-family: inherit;
  font-size: 0.67rem;
  line-height: 1.25;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3), 0 1px 2px rgba(15, 23, 42, 0.2);
}

.learn-excel-mock-titlebar {
  display: grid;
  min-height: 1.65rem;
  box-sizing: border-box;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.35rem;
  border-bottom: 1px solid #d1d1d1;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
}

.learn-excel-mock-app-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  background: #217346;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
}

.learn-excel-mock-close {
  color: #666666;
  font-size: 0.95rem;
  font-weight: 400;
}

.learn-excel-mock-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 0.1rem;
  padding: 0.25rem 0.45rem 0;
  border-bottom: 1px solid #c8c8c8;
  background: #f2f2f2;
}

.learn-excel-mock-tab {
  padding: 0.22rem 0.38rem;
  border: 1px solid transparent;
  border-bottom: 0;
  color: #555555;
  white-space: nowrap;
}

.learn-excel-mock-tab.is-active {
  margin-bottom: -1px;
  border-color: #b7b7b7;
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 600;
}

.learn-excel-mock-body {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
  padding: 0.48rem 0.58rem;
  background: #ffffff;
}

.learn-excel-mock-message {
  color: #333333;
}

.learn-excel-mock-fields {
  display: grid;
  gap: 0.28rem;
}

.learn-excel-mock-field {
  display: grid;
  grid-template-columns: minmax(4.8rem, 0.42fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.learn-excel-mock-control {
  min-height: 1.2rem;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0.18rem 0.3rem;
  border: 1px solid #8f8f8f;
  background: #ffffff;
  color: #111111;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-excel-mock-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.learn-excel-mock-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.learn-excel-mock-check > span {
  display: inline-flex;
  width: 0.78rem;
  height: 0.78rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #777777;
  color: #217346;
  font-size: 0.58rem;
  font-weight: 800;
}

.learn-excel-mock-list {
  display: grid;
  min-height: 0;
  max-height: 3.4rem;
  overflow: hidden;
  border: 1px solid #b5b5b5;
  background: #ffffff;
}

.learn-excel-mock-list-item {
  display: block;
  overflow: hidden;
  padding: 0.15rem 0.32rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-excel-mock-list-item.is-selected {
  background: #d9eaf7;
  color: #17365d;
}

.learn-excel-mock-preview {
  overflow: hidden;
  padding: 0.38rem 0.45rem;
  border: 1px solid #c8c8c8;
  background: #f8f8f8;
  color: #44546a;
  font-family: inherit;
  white-space: pre-line;
}

.learn-excel-mock-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1.25rem);
  gap: 0.18rem;
}

.learn-excel-mock-swatch {
  width: 1.25rem;
  height: 1.05rem;
  box-sizing: border-box;
  border: 1px solid #8f8f8f;
  background: var(--mock-swatch);
}

.learn-excel-mock-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.32rem;
  padding: 0.35rem 0.5rem;
  border-top: 1px solid #d5d5d5;
  background: #f3f3f3;
}

.learn-excel-mock-button {
  min-width: 3.8rem;
  box-sizing: border-box;
  padding: 0.18rem 0.48rem;
  border: 1px solid #8a8a8a;
  background: #ffffff;
  color: #202020;
  text-align: center;
}

.learn-excel-mock-button.is-primary {
  border-color: #217346;
  box-shadow: inset 0 0 0 1px #217346;
}

.learn-excel-mock--backstage {
  width: min(30rem, calc(100% - 0.5rem));
  border-left: 2.4rem solid #217346;
}

.learn-excel-mock--backstage .learn-excel-mock-titlebar {
  color: #1f4e78;
  font-weight: 700;
}

.learn-excel-mock--palette {
  width: min(18rem, calc(100% - 0.5rem));
}

.learn-excel-mock--pane {
  width: min(21rem, calc(100% - 0.5rem));
  height: calc(100% - 0.3rem);
  margin-left: auto;
  border-top: 3px solid #217346;
}

.learn-excel-mock--window {
  width: min(30rem, calc(100% - 0.5rem));
}

.learn-excel-mock--window .learn-excel-mock-titlebar {
  background: #217346;
  color: #ffffff;
}

.learn-excel-mock--window .learn-excel-mock-app-icon {
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.learn-excel-mock--window .learn-excel-mock-close {
  color: #ffffff;
}

.learn-excel-mock--preview {
  width: min(23rem, calc(100% - 0.5rem));
  border-top: 3px solid #217346;
}

/* Learn-mode result visualisations. These styles deliberately resemble small
   Excel state changes rather than replacing the worksheet with illustrations. */
.learn-visual-callout {
  position: relative;
  z-index: 7;
  overflow: visible;
  border-color: #9bc2aa !important;
  background: #e8f5ed !important;
  color: #0f5132 !important;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.learn-visual-callout.learn-overflow-source {
  z-index: 10;
}

.learn-visual-command {
  animation: learn-result-pop 220ms ease both;
}

.learn-visual-autofit-column { width: 13.5rem !important; }
.learn-visual-autofit-row { min-height: 2.65rem !important; align-items: center; }

.learn-visual-bold {
  color: #111827 !important;
  font-weight: 900 !important;
}
.learn-visual-italic { font-style: italic; }
.learn-visual-underline { text-decoration: underline; }
.learn-visual-strikethrough { text-decoration: line-through; }
.learn-alignment-start-right { justify-content: flex-end; text-align: right; }
.learn-alignment-start-top { align-items: flex-start; }
.learn-alignment-start-bottom { align-items: flex-end; }
.learn-visual-align-left { justify-content: flex-start; text-align: left; }
.learn-visual-align-center { justify-content: center; text-align: center; }
.learn-visual-align-right { justify-content: flex-end; text-align: right; }
.learn-visual-align-top { align-items: flex-start; min-height: 2.5rem !important; }
.learn-visual-align-middle { align-items: center; min-height: 2.5rem !important; }
.learn-visual-align-bottom { align-items: flex-end; min-height: 2.5rem !important; }
.learn-scenario-cell.learn-alignment-demo-tall { min-height: 3.5rem !important; }
.learn-visual-currency,
.learn-visual-percentage,
.learn-visual-date,
.learn-visual-number {
  justify-content: flex-end;
  color: #0f5132 !important;
  font-variant-numeric: tabular-nums;
}
.learn-visual-decimals {
  justify-content: flex-start;
  color: #0f5132 !important;
  font-variant-numeric: tabular-nums;
}
.learn-visual-font-large {
  min-height: 2.6rem !important;
  font-size: 1.5rem !important;
}
.learn-visual-font-small { font-size: 0.65rem !important; }
.learn-border-demo-start,
.learn-visual-border {
  box-shadow: inset 0 0 0 4px #111827 !important;
}
.learn-visual-no-border { border-color: transparent !important; box-shadow: none !important; }
.learn-format-painter-source {
  justify-content: flex-end;
  background: #fff2cc !important;
  color: #0f5132 !important;
  font-weight: 800;
}
.learn-visual-format-painter-copy {
  border: 3px dotted #158349 !important;
  box-shadow: none !important;
}
.learn-active-cell.learn-visual-format-painter-copy:focus { outline: none; }
.learn-wrap-text-start {
  height: 1.65rem !important;
  max-height: 1.65rem;
  overflow: hidden;
  white-space: nowrap;
}
.learn-wrap-text-start.learn-visual-wrap {
  height: auto !important;
  min-height: 3.2rem !important;
  max-height: none;
  align-items: flex-start;
  overflow: hidden;
  padding-top: 0.22rem;
  padding-bottom: 0.22rem;
  line-height: 1.15;
  white-space: normal;
}
.learn-merged-primary {
  width: 14rem !important;
  z-index: 6;
}
.learn-merged-center {
  justify-content: center;
  text-align: center;
}
.learn-merged-secondary {
  visibility: hidden;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.learn-unmerged-primary {
  width: 7rem !important;
  justify-content: flex-start;
  text-align: left;
  border: 1px solid #cbd5e1 !important;
}
.learn-unmerged-secondary {
  visibility: visible;
  width: 7rem !important;
  min-width: 0;
  padding: 0 0.35rem !important;
  border: 1px solid #cbd5e1 !important;
}
.learn-visual-format-paste {
  justify-content: flex-end;
  background: #fff2cc !important;
  color: #0f5132 !important;
  font-weight: 800;
}

.learn-visual-pasted,
.learn-visual-values,
.learn-visual-fill-series {
  background: #e2f0d9 !important;
  color: #0f5132 !important;
}

.learn-visual-formula {
  background: #eaf2f8 !important;
  color: #1f4e78 !important;
  font-family: inherit;
}

.learn-visual-dialog {
  box-shadow: inset 0 0 0 2px #4472c4, 3px 3px 0 rgba(68, 114, 196, 0.22) !important;
}

.learn-visual-structure,
.learn-visual-workbook,
.learn-visual-table,
.learn-visual-view,
.learn-visual-insert {
  background: #d9eaf7 !important;
  color: #203864 !important;
}

.learn-visual-hidden {
  min-height: 0.45rem !important;
  height: 0.45rem !important;
  overflow: hidden;
  opacity: 0.42;
}

.learn-visual-grouped { border-left: 3px solid #4472c4 !important; }
.learn-visual-audit { box-shadow: inset 0 -2px #ed7d31 !important; }
.learn-visual-table { border-color: #5b9bd5 !important; font-weight: 700; }
.learn-visual-gridlines-off { border-color: transparent !important; }
.learn-visual-headings-off.learn-scenario-header { color: transparent !important; }
.learn-visual-frozen { border-top: 3px solid #4472c4 !important; }
.learn-visual-page-break { border-color: #4472c4 !important; border-style: dashed !important; }

.learn-visual-chart {
  background-image: linear-gradient(to top, #5b9bd5 0 55%, transparent 55%) !important;
  color: transparent !important;
}

.learn-visual-pivot { background: #ddebf7 !important; font-weight: 800; }
.learn-visual-comment::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 8px solid #c00000;
  border-left: 8px solid transparent;
}
.learn-visual-link { color: #0563c1 !important; text-decoration: underline; }
.learn-visual-visible-only { outline: 2px solid var(--theme); outline-offset: -3px; }

@keyframes learn-result-pop {
  from { transform: scale(0.97); opacity: 0.65; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 760px) {
  .learn-sheet .row > div {
    min-height: 1.8rem;
  }

  .learn-panel {
    font-size: 0.76rem;
  }

  .learn-excel-mock,
  .learn-excel-mock--backstage,
  .learn-excel-mock--pane,
  .learn-excel-mock--window {
    width: min(21.5rem, calc(100% - 0.5rem));
  }

  .learn-excel-mock--backstage {
    border-left-width: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .learn-progress-track > span,
  .learn-keycap {
    transition: none;
  }
}

/* Keep worksheet copy on the same base size used by Challenge and Practice.
   Direct cell formatting (for example the Learn font-size lesson) can still
   demonstrate a deliberate size change. */
.how-to-sheet .row > div,
.learn-sheet .row > div {
  font-size: 1rem;
}

.sheets {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 2rem;
  background-color: var(--bg);
  gap: 1.5rem;
  margin-top: auto;
  border-bottom: 1px solid var(--supermuted);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  white-space: nowrap;
}

.sheets > div {
  flex: 0 0 auto;
}

.sheets [role="tab"] {
  cursor: pointer;
}

.sheet-beta-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 0.22rem;
  padding: 0.08rem 0.28rem;
  border: 1px solid #8fc4a6;
  border-radius: 999px;
  background: #e8f5ed;
  color: #12683a;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  vertical-align: middle;
}

#learn[aria-selected="true"] .sheet-beta-pill {
  border-color: var(--theme);
  background: var(--theme);
  color: #ffffff;
}

#analytics {
  background: var(--theme);
  color: #ffffff;
  padding: 0 12px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

#analytics:hover {
  filter: brightness(1.08);
}

/* ── Non-blocking double-Tab confirmation ── */

.tab-switch-confirmation {
  position: fixed;
  top: 9.6rem;
  right: 1.25rem;
  z-index: 2060;
  width: min(22rem, calc(100vw - 2rem));
  box-sizing: border-box;
  overflow: hidden;
  padding: 0.9rem 1rem 1rem;
  border: 2px solid var(--theme);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 46px rgba(15, 68, 37, 0.25);
  color: var(--text);
  opacity: 1;
}

.tab-switch-confirmation[hidden] {
  display: none;
}

.tab-switch-confirmation.is-entering {
  animation: tab-switch-confirmation-enter 180ms ease;
}

.tab-switch-confirmation.is-reemphasized {
  animation: tab-switch-confirmation-pulse 240ms ease;
}

.tab-switch-confirmation-kicker {
  margin-bottom: 0.35rem;
  color: var(--theme);
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
}

.tab-switch-confirmation-title {
  color: #000d3f;
  font-size: 1rem;
  font-weight: 800;
}

.tab-switch-confirmation-copy {
  margin: 0.5rem 0 0;
  color: #334155;
  font-size: 0.84rem;
  line-height: 1.45;
}

.tab-switch-confirmation-status {
  margin-top: 0.55rem;
  padding: 0.42rem 0.55rem;
  border-left: 3px solid #f4c542;
  background: #fffbea;
  color: #674d00;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.tab-switch-confirmation[data-finished="true"] .tab-switch-confirmation-status {
  border-left-color: #fb7185;
  background: #fff1f2;
  color: #9f1239;
}

.tab-switch-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tab-switch-confirmation-actions button {
  min-height: 2.1rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: var(--white);
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.tab-switch-confirmation-actions .tab-switch-confirm {
  border-color: var(--theme);
  background: var(--theme);
  color: #ffffff;
}

.tab-switch-confirmation-accents {
  position: absolute;
  right: 0.8rem;
  top: 0.65rem;
  display: flex;
  gap: 0.2rem;
}

.tab-switch-confirmation-accents span {
  width: 0.75rem;
  height: 0.2rem;
  border-radius: 999px;
  background: #22c55e;
}

.tab-switch-confirmation-accents span:nth-child(2) { background: #38bdf8; }
.tab-switch-confirmation-accents span:nth-child(3) { background: #f4c542; }
.tab-switch-confirmation-accents span:nth-child(4) { background: #fb7185; }

@keyframes tab-switch-confirmation-enter {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tab-switch-confirmation-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

@media (max-width: 640px) {
  .sheets {
    gap: 1rem;
  }

  .tab-switch-confirmation {
    top: auto;
    right: 0.75rem;
    bottom: 4rem;
    width: min(20rem, calc(100vw - 1.5rem));
  }
}

.footer {
  display: flex;
  align-items: center;
  height: 1.5rem;
  font-size: 0.8rem;
  background-color: var(--bg);
  color: var(--text);
}

.footer-left {
  display: flex;
  gap: 16px;
}

.copyrighted,
.footer-link {
  color: var(--muted);
}

.footer-right {
  margin-left: auto;
  display: flex;
  gap: 16px;
}

.footer-link {
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.footer-link:visited,
.footer-link:hover,
.footer-link:focus,
.footer-link:active {
  color: var(--muted);
  text-decoration: none;
}

.help-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.help-dialog-overlay[hidden] {
  display: none;
}

.help-dialog {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 2rem));
  max-height: 80vh;
  max-height: 80dvh;
  background: var(--white);
  border: 1px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.consent-dialog {
  width: min(560px, calc(100vw - 2rem));
}

.consent-dialog .help-dialog-body {
  padding: 0.85rem;
}

.consent-dialog .help-cookie-consent {
  margin-bottom: 0;
}

.help-dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  background: #e2e8f0;
  color: #0f172a;
  border-bottom: 1px solid #cbd5e1;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
}

.help-dialog-close {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #94a3b8;
  background: var(--white);
  color: #0f172a;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.help-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.85rem 1rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--text);
  background: #f8fafc;
}

.help-welcome-link,
.help-welcome-link:visited,
.help-welcome-link:hover,
.help-welcome-link:active {
  color: var(--muted);
  text-decoration: none;
}

.help-cookie-consent {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.85rem;
}

.help-cookie-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.help-cookie-copy {
  color: #475569;
  line-height: 1.4;
}

.help-cookie-copy a,
.help-cookie-copy a:visited,
.help-cookie-copy a:hover,
.help-cookie-copy a:focus,
.help-cookie-copy a:active {
  color: var(--theme);
  text-decoration: underline;
}

.help-cookie-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.help-cookie-btn {
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.help-cookie-btn-accept {
  background: var(--theme);
  border-color: #12683a;
  color: #ffffff;
}

.help-dialog-welcome {
  border: 1px dashed #94a3b8;
  background: #ffffff;
  color: #475569;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.help-dialog-support {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2.25rem;
  margin-bottom: 0.9rem;
}

.help-dialog-support .bmc-btn,
.help-dialog-support .bmc-button {
  transform: scale(0.95);
  transform-origin: center;
}

.help-dialog-support .bmc-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #12683a;
  background: #158349;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.help-dialog-support .bmc-fallback:hover,
.help-dialog-support .bmc-fallback:focus,
.help-dialog-support .bmc-fallback:visited {
  color: #ffffff;
  text-decoration: none;
}

.help-dialog-section {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.75rem;
}

.help-dialog-title {
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.help-dialog-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

/* ── Sign-in dialog ── */

.signin-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.signin-dialog-overlay[hidden] {
  display: none;
}

.signin-dialog {
  width: min(380px, calc(100vw - 2rem));
  background: var(--white);
  border: 1px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.signin-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e2e8f0;
  color: #0f172a;
  border-bottom: 1px solid #cbd5e1;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
}

.signin-dialog-close {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #94a3b8;
  background: var(--white);
  color: #0f172a;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.signin-dialog-body {
  padding: 1rem;
  background: #f8fafc;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signin-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
}

.signin-input {
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.signin-input:focus {
  border-color: var(--theme);
  box-shadow: 0 0 0 2px rgba(21, 131, 73, 0.15);
}

.signin-btn {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--theme);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.signin-btn:hover {
  background: #116b3a;
}

.signin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.signin-error {
  color: #dc2626;
  font-size: 0.8rem;
  padding: 0.35rem 0;
}

.signin-error[hidden] {
  display: none;
}

/* ── Contact dialog ── */

.contact-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.28);
}

.contact-dialog-overlay[hidden] {
  display: none;
}

.contact-dialog {
  width: min(380px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
  overflow: auto;
}

.contact-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
}

.contact-dialog-close {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: var(--white);
  color: #0f172a;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.contact-dialog-close:hover {
  background: var(--white);
}

.contact-dialog-close:focus-visible,
.contact-input:focus,
.contact-submit-btn:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
}

.contact-dialog-body {
  padding: 1rem;
  background: #f8fafc;
}

.contact-dialog-intro {
  margin: 0 0 0.9rem;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.contact-field {
  display: grid;
  gap: 0.32rem;
  color: #1e293b;
  font-size: 0.85rem;
  font-weight: 600;
}

.contact-optional {
  margin-left: 0.28rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
}

.contact-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: var(--white);
  color: #0f172a;
  padding: 0.45rem 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
}

.contact-input:focus {
  border-color: var(--theme);
  outline: none;
  box-shadow: 0 0 0 2px rgba(21, 131, 73, 0.15);
}

.contact-textarea {
  min-height: 8rem;
  line-height: 1.45;
  resize: vertical;
}

.contact-feedback-meta {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: -0.48rem;
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.35;
}

.contact-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.contact-form-status {
  border: 1px solid #cbd5e1;
  border-left: 4px solid #64748b;
  border-radius: 6px;
  background: var(--white);
  color: #334155;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.contact-form-status[hidden] {
  display: none;
}

.contact-form-status.is-error {
  border-left-color: #dc2626;
  color: #991b1b;
}

.contact-form-status.is-success {
  border-left-color: var(--theme);
  background: #f0fdf4;
  color: #0f4425;
}

.contact-form-actions {
  display: block;
}

.contact-submit-btn {
  width: 100%;
  margin-top: 0.5rem;
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.contact-submit-btn {
  background: var(--theme);
  color: var(--white);
}

.contact-submit-btn:hover:not(:disabled) {
  background: #116b3a;
}

.contact-submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

@media (max-width: 520px) {
  .header-left,
  .header-right {
    gap: 0.55rem;
  }

  .contact-btn {
    padding: 0 0.58rem;
    font-size: 0.75rem;
  }

  .contact-dialog-body {
    padding: 0.85rem;
  }

  .contact-field-row {
    grid-template-columns: 1fr;
  }

  .contact-feedback-meta {
    align-items: flex-end;
  }
}

/* ── Sign-in button / profile dropdown ── */

.signout-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--white);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  padding: 0.5rem 0.65rem;
  z-index: 1500;
  white-space: nowrap;
  font-size: 0.8rem;
  color: #334155;
}

.signout-dropdown[hidden] {
  display: none;
}

.signout-dropdown-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.signout-dropdown-org {
  color: #64748b;
  margin-bottom: 0.5rem;
}

.signout-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.3rem 0.5rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
}

.signout-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.signout-btn:hover {
  background: #e2e8f0;
}

.policy-dialog-body {
  max-height: 65vh;
  overflow: auto;
}

.policy-dialog-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.policy-cookie-controls {
  margin-top: 1rem;
  margin-bottom: 0;
}

@keyframes gentle-pulse {
  0%, 100% { background-color: rgba(21, 131, 73, 0.05); }
  50% { background-color: rgba(21, 131, 73, 0.12); }
}

.welcome-start-cell {
  animation: gentle-pulse 2s ease-in-out infinite;
}

/* ── Challenge welcome instructions ── */

.challenge-instructions-overlay {
  position: absolute;
  z-index: 20;
  width: 38rem;
  box-sizing: border-box;
  overflow: visible;
  padding: 0.7rem;
  border: 1px solid #aebcc9;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  color: #1e293b;
}

.challenge-instructions {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  font-family: inherit;
  line-height: 1.35;
}

.challenge-instructions-header {
  border: 1px solid #000d3f;
  border-left: 5px solid var(--theme);
  border-radius: 7px;
  background: #000d3f;
  color: #ffffff;
  padding: 0.55rem 0.75rem;
}

.challenge-instructions h2,
.challenge-instructions h3,
.challenge-instructions p {
  margin: 0;
}

.challenge-instructions h2 {
  font-size: 1rem;
  line-height: 1.25;
}

.challenge-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
}

.challenge-answer-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.challenge-v2-answer-cards {
  grid-template-columns: 1fr;
}

.challenge-v2-guide-key-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.52rem;
}

.challenge-v2-guide-key-sequence > span:first-child {
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

.challenge-v2-guide-key-sequence kbd,
.challenge-v2-guide-correction kbd {
  display: inline-flex;
  min-width: 2rem;
  min-height: 1.65rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.48rem;
  border: 1px solid #64748b;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.challenge-v2-guide-history-row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem;
  align-items: stretch;
  margin-top: 0.52rem;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.challenge-v2-guide-history-row.is-correct {
  background: rgba(21, 131, 73, 0.15);
  color: #14532d;
}

.challenge-v2-guide-history-row.is-wrong {
  background: rgba(255, 0, 0, 0.15);
  color: #991b1b;
}

.challenge-v2-guide-history-number,
.challenge-v2-guide-history-status {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #cbd5e1;
  font-weight: 800;
}

.challenge-v2-guide-history-status {
  border-right: 0;
  border-left: 1px solid #cbd5e1;
}

.challenge-v2-guide-history-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
  padding: 0.38rem 0.45rem;
}

.challenge-v2-guide-history-copy strong,
.challenge-v2-guide-history-copy small {
  overflow-wrap: anywhere;
}

.challenge-v2-guide-worksheet {
  display: grid;
  grid-template-columns: 2.6rem repeat(2, minmax(0, 1fr));
  margin-top: 0.52rem;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.challenge-v2-guide-worksheet > span {
  min-width: 0;
  padding: 0.3rem 0.35rem;
  border-top: 1px solid #cbd5e1;
  border-left: 1px solid #cbd5e1;
  background: #ffffff;
}

.challenge-v2-guide-worksheet .is-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f4;
  color: #475569;
  font-weight: 700;
}

.challenge-v2-guide-worksheet .is-selected {
  background: rgba(21, 131, 73, 0.13);
  box-shadow: inset 0 0 0 2px var(--theme);
}

.challenge-v2-guide-worksheet .is-changed {
  background: #fff2cc;
  color: #0f5132;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px var(--theme);
}

.challenge-v2-guide-correction {
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  margin-top: 0.45rem;
}

.challenge-v2-guide-correction > span:nth-child(2) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.challenge-v2-guide-correction small {
  color: #64748b;
}

.challenge-v2-guide-auto-accept {
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  margin-top: 0.45rem;
  color: #12683a;
  text-align: center;
}

.challenge-v2-guide-auto-accept strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.challenge-answer-card {
  align-self: start;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #64748b;
  border-radius: 7px;
  background: #ffffff;
  padding: 0.6rem;
}

.challenge-answer-card.is-correct {
  border-top-color: var(--theme);
  background: #f3fbf6;
}

.challenge-answer-card.is-wrong {
  border-top-color: #dc5865;
  background: #fff7f7;
}

.challenge-answer-card.is-fix {
  border-top-color: #2563a6;
  background: #f4f9ff;
}

.challenge-answer-card h3,
.challenge-key-guide h3,
.challenge-combo-guide h3 {
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 800;
}

.challenge-answer-card h3 span {
  color: var(--theme);
}

.challenge-answer-card.is-wrong h3 span {
  color: #c2414b;
}

.challenge-answer-card p {
  margin-top: 0.42rem;
  color: #475569;
  font-size: 0.72rem;
}

.challenge-mini-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(4rem, 0.65fr);
  margin-top: 0.48rem;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  font-size: 0.66rem;
}

.challenge-mini-sheet > span {
  min-width: 0;
  border-top: 1px solid #cbd5e1;
  border-left: 1px solid #cbd5e1;
  padding: 0.25rem 0.32rem;
}

.challenge-mini-sheet > span:nth-child(3) {
  background: #ffffff;
}

.challenge-mini-sheet .challenge-mini-header {
  border-color: #000d3f;
  background: #000d3f;
  color: #ffffff;
  font-weight: 700;
}

.challenge-mini-answer {
  box-shadow: inset 0 -2px 0 var(--theme);
  background: #e8f5ed;
  color: #14532d;
}

.challenge-mini-answer.is-empty-answer {
  background: #ffffff;
  color: #334155;
}

.challenge-mini-answer.is-wrong-answer {
  box-shadow: inset 0 -2px 0 #dc5865;
  background: #f9d9dc;
  color: #991b1b;
}

.challenge-mini-answer.is-entered-answer {
  box-shadow: inset 0 -2px 0 var(--theme);
  background: #ffffff;
  color: #334155;
}

.challenge-mini-answer.is-corrected-answer {
  box-shadow: inset 0 -2px 0 var(--theme);
  background: #dcefe3;
  color: #14532d;
}

.challenge-key-flow,
.challenge-combo-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.52rem;
}

.challenge-key-flow kbd,
.challenge-key-guide kbd,
.challenge-combo-keys kbd {
  display: inline-flex;
  min-width: 2rem;
  min-height: 1.65rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border: 1px solid #64748b;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.15rem 0.48rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.challenge-flow-arrow {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 800;
}

.challenge-vertical-answer-flow {
  display: grid;
  gap: 0.12rem;
  margin-top: 0.48rem;
}

.challenge-vertical-answer-flow .challenge-mini-sheet {
  margin-top: 0;
}

.challenge-vertical-key-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
}

.challenge-vertical-key-step .challenge-flow-arrow {
  font-size: 0.76rem;
  line-height: 0.65rem;
}

.challenge-vertical-key-step kbd {
  display: inline-flex;
  min-width: 2rem;
  min-height: 1.45rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border: 1px solid #64748b;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.1rem 0.42rem;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.challenge-key-guide,
.challenge-combo-guide {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  padding: 0.62rem 0.7rem;
}

.challenge-key-guide-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-top: 0.48rem;
}

.challenge-key-guide-items > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.38rem;
  border-left: 3px solid #bfdbcc;
  background: #f8fafc;
  padding: 0.38rem;
  color: #475569;
  font-size: 0.68rem;
}

.challenge-key-guide-items .is-mac {
  flex-wrap: wrap;
}

.challenge-key-guide-items small {
  color: #64748b;
  font-size: 0.62rem;
}

.challenge-combo-guide {
  border-color: #9fb3c8;
  background: #eef5fb;
}

.challenge-combo-heading {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.2rem;
}

.challenge-combo-heading p {
  color: #526477;
  font-size: 0.7rem;
}

.challenge-combo-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.challenge-combo-card {
  min-width: 0;
  border: 1px solid #b7c7d8;
  border-radius: 6px;
  background: #ffffff;
  padding: 0.52rem;
  text-align: center;
}

.challenge-combo-badge {
  display: inline-block;
  border-radius: 999px;
  background: var(--theme);
  color: #ffffff;
  padding: 0.18rem 0.48rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.challenge-combo-card.is-sequence .challenge-combo-badge {
  background: #2563a6;
}

.challenge-combo-card p {
  min-height: 2em;
  margin-top: 0.35rem;
  color: #475569;
  font-size: 0.68rem;
}

.challenge-combo-card small {
  display: block;
  margin-top: 0.38rem;
  color: #64748b;
  font-size: 0.62rem;
}

.challenge-instructions,
.challenge-instructions * {
  font-size: 1rem !important;
}

.challenge-vertical-key-step .challenge-flow-arrow {
  line-height: 1rem;
}

@media (max-width: 760px) {
  .challenge-combo-card p {
    min-height: 0;
  }
}

/* ── Challenge start sequence ── */

.challenge-start-overlay {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(1.5px);
}

.challenge-start-overlay[hidden] {
  display: none;
}

.challenge-start-overlay.is-releasing {
  pointer-events: none;
  animation: challenge-start-release 260ms ease forwards;
}

.challenge-start-card {
  position: relative;
  width: min(31rem, calc(100vw - 2rem));
  min-height: 9rem;
  box-sizing: border-box;
  overflow: hidden;
  padding: 1.2rem 1.35rem 1.15rem;
  border: 2px solid var(--theme);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 60px rgba(15, 68, 37, 0.28);
  color: var(--text);
  text-align: center;
  animation: challenge-start-enter 220ms ease both;
}

.challenge-start-content {
  max-width: 27rem;
  min-width: 0;
  margin: 0 auto;
}

.challenge-start-kicker {
  margin-bottom: 0.55rem;
  color: var(--theme);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challenge-start-value {
  color: #000d3f;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.45rem, 6vw, 2.5rem);
  line-height: 1.25;
}

.challenge-start-message {
  margin-top: 0.65rem;
  color: #334155;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.45;
}

.challenge-start-cancel {
  margin-top: 0.85rem;
  min-width: 6.5rem;
  padding: 0.48rem 0.8rem;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: var(--white);
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

.challenge-start-cancel:hover {
  background: #f1f5f9;
}

.challenge-start-cancel:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
}

.challenge-start-overlay[data-stage="briefing"] .challenge-start-value {
  color: var(--theme);
  font-size: clamp(1.05rem, 4.5vw, 1.55rem);
}

.challenge-start-overlay[data-stage="error"] .challenge-start-value {
  color: #b91c1c;
  font-size: clamp(1rem, 4vw, 1.35rem);
}

.challenge-start-accents {
  position: absolute;
  right: 1rem;
  bottom: 0.7rem;
  display: flex;
  gap: 0.3rem;
}

.challenge-start-accents span {
  width: 1.25rem;
  height: 0.25rem;
  border-radius: 999px;
  background: #22c55e;
}

.challenge-start-accents span:nth-child(2) { background: #38bdf8; }
.challenge-start-accents span:nth-child(3) { background: #f4c542; }
.challenge-start-accents span:nth-child(4) { background: #fb7185; }

@keyframes challenge-start-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes challenge-start-release {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 480px) {
  .challenge-start-card {
    min-height: 11.5rem;
    padding: 1.15rem 1.1rem 1.4rem;
  }
}

/* ── Clippy (#REF! character) ── */

.clippy {
  position: fixed;
  bottom: 4rem;
  right: 1.5rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.clippy-bubble {
  background: var(--white);
  border: 2px solid var(--supermuted);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  max-width: 210px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.clippy-bubble.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.clippy-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: var(--white);
  border-right: 2px solid var(--supermuted);
  border-bottom: 2px solid var(--supermuted);
  transform: rotate(45deg);
}

.clippy-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  animation: clippy-bounce 3s ease-in-out infinite;
  user-select: none;
}

.clippy-eyes {
  display: flex;
  gap: 18px;
  margin-bottom: -5px;
  position: relative;
  z-index: 1;
}

.clippy-eye {
  width: 8px;
  height: 8px;
  background: #0f4425;
  border-radius: 0;
  animation: clippy-blink 4s step-end infinite;
}

@keyframes clippy-blink {
  0%, 92% { height: 8px; }
  94%, 96% { height: 2px; margin-top: 4px; }
  98% { height: 8px; margin-top: 0; }
}

.clippy-label {
  font-family: "Press Start 2P";
  font-size: 1.4rem;
  font-weight: 900;
  color: #158349;
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.clippy-mouth {
  width: 16px;
  height: 6px;
  border-bottom: 3px solid #0f4425;
  border-radius: 0 0 6px 6px;
  margin-top: -3px;
}

.clippy-error {
  position: fixed;
  bottom: 4rem;
  right: 1.5rem;
  z-index: 1500;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #991b1b;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.clippy-error.fade-out {
  opacity: 0;
}

@keyframes clippy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes clippy-tickle-jump {
  0% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
  60% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* 1.5s happy reaction: two hops when the user answers a feedback question. */
@keyframes clippy-happy-jump {
  0% { transform: translateY(0); }
  20% { transform: translateY(-12px); }
  40% { transform: translateY(0); }
  60% { transform: translateY(-7px); }
  80% { transform: translateY(0); }
  100% { transform: translateY(0); }
}

/* ── Feedback survey (rendered inside the #REF! speech bubble) ── */

.clippy-bubble.feedback-mode {
  max-width: none;
  width: 250px;
  padding: 0.7rem 0.8rem;
  font-size: 0.78rem;
  border-color: var(--theme);
  box-shadow: 0 8px 24px rgba(21, 131, 73, 0.28);
  pointer-events: auto;
  animation: feedback-pop 0.45s ease;
}

.clippy-bubble.scorecard-mode {
  position: relative;
  right: 1rem;
  bottom: 1rem;
  width: min(300px, calc(100vw - 4rem));
  box-sizing: border-box;
  padding: 0.85rem 0.95rem;
  font-size: 0.9rem;
}

/* One-shot attention pop on entry (not looping, to avoid distraction). */
@keyframes feedback-pop {
  0% { transform: translateY(4px) scale(0.96); }
  60% { transform: translateY(0) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.feedback-survey {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 132px;
  justify-content: center;
}

.feedback-close {
  position: absolute;
  top: -0.3rem;
  right: -0.35rem;
  display: inline-flex;
  width: 1.55rem;
  height: 1.55rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.feedback-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.feedback-close:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 1px;
}

.feedback-q {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.feedback-emojis {
  display: flex;
  justify-content: space-between;
  gap: 0.15rem;
}

.feedback-emoji {
  font-size: 1.35rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 6px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.feedback-emoji:hover {
  transform: scale(1.25);
  background: rgba(21, 131, 73, 0.1);
}

.feedback-emoji:active {
  transform: scale(1.05);
}

.feedback-textarea {
  width: 100%;
  height: 70px;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid var(--supermuted);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text);
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--theme);
}

.feedback-counter {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
}

.feedback-counter.warn { color: #b45309; }
.feedback-counter.over { color: #dc2626; font-weight: 700; }

.feedback-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.feedback-actions.end { justify-content: flex-end; }

.feedback-skip {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  text-decoration: underline;
  padding: 0.2rem 0.1rem;
}

.feedback-skip:hover { color: var(--text); }

.feedback-submit {
  background: var(--theme);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
}

.feedback-submit:hover { filter: brightness(1.05); }

/* ── Challenge scorecard flow ── */

.scorecard-offer,
.scorecard-progress-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 132px;
  justify-content: center;
}

.scorecard-offer-title {
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.45;
}

.scorecard-offer-summary {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.scorecard-offer-actions,
.scorecard-dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.scorecard-primary-btn,
.scorecard-secondary-btn,
.scorecard-copy-btn,
.scorecard-download-btn,
.scorecard-share-btn {
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.scorecard-primary-btn,
.scorecard-share-btn {
  border: 1px solid var(--theme);
  background: var(--theme);
  color: var(--white);
  padding: 0.4rem 0.68rem;
}

.scorecard-secondary-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.25rem;
  text-decoration: underline;
}

.scorecard-primary-btn:hover,
.scorecard-share-btn:hover {
  filter: brightness(1.06);
}

.scorecard-inline-error,
.scorecard-dialog-status.error {
  color: #b91c1c;
  font-size: 0.7rem;
  line-height: 1.35;
}

.scorecard-progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid #b7c5bd;
  border-radius: 999px;
  background: #edf4ef;
}

.scorecard-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--theme);
  transition: width 160ms ease;
}

.scorecard-progress-value {
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.scorecard-ready-message {
  min-height: 80px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-weight: 700;
  line-height: 1.4;
}

.scorecard-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.44);
}

.scorecard-dialog-overlay[hidden] {
  display: none;
}

.scorecard-dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}

.scorecard-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #cbd5e1;
  background: #e9f8ef;
  color: #0f4425;
  font-weight: 700;
}

.scorecard-dialog-subtitle {
  margin-top: 0.2rem;
  color: #52675a;
  font-size: 0.78rem;
  font-weight: 400;
}

.scorecard-dialog-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: var(--white);
  color: #0f172a;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.scorecard-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  grid-template-areas:
    "preview caption"
    "preview status"
    "preview actions";
  gap: 0.85rem 1rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
  padding: 1rem;
  background: #f8fafc;
}

.scorecard-preview {
  grid-area: preview;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.scorecard-preview-canvas {
  display: block;
  width: min(100%, 560px);
  height: auto;
  border: 1px solid #b7c5bd;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 68, 37, 0.14);
}

.scorecard-caption-panel {
  grid-area: caption;
  align-self: start;
  padding: 0.7rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--white);
}

.scorecard-caption-title {
  margin-bottom: 0.4rem;
  color: #0f4425;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scorecard-caption-preview {
  margin: 0;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.scorecard-dialog-status {
  grid-area: status;
  align-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.scorecard-dialog-actions {
  grid-area: actions;
  align-self: end;
  flex-direction: column;
  align-items: stretch;
}

.scorecard-copy-btn,
.scorecard-download-btn {
  border: 1px solid #94a3b8;
  background: var(--white);
  color: #0f172a;
  padding: 0.5rem 0.75rem;
}

.scorecard-share-btn {
  padding: 0.55rem 0.75rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sheet-status-pill,
.sheet-beta-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.sheet-status-pill.is-new {
  background: #dcfce7;
  color: #166534;
}

.sheet-status-pill.is-old {
  background: #e2e8f0;
  color: #475569;
}

.sheet-tab-separator {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

#superseded {
  align-self: stretch;
  padding: 0 0.65rem;
  background: transparent;
  color: #94a3b8;
}

#challenge-old,
#comps-old,
#practice {
  display: flex;
  align-self: stretch;
  align-items: center;
  padding: 0 0.45rem;
  background: transparent;
  color: #94a3b8;
}

#challenge-old .sheet-status-pill.is-old,
#comps-old .sheet-status-pill.is-old,
#practice .sheet-status-pill.is-old {
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #94a3b8;
}

.challenge-v2-course-panel-title {
  grid-template-columns: 4.75rem minmax(0, 1fr) auto;
}

.challenge-instructions-overlay.is-challenge-v2 {
  z-index: 1520;
}

.challenge-v2-start-row .learn-course-row-leading {
  position: relative;
  z-index: 2;
  justify-content: flex-start;
  overflow: visible;
}

.challenge-v2-start-action {
  min-width: 7rem;
  min-height: 1.55rem;
  margin-left: 0.28rem;
  padding: 0.16rem 0.75rem;
  border: 1px solid #0f6336;
  border-radius: 4px;
  background: var(--theme);
  color: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
}

.challenge-v2-start-action:hover,
.challenge-v2-start-action:focus-visible {
  background: #0f6336;
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.challenge-v2-start-action:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

.challenge-v2-score-heading .learn-course-row-leading {
  position: relative;
  z-index: 2;
  justify-content: flex-start;
  overflow: visible;
  padding-left: 0.55rem;
  white-space: nowrap;
}

.challenge-v2-question-title {
  color: #000d3f !important;
  font-weight: 700;
}

.challenge-v2-grid-requirement {
  color: #000d3f !important;
  font-weight: 700;
}

.challenge-v2-persistent-instruction,
.challenge-v2-pre-game-recommendation {
  color: #44546a !important;
  font-weight: 700;
}

.challenge-v2-welcome-grid-overlay {
  position: absolute;
  z-index: 8;
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  border: 1px solid #0f5132;
  border-radius: 8px;
  background: #e8f5ed;
  color: #0f5132;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.challenge-v2-header-action {
  align-self: center;
  min-width: 4.8rem;
  min-height: 1.55rem;
  margin-right: 0.28rem;
  padding: 0.16rem 0.58rem;
  border: 1px solid #0f6336;
  border-radius: 4px;
  background: var(--theme);
  color: #ffffff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

.challenge-v2-header-action:hover,
.challenge-v2-header-action:focus-visible {
  background: #0f6336;
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.challenge-v2-header-action:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

.challenge-v2-history-row {
  min-height: 3.3rem;
}

.challenge-v2-history-row.is-correct {
  background: rgba(21, 131, 73, 0.15);
  color: #14532d;
}

.challenge-v2-history-row.is-wrong {
  background: rgba(255, 0, 0, 0.15);
  color: #991b1b;
}

.challenge-v2-history-row > span {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.challenge-v2-history-copy {
  display: grid !important;
  align-content: center;
  gap: 0.1rem;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.challenge-v2-history-copy strong,
.challenge-v2-history-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.challenge-v2-history-copy small {
  font-size: 0.72rem;
  font-weight: 600;
}

.challenge-v2-result {
  display: grid;
  gap: 0;
  padding: 0;
  border-top: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
}

.challenge-v2-result p {
  margin: 0;
  padding: 0.5rem 0.55rem;
  background: #f1f5f9;
  font-size: 0.7rem;
  line-height: 1.35;
}

.challenge-v2-result-row {
  display: grid;
  min-height: 2rem;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid #cbd5e1;
}

.challenge-v2-result-row > * {
  display: flex;
  min-width: 0;
  box-sizing: border-box;
  align-items: center;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-right: 1px solid #cbd5e1;
  border-radius: 0;
}

.challenge-v2-result-row > *:last-child {
  border-right: 0;
}

label.challenge-v2-result-row > span:first-child,
.challenge-v2-result-submit-row button {
  background: #000d3f;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.challenge-v2-result-score-row > * {
  background: #000d3f;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.challenge-v2-result-best-row > * {
  background: rgba(21, 131, 73, 0.12);
  color: #166534;
  font-size: 1rem;
  font-weight: 700;
}

.challenge-v2-result input {
  width: 100%;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 1rem;
}

.challenge-v2-result input:focus {
  border-color: var(--theme);
  outline: 2px solid rgba(21, 131, 73, 0.22);
  outline-offset: 0;
}

.challenge-v2-result button {
  width: 100%;
  justify-content: center;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.challenge-v2-result button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.challenge-v2-result small {
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0.7rem 0.55rem;
  color: #334155;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.35;
}
@media (max-width: 680px) {
  .scorecard-dialog-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "preview"
      "caption"
      "status"
      "actions";
  }

  .scorecard-dialog-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .scorecard-dialog-actions button {
    flex: 1 1 8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-start-card,
  .challenge-start-overlay.is-releasing {
    animation: none;
  }

  .scorecard-progress-fill {
    transition: none;
  }
}

