.excel-story-page {
  --excel-green: #107c41;
  --excel-green-deep: #0b5f32;
  --excel-green-soft: #e7f5ed;
  --excel-blue: #2563eb;
  --excel-gold: #e9a23b;
}

.excel-story-hero .story-hero-card {
  background: linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(255, 255, 255, .92) 46%, rgba(233, 162, 59, .12));
}

html[data-theme="dark"] .excel-story-hero .story-hero-card {
  background: linear-gradient(135deg, rgba(16, 124, 65, .2), rgba(16, 28, 39, .96) 48%, rgba(233, 162, 59, .12));
}

.excel-story-hero .story-hero-copy h1 > span,
.excel-story-hero .story-hero-copy h1 > em,
.excel-story-page .presentation-slide[data-visual="workbook-preview"] h2 > span,
.excel-story-page .presentation-slide[data-visual="workbook-preview"] h2 > em {
  display: block;
}

.excel-story-hero .story-hero-copy h1 > em,
.excel-story-page .presentation-slide[data-visual="workbook-preview"] h2 > em {
  margin-top: .08em;
}

.excel-story-page .story-kicker,
.excel-story-page .presentation-eyebrow {
  color: var(--excel-green);
}

.excel-story-page .story-section-index {
  color: #fff;
  background: var(--excel-blue);
}

.excel-story-page .story-action.primary,
.excel-story-page .download-card.primary-download {
  background: var(--excel-green);
  border-color: var(--excel-green);
  color: #fff;
}

.excel-story-page .story-action.primary:hover,
.excel-story-page .download-card.primary-download:hover {
  background: var(--excel-green-deep);
  border-color: var(--excel-green-deep);
}

.excel-story-page .story-summary {
  margin-top: 0;
}

.excel-hero-media {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  min-height: 410px;
  background: #10283b;
}

.excel-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
}

.excel-hero-badge {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(9, 33, 48, .84);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  backdrop-filter: blur(12px);
}

.excel-course-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.excel-course-step {
  min-height: 156px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: var(--surface);
}

.excel-course-step span {
  display: block;
  margin-bottom: 12px;
  color: var(--excel-green);
  font-weight: 800;
  letter-spacing: .08em;
}

.excel-course-step strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.excel-course-step p {
  margin: 0;
  color: var(--text-soft);
  font-size: .9rem;
}

.excel-tool-compare,
.excel-formula-grid,
.excel-download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.excel-tool-card,
.excel-formula-card,
.download-card {
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--surface);
}

.excel-tool-card strong,
.excel-formula-card strong,
.download-card strong {
  display: block;
  margin-bottom: 8px;
}

.excel-tool-card p,
.excel-formula-card p,
.download-card p {
  margin: 0;
  color: var(--text-soft);
}

.excel-formula-card code {
  display: inline-block;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--excel-green-soft);
  color: var(--excel-green-deep);
  font-size: 1rem;
  font-weight: 800;
}

html[data-theme="dark"] .excel-formula-card code {
  background: rgba(16, 124, 65, .22);
  color: #7fe0aa;
}

.excel-ui-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.excel-ui-shot {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #10283b;
}

.excel-ui-shot .excel-ui-crop {
  overflow: hidden;
  aspect-ratio: 16 / 8.4;
}

.excel-ui-shot img {
  display: block;
  width: 119%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.excel-ui-shot figcaption {
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: .82rem;
}

.excel-practice-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 24px 0;
}

.excel-practice-sequence span {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--excel-green-soft);
  color: var(--excel-green-deep);
  font-weight: 700;
}

.excel-practice-sequence i {
  color: var(--text-soft);
  font-style: normal;
}

.excel-download-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.download-card:hover {
  transform: translateY(-3px);
  border-color: var(--excel-green);
  box-shadow: 0 18px 40px rgba(23, 50, 77, .12);
}

.download-card .download-meta {
  margin-top: auto;
  padding-top: 18px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.download-card.primary-download p,
.download-card.primary-download .download-meta {
  color: rgba(255,255,255,.82);
}

.excel-data-note {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 4px solid var(--excel-gold);
  border-radius: 0 14px 14px 0;
  background: rgba(233, 162, 59, .12);
}

.excel-slide-formula {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 520px);
  margin-top: 24px;
  padding: 18px 28px;
  border: 1px solid rgba(16, 124, 65, .25);
  border-radius: 18px;
  background: rgba(16, 124, 65, .1);
  color: var(--excel-green-deep);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 800;
}

html[data-theme="dark"] .excel-slide-formula {
  color: #83e4ae;
}

.presentation-slide.excel-cropped-background {
  background-size: 119% auto;
  background-position: left top;
}

.presentation-slide.excel-cropped-background::before {
  background: linear-gradient(90deg, rgba(8, 24, 35, .92) 0%, rgba(8, 24, 35, .78) 48%, rgba(8, 24, 35, .2) 100%);
}

.presentation-slide .excel-slide-path {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.presentation-slide .excel-slide-path span {
  padding: 11px 15px;
  border-radius: 999px;
  background: rgba(16, 124, 65, .14);
  border: 1px solid rgba(16, 124, 65, .2);
  font-weight: 700;
}

.excel-story-page .slide-stat strong {
  color: var(--excel-green);
}

.excel-story-page .presentation-slide.has-background .slide-stat strong,
.excel-story-page .presentation-slide.has-background .presentation-eyebrow {
  color: #7ee2a9;
}

/* Excel Level 1 teaching deck — scoped to this page so shared article decks stay unchanged. */
.excel-story-page .presentation-shell {
  --xl1-panel: rgba(255, 255, 255, .075);
  --xl1-panel-strong: rgba(255, 255, 255, .12);
  --xl1-line: rgba(255, 255, 255, .16);
  --xl1-muted: rgba(234, 244, 255, .68);
  --xl1-ink: #f5fbff;
  --xl1-accent: #76e2aa;
  --xl1-accent-strong: #18a560;
  --xl1-problem: #ffb3a7;
  --xl1-warn: #ffd37a;
}

html[data-theme="light"] .excel-story-page .presentation-shell {
  --xl1-panel: rgba(255, 255, 255, .72);
  --xl1-panel-strong: rgba(255, 255, 255, .92);
  --xl1-line: rgba(20, 76, 55, .18);
  --xl1-muted: #566776;
  --xl1-ink: #102b23;
  --xl1-accent: #006b35;
  --xl1-accent-strong: #006b35;
  --xl1-problem: #b42318;
  --xl1-warn: #8a5a00;
}

html[data-theme="light"] .excel-story-page .excel-type-board article > span {
  color: #fff;
}

/* Keep Level 1 copy legible without adding a visible panel behind the copy. */
.excel-story-page .presentation-slide .presentation-copy {
  position: relative;
  z-index: 1;
  color: var(--xl1-ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .34);
}

.excel-story-page .presentation-shell .presentation-eyebrow {
  color: #8af0b7;
}

.excel-story-page .presentation-slide .presentation-copy :where(h2, .slide-lead, .slide-quote) {
  position: relative;
  z-index: 1;
}

.excel-story-page .presentation-slide .presentation-copy .slide-lead {
  color: var(--xl1-muted);
}

.excel-story-page .presentation-slide .slide-quote {
  color: #f7fbff;
  border-color: #ffd37a;
  background: rgba(7, 32, 44, .94);
  text-shadow: none;
}

html[data-theme="light"] .excel-story-page .presentation-slide .presentation-copy {
  text-shadow: none;
}

html[data-theme="light"] .excel-story-page .presentation-shell .presentation-eyebrow {
  color: #08753c;
}

html[data-theme="light"] .excel-story-page .presentation-shell {
  --xl1-muted: #485a68;
}

html[data-theme="light"] .excel-story-page .presentation-credit-site span {
  color: #445663;
}

html[data-theme="light"] .excel-story-page .presentation-slide .slide-quote {
  color: #102b23;
  border-color: #8a5a00;
  background: rgba(255, 255, 255, .97);
}

.excel-story-page .presentation-slide :where(.excel-challenge-chips span, .excel-slide-route span) {
  color: var(--xl1-ink);
  border-color: var(--xl1-line);
  background: var(--xl1-panel-strong);
}

.excel-story-page .excel-shot-panel figcaption {
  color: #f7fbff;
  border-top: 1px solid rgba(255, 255, 255, .16);
  background: #082335;
}

html[data-theme="light"] .excel-story-page .excel-shot-panel figcaption {
  color: #fff;
  border-color: rgba(255, 255, 255, .2);
  background: #164531;
}

@media (max-width: 760px) {
  .excel-story-page .presentation-slide .presentation-copy::before {
    inset: 0;
    border-radius: 16px;
    box-shadow: 0 0 0 12px rgba(4, 18, 28, .9), 0 14px 34px rgba(0, 0, 0, .18);
  }

  html[data-theme="light"] .excel-story-page .presentation-slide .presentation-copy::before {
    box-shadow: 0 0 0 12px rgba(249, 252, 250, .96), 0 14px 34px rgba(18, 54, 43, .1);
  }
}

.excel-story-page .excel-teaching-slide {
  grid-template-columns: minmax(0, .88fr) minmax(430px, 1.12fr);
  gap: clamp(24px, 3.5vw, 54px);
}

.excel-story-page .excel-teaching-slide h2 {
  font-size: clamp(30px, 3.65vw, 56px);
}

.excel-story-page .excel-teaching-slide .slide-lead {
  max-width: 760px;
}

.excel-story-page .presentation-brand-slide {
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: clamp(26px, 4vw, 64px);
  padding-inline: clamp(42px, 7vw, 112px);
}

.excel-story-page .presentation-brand-cover {
  width: auto;
}

.excel-story-page .presentation-brand-cover > img {
  width: min(390px, 38vw);
  max-height: 118px;
  margin-bottom: 24px;
}

.excel-story-page .presentation-brand-slide .presentation-visual {
  display: block;
}

.excel-story-page .presentation-visual {
  min-width: 0;
  max-width: 100%;
}

.excel-story-page .presentation-visual img {
  display: block;
  width: 100%;
  max-height: none;
  object-fit: contain;
}

.excel-shot-panel {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--xl1-line);
  border-radius: 22px;
  background: #f7fafc;
  box-shadow: 0 26px 62px rgba(0, 0, 0, .25);
}

.excel-shot-panel > img {
  aspect-ratio: 16 / 9;
  object-fit: contain !important;
  object-position: center;
  background: #fff;
}

/* Focused screenshot windows keep only the interface area taught on each slide. */
.excel-focus-frame,
.excel-tab-focus {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.excel-focus-frame {
  height: clamp(230px, 34vh, 360px);
}

.excel-focus-frame > img,
.excel-tab-focus > img {
  position: absolute;
  left: var(--focus-left, 0);
  top: var(--focus-top, 0);
  display: block;
  width: var(--focus-width, 150%) !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  object-fit: initial !important;
}

.excel-focus-frame.is-static-crop,
.excel-tab-focus.is-static-crop {
  display: grid;
  height: auto;
  min-height: 0;
  place-items: center;
}

.excel-focus-frame.is-static-crop > img,
.excel-tab-focus.is-static-crop > img {
  position: static;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

.excel-shot-panel > img.excel-crop-image {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}

.focus-worksheet-tabs {
  --focus-width: 140%;
  --focus-top: -72%;
}

.focus-backstage-menu {
  --focus-width: 155%;
  --focus-top: -3%;
}

.focus-ribbon-left {
  --focus-width: 190%;
  --focus-top: -15%;
}

.focus-ribbon-right {
  --focus-width: 190%;
  --focus-left: -75%;
  --focus-top: -15%;
}

.focus-ribbon-insert {
  --focus-width: 150%;
  --focus-left: -8%;
  --focus-top: -15%;
}

.focus-ribbon-data {
  --focus-width: 160%;
  --focus-left: -20%;
  --focus-top: -15%;
}

.focus-sheet-top {
  --focus-width: 170%;
  --focus-top: -8%;
}

.focus-format-table,
.focus-mini-table,
.focus-mini-answer-table,
.focus-mini-answer-summary {
  --focus-width: 128%;
}

.focus-format-table,
.focus-mini-table,
.focus-mini-answer-table {
  --focus-top: -2%;
}

.focus-mini-answer-summary {
  --focus-top: -54%;
}

.excel-shot-panel figcaption {
  padding: 11px 15px;
  color: #dbe9f4;
  background: #0d2a3c;
  font-size: clamp(10px, .8vw, 13px);
  line-height: 1.45;
}

.excel-self-check-board,
.excel-review-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.excel-self-check-board article,
.excel-review-board article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  min-height: 130px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--xl1-line);
  border-radius: 17px;
  background: var(--xl1-panel);
}

.excel-self-check-board article:first-child {
  grid-column: 1 / -1;
}

.excel-self-check-board b,
.excel-review-board b {
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #06281b;
  background: #76e2aa;
  font: 800 12px/1 Manrope, sans-serif;
}

.excel-self-check-board strong,
.excel-review-board strong {
  color: var(--xl1-ink);
  font-size: clamp(15px, 1.4vw, 22px);
}

.excel-self-check-board span,
.excel-review-board span,
.excel-self-check-board > p {
  color: var(--xl1-muted);
  font-size: clamp(10px, .85vw, 13px);
  line-height: 1.4;
}

.excel-self-check-board > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid rgba(118, 226, 170, .28);
  border-radius: 13px;
  background: rgba(16, 124, 65, .16);
  text-align: center;
}

html[data-theme="light"] .excel-shot-panel figcaption {
  color: #f6fbff;
  background: #164531;
}

.excel-slide-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
}

.excel-slide-route span {
  padding: 8px 11px;
  border: 1px solid rgba(118, 226, 170, .24);
  border-radius: 999px;
  color: var(--xl1-ink);
  background: rgba(16, 124, 65, .2);
  font-size: clamp(10px, .85vw, 13px);
  font-weight: 800;
}

.excel-slide-route i {
  color: var(--xl1-accent);
  font-style: normal;
  font-weight: 800;
}

.excel-goal-grid,
.excel-program-grid,
.excel-type-board,
.excel-code-demo,
.excel-number-format,
.excel-wrap-compare,
.excel-colour-roles,
.excel-check-grid,
.excel-formula-checks,
.excel-case-tasks,
.excel-summary-pillars {
  display: grid;
  gap: 12px;
}

.excel-goal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.excel-goal-grid article,
.excel-program-grid article,
.excel-type-board article,
.excel-colour-roles article,
.excel-check-grid > span,
.excel-formula-checks article,
.excel-case-tasks article,
.excel-summary-pillars article {
  min-width: 0;
  padding: clamp(13px, 1.4vw, 20px);
  border: 1px solid var(--xl1-line);
  border-radius: 17px;
  background: var(--xl1-panel);
}

.excel-goal-grid article {
  min-height: 150px;
}

.excel-goal-grid b,
.excel-formula-checks b,
.excel-case-tasks b,
.excel-summary-pillars b {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #052718;
  background: var(--xl1-accent);
  font: 800 14px/1 Manrope, sans-serif;
}

.excel-goal-grid strong,
.excel-program-grid strong,
.excel-type-board strong,
.excel-colour-roles strong,
.excel-check-grid b,
.excel-formula-checks strong,
.excel-case-tasks strong,
.excel-summary-pillars strong {
  display: block;
  margin-top: 12px;
  color: var(--xl1-ink);
  font-size: clamp(15px, 1.3vw, 21px);
  line-height: 1.3;
}

.excel-goal-grid span,
.excel-program-grid p,
.excel-program-grid small,
.excel-type-board small,
.excel-colour-roles span,
.excel-check-grid small,
.excel-formula-checks span,
.excel-case-tasks span,
.excel-summary-pillars span {
  display: block;
  margin-top: 6px;
  color: var(--xl1-muted);
  font-size: clamp(10px, .85vw, 13px);
  line-height: 1.45;
}

.excel-slide-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--excel-green);
  font-weight: 800;
  text-decoration: none;
}

.excel-slide-link:hover {
  background: var(--excel-green-deep);
}

.excel-program-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.excel-program-grid article {
  min-height: 240px;
}

.excel-program-grid article.is-excel {
  border-color: rgba(118, 226, 170, .48);
  background: linear-gradient(145deg, rgba(16, 124, 65, .3), var(--xl1-panel));
}

.excel-program-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #315f9b;
  font: 800 22px/1 Manrope, sans-serif;
}

.excel-program-grid .is-excel .excel-program-icon {
  background: var(--excel-green);
}

.excel-program-grid article:last-child .excel-program-icon {
  background: #b7472a;
}

.excel-program-grid p {
  min-height: 64px;
}

.excel-program-grid small {
  padding-top: 10px;
  border-top: 1px solid var(--xl1-line);
}

.excel-use-board,
.excel-grid-demo,
.excel-split-demo,
.excel-status-flow,
.excel-formula-entry,
.excel-line-total,
.excel-fill-table,
.excel-summary-question,
.excel-outlier-board {
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid var(--xl1-line);
  border-radius: 22px;
  background: var(--xl1-panel);
}

.excel-use-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.excel-use-tags span,
.excel-challenge-chips span {
  padding: 9px 12px;
  border: 1px solid var(--xl1-line);
  border-radius: 999px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  font-size: clamp(10px, .9vw, 14px);
  font-weight: 700;
}

.excel-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 26px;
}

.excel-action-row b {
  padding: 12px 10px;
  border-radius: 12px;
  color: #052718;
  background: var(--xl1-accent);
  font-size: clamp(10px, .9vw, 14px);
  text-align: center;
}

.excel-action-row i {
  color: var(--xl1-accent);
  font-style: normal;
}

.excel-use-board > p,
.excel-formula-entry > p,
.excel-colour-roles > p {
  margin: 18px 0 0;
  color: var(--xl1-muted);
  font-size: clamp(10px, .9vw, 14px);
  line-height: 1.5;
}

.excel-annotation-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: #0d2a3c;
}

.excel-annotation-strip.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.excel-annotation-strip.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.excel-annotation-strip span {
  padding: 10px 8px;
  color: #fff;
  background: rgba(255, 255, 255, .04);
  text-align: center;
}

.excel-annotation-strip b,
.excel-annotation-strip small {
  display: block;
}

.excel-annotation-strip b {
  color: #76e2aa;
  font-size: clamp(9px, .78vw, 12px);
}

.excel-annotation-strip small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .68);
  font-size: clamp(7px, .65vw, 10px);
  line-height: 1.25;
}

.excel-sort-filter,
.excel-before-after-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #0d2a3c;
}

.excel-sort-filter span,
.excel-before-after-bar span {
  padding: 11px 13px;
  color: #fff;
  background: rgba(255, 255, 255, .045);
}

.excel-sort-filter b,
.excel-sort-filter small {
  display: block;
}

.excel-sort-filter b {
  color: #76e2aa;
}

.excel-sort-filter small {
  margin-top: 3px;
  color: rgba(255,255,255,.7);
  font-size: 10px;
}

.excel-before-after-bar {
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.excel-before-after-bar i {
  color: #76e2aa;
  font-style: normal;
}

.excel-tab-triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.excel-tab-triptych figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--xl1-line);
  border-radius: 16px;
  background: #fff;
}

.excel-tab-focus {
  height: clamp(150px, 25vh, 250px);
}

.excel-tab-focus > img {
  --focus-width: 285%;
  --focus-top: -12%;
}

.focus-tab-page > img { --focus-left: -5%; }
.focus-tab-review > img { --focus-left: -28%; }
.focus-tab-view > img { --focus-left: -48%; }

.excel-tab-triptych img {
  aspect-ratio: 4 / 3;
  object-fit: cover !important;
  object-position: left top;
}

.excel-tab-triptych figcaption {
  padding: 10px;
  color: #fff;
  background: #0d2a3c;
}

.excel-tab-triptych b,
.excel-tab-triptych span {
  display: block;
}

.excel-tab-triptych b {
  color: #76e2aa;
  font-size: 11px;
}

.excel-tab-triptych span {
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 9px;
  line-height: 1.3;
}

.excel-grid-demo {
  display: grid;
  grid-template-columns: 42px repeat(4, minmax(48px, 1fr));
  padding: 12px;
  background: #edf4f0;
}

.excel-grid-demo > b,
.excel-grid-demo > i,
.excel-grid-demo > .corner {
  display: grid;
  min-height: 52px;
  place-items: center;
  border-right: 1px solid #b8c9bf;
  border-bottom: 1px solid #b8c9bf;
  color: #294a3c;
  background: #fff;
  font-style: normal;
}

.excel-grid-demo > b,
.excel-grid-demo > .corner {
  min-height: 34px;
  background: #dbe8e1;
  font: 800 12px/1 Manrope, sans-serif;
}

.excel-grid-demo .is-column { background: #dff4e7; }
.excel-grid-demo .is-row { background: #fff1ca; }
.excel-grid-demo .is-cell { color: #fff; background: var(--excel-green); font-weight: 800; }

.excel-grid-key {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 9px;
  padding-top: 12px;
}

.excel-grid-key span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #183d2d;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.excel-split-demo {
  display: grid;
  grid-template-columns: minmax(0, .9fr) auto minmax(0, 1.1fr);
  align-items: center;
  gap: 12px;
}

.excel-split-demo > i,
.excel-status-flow > i {
  color: var(--xl1-accent);
  font: 800 26px/1 Manrope, sans-serif;
  font-style: normal;
}

.excel-split-demo article,
.excel-code-demo article,
.excel-number-format article,
.excel-wrap-compare article {
  padding: 16px;
  border: 1px solid var(--xl1-line);
  border-radius: 16px;
  background: var(--xl1-panel-strong);
}

.excel-split-demo article > span,
.excel-code-demo article > span,
.excel-number-format article > span,
.excel-wrap-compare article > span {
  color: var(--xl1-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.excel-split-demo article > strong {
  display: block;
  margin-top: 15px;
  color: var(--xl1-ink);
  font-size: clamp(16px, 1.5vw, 24px);
  line-height: 1.4;
}

.excel-split-demo article > div {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(16,124,65,.16);
}

.excel-split-demo article > div b {
  color: var(--xl1-accent);
  font-size: 9px;
}

.excel-split-demo article > div strong {
  color: var(--xl1-ink);
  font-size: 13px;
}

.excel-split-demo small,
.excel-code-demo small,
.excel-wrap-compare small {
  display: block;
  margin-top: 12px;
  color: var(--xl1-muted);
  font-size: 10px;
  line-height: 1.35;
}

.excel-split-demo .is-problem small,
.excel-code-demo .is-problem small,
.excel-wrap-compare .is-problem small {
  color: var(--xl1-problem);
}

.excel-split-demo .is-solution small,
.excel-code-demo .is-solution small,
.excel-wrap-compare .is-solution small {
  color: var(--xl1-accent);
}

.excel-type-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.excel-type-board article > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #052718;
  background: var(--xl1-accent);
  font: 800 17px/1 Manrope, sans-serif;
}

.excel-type-board b {
  display: block;
  margin-top: 15px;
  color: var(--xl1-ink);
  font-size: clamp(17px, 1.5vw, 23px);
}

.excel-code-demo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.excel-code-demo article {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.excel-code-demo article > span,
.excel-code-demo small {
  grid-column: 1 / -1;
}

.excel-code-demo strong,
.excel-code-demo b {
  color: var(--xl1-ink);
  font: 800 clamp(28px, 3.4vw, 50px)/1 Manrope, sans-serif;
  text-align: center;
}

.excel-code-demo i {
  color: var(--xl1-accent);
  font-style: normal;
  font-size: 24px;
}

.excel-record-table,
.excel-line-total {
  overflow: visible;
  border: 1px solid var(--xl1-line);
  border-radius: 18px;
  background: var(--xl1-panel);
}

.excel-record-row {
  position: relative;
  display: grid;
  grid-template-columns: .75fr 1.5fr .65fr .9fr;
}

.excel-record-row > :where(b,span) {
  min-width: 0;
  padding: 11px 10px;
  border-right: 1px solid var(--xl1-line);
  border-bottom: 1px solid var(--xl1-line);
  color: var(--xl1-ink);
  font-size: clamp(9px, .82vw, 13px);
}

.excel-record-row.is-header > b {
  color: #fff;
  background: #164531;
}

.excel-record-row.is-focus {
  z-index: 1;
  outline: 3px solid var(--xl1-accent);
  outline-offset: -2px;
  background: rgba(16, 124, 65, .24);
}

.excel-record-row.is-focus > i {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 5px);
  padding: 5px 8px;
  border-radius: 7px;
  color: #052718;
  background: var(--xl1-accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.excel-status-flow {
  display: grid;
  grid-template-columns: minmax(0, .9fr) auto minmax(0, 1.1fr);
  align-items: center;
  gap: 14px;
}

.excel-status-many {
  display: grid;
  gap: 8px;
}

.excel-status-many span {
  padding: 10px 13px;
  border: 1px solid var(--xl1-line);
  border-radius: 10px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  text-align: center;
}

.excel-status-one {
  padding: 24px;
  border: 1px solid rgba(118,226,170,.4);
  border-radius: 18px;
  background: rgba(16,124,65,.22);
  text-align: center;
}

.excel-status-one small,
.excel-status-one strong,
.excel-status-one p {
  display: block;
}

.excel-status-one small { color: var(--xl1-muted); }
.excel-status-one strong { margin-top: 15px; color: var(--xl1-ink); font-size: clamp(24px, 2.7vw, 42px); }
.excel-status-one p { margin: 13px 0 0; color: var(--xl1-muted); font-size: 11px; line-height: 1.4; }

.excel-challenge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.excel-story-page .excel-tall-sheet > img {
  height: 52vh;
  max-height: 52vh;
  aspect-ratio: 16 / 9;
  object-fit: cover !important;
  object-position: top;
}

.excel-number-format {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.excel-number-format article {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr;
  align-items: center;
  gap: 8px;
}

.excel-number-format article > span,
.excel-number-format article > small {
  grid-column: 1 / -1;
}

.excel-number-format strong,
.excel-number-format b {
  color: var(--xl1-ink);
  font: 800 clamp(18px, 2vw, 30px)/1.1 Manrope, sans-serif;
  text-align: center;
}

.excel-number-format article > i {
  color: var(--xl1-accent);
  font-style: normal;
}

.excel-number-format article > small {
  margin-top: 5px;
  color: var(--xl1-muted);
  font-size: 10px;
  text-align: center;
}

.excel-format-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--xl1-ink);
  background: rgba(16,124,65,.18);
  font-size: 11px;
}

.excel-format-note b {
  color: var(--xl1-accent);
  font-family: Consolas, monospace;
}

.excel-wrap-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.excel-wrap-row {
  display: grid;
  grid-template-columns: .75fr 1.5fr .55fr;
  margin-top: 14px;
  border: 1px solid var(--xl1-line);
}

.excel-wrap-row > * {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--xl1-line);
  color: var(--xl1-ink);
  font-size: 10px;
  font-style: normal;
}

.excel-wrap-compare .is-problem .excel-wrap-row strong {
  overflow: hidden;
  white-space: nowrap;
}

.excel-wrap-compare .is-solution .excel-wrap-row strong {
  white-space: normal;
  line-height: 1.35;
}

.excel-colour-roles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.excel-colour-roles article {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 12px;
}

.excel-colour-roles article > b {
  grid-row: 1 / 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #102119;
  background: #cfe0ff;
}

.excel-colour-roles .role-formula > b { background: #b8e6c8; }
.excel-colour-roles .role-note > b { background: #ffe19c; }
.excel-colour-roles .role-error > b { background: #ffbeb6; }
.excel-colour-roles strong { margin-top: 0; }
.excel-colour-roles span { margin-top: 0; }
.excel-colour-roles > p { grid-column: 1 / -1; }

.excel-check-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.excel-check-grid > span {
  color: var(--xl1-accent);
  font-weight: 800;
}

.excel-check-grid b,
.excel-check-grid small {
  margin-left: 2px;
}

.excel-formula-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.2fr;
  align-items: center;
  gap: 10px;
}

.excel-formula-map article {
  display: grid;
  min-height: 160px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--xl1-line);
  border-radius: 17px;
  background: var(--xl1-panel);
  text-align: center;
}

.excel-formula-map article.is-result {
  border-color: rgba(118,226,170,.48);
  background: rgba(16,124,65,.24);
}

.excel-formula-map article > span,
.excel-formula-map article > small,
.excel-formula-map article > strong,
.excel-formula-map article > code {
  display: block;
}

.excel-formula-map article > span { color: var(--xl1-accent); font-weight: 800; }
.excel-formula-map article > small { margin-top: 6px; color: var(--xl1-muted); }
.excel-formula-map article > strong { margin-top: 12px; color: var(--xl1-ink); font-size: clamp(28px,3vw,46px); }
.excel-formula-map article > code { margin-top: 9px; color: var(--xl1-accent); font-weight: 800; }
.excel-formula-map > b,
.excel-formula-map > i { color: var(--xl1-accent); font: 800 25px/1 Manrope,sans-serif; font-style: normal; }

.excel-formula-bar {
  display: grid;
  grid-template-columns: 42px 1fr;
  border: 1px solid #9eb4a9;
  border-radius: 10px;
  background: #fff;
}

.excel-formula-bar b,
.excel-formula-bar code {
  padding: 11px 13px;
  color: #17382a;
}

.excel-formula-bar b { border-right: 1px solid #9eb4a9; font-style: italic; }
.excel-formula-bar code { font-size: clamp(17px,2vw,28px); font-weight: 800; }
.excel-formula-bar mark { padding: 2px 4px; color: inherit; background: #d7f0e1; }
.excel-formula-bar mark + mark { background: #fff0bd; }

.excel-formula-cells {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.excel-formula-cells span {
  display: grid;
  min-height: 98px;
  place-items: center;
  padding: 11px;
  border: 3px solid #4ca777;
  border-radius: 12px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
}

.excel-formula-cells .ref-c { border-color: #d9ae39; }
.excel-formula-cells .ref-result { border-color: var(--xl1-accent); background: rgba(16,124,65,.24); }
.excel-formula-cells small,
.excel-formula-cells strong { display: block; }
.excel-formula-cells small { color: var(--xl1-muted); }
.excel-formula-cells strong { font-size: clamp(22px,2.5vw,38px); }
.excel-formula-cells > b,
.excel-formula-cells > i { color: var(--xl1-accent); font-size: 24px; font-style: normal; }

.excel-line-total {
  padding: 14px;
}

.excel-line-total .excel-record-row {
  grid-template-columns: 1.4fr .65fr .8fr .8fr;
}

.excel-line-total .is-input { color: #1f63d6; background: #e8f0ff; font-weight: 800; }
.excel-line-total .is-output { color: #08753c; background: #e1f4e8; font-weight: 800; }

.excel-input-output {
  display: grid;
  grid-template-columns: auto 1fr auto 1.3fr;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  color: var(--xl1-muted);
  font-size: 11px;
}

.excel-input-output b,
.excel-input-output span:last-child {
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  text-align: center;
}

.excel-input-output i { color: var(--xl1-accent); font-style: normal; }

.excel-fill-table {
  display: grid;
  gap: 9px;
}

.excel-fill-row {
  display: grid;
  grid-template-columns: .8fr .8fr 1.4fr .7fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--xl1-line);
  border-radius: 10px;
  background: var(--xl1-line);
}

.excel-fill-row > * {
  padding: 10px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  font-size: clamp(9px,.8vw,12px);
}

.excel-fill-row code { color: var(--xl1-accent); font-weight: 800; }
.excel-fill-row strong { color: var(--xl1-accent); text-align: right; }
.excel-fill-table > i { color: var(--xl1-accent); font-size: 12px; font-style: normal; text-align: center; }
.excel-fill-table > small { color: var(--xl1-muted); font-size: 10px; text-align: center; }

.excel-summary-question {
  display: grid;
  grid-template-columns: .65fr 1.35fr;
  gap: 14px;
}

.excel-values {
  display: grid;
  gap: 7px;
}

.excel-values span {
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--xl1-line);
  border-radius: 9px;
  color: var(--xl1-muted);
  background: var(--xl1-panel-strong);
  font-size: 10px;
}

.excel-values b { color: var(--xl1-ink); }

.excel-answer-cards {
  display: grid;
  gap: 10px;
}

.excel-answer-cards article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 14px;
  border: 1px solid var(--xl1-line);
  border-radius: 13px;
  background: rgba(16,124,65,.18);
}

.excel-answer-cards small,
.excel-answer-cards code { grid-column: 1; }
.excel-answer-cards small { color: var(--xl1-muted); }
.excel-answer-cards code { color: var(--xl1-accent); font-size: 11px; font-weight: 800; }
.excel-answer-cards strong { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--xl1-ink); font-size: clamp(24px,2.7vw,40px); }

.excel-outlier-values {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 7px;
}

.excel-outlier-values span {
  position: relative;
  padding: 12px 5px;
  border: 1px solid var(--xl1-line);
  border-radius: 10px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  font-size: clamp(10px,.95vw,14px);
  text-align: center;
}

.excel-outlier-values .is-outlier {
  border-color: var(--xl1-warn);
  color: var(--xl1-warn);
}

.excel-outlier-values .is-outlier b {
  position: absolute;
  right: -6px;
  top: -8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #3a2700;
  background: #ffd37a;
}

.excel-outlier-result {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
  margin-top: 16px;
}

.excel-outlier-result article {
  padding: 14px;
  border: 1px solid var(--xl1-line);
  border-radius: 13px;
  background: var(--xl1-panel-strong);
}

.excel-outlier-result small,
.excel-outlier-result strong,
.excel-outlier-result span { display: block; }
.excel-outlier-result small { color: var(--xl1-accent); font-weight: 800; }
.excel-outlier-result strong { margin-top: 5px; color: var(--xl1-ink); font-size: clamp(20px,2.2vw,34px); }
.excel-outlier-result span { margin-top: 6px; color: var(--xl1-muted); font-size: 10px; line-height: 1.4; }

.excel-formula-checks,
.excel-case-tasks,
.excel-summary-pillars {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.excel-formula-checks article,
.excel-case-tasks article,
.excel-summary-pillars article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
}

.excel-formula-checks b,
.excel-case-tasks b,
.excel-summary-pillars b {
  grid-row: 1 / 3;
}

.excel-formula-checks strong,
.excel-case-tasks strong,
.excel-summary-pillars strong {
  margin-top: 0;
}

.excel-formula-checks span,
.excel-case-tasks span,
.excel-summary-pillars span {
  margin-top: 2px;
}

.excel-dashboard-shot > img {
  aspect-ratio: 16 / 7.1;
  object-fit: cover !important;
  object-position: top center;
}

/* Diagram-led additions: use the same formula-and-cells visual language as slide 28. */
.excel-operation-board,
.excel-table-structure,
.excel-sort-filter-board,
.excel-data-actions,
.excel-precedence-board,
.excel-count-board {
  padding: clamp(16px, 2vw, 26px);
  border: 1px solid var(--xl1-line);
  border-radius: 22px;
  background: var(--xl1-panel);
}

.excel-operation-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.excel-operation-board article,
.excel-precedence-board article,
.excel-data-actions article,
.excel-sort-filter-actions article,
.excel-table-structure article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--xl1-line);
  border-radius: 16px;
  background: var(--xl1-panel-strong);
}

.excel-operation-board small,
.excel-table-structure small,
.excel-sort-filter-board small,
.excel-data-actions small,
.excel-precedence-board small,
.excel-count-results small {
  color: var(--xl1-accent);
  font: 800 9px/1.2 "Manrope","Noto Sans Thai",sans-serif;
  letter-spacing: .08em;
}

.excel-operation-board article > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.excel-operation-board code,
.excel-operation-board strong {
  color: var(--xl1-ink);
  font: 800 clamp(22px, 2.6vw, 38px)/1 "Manrope",monospace;
  text-align: center;
}

.excel-operation-board i,
.excel-operation-activity i { color: var(--xl1-accent); font-style: normal; }
.excel-operation-board article > span { display: block; margin-top: 12px; color: var(--xl1-muted); font-size: 11px; text-align: center; }
.excel-operation-activity { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 13px; background: rgba(16,124,65,.2); }
.excel-operation-activity code,
.excel-operation-activity strong { color: var(--xl1-ink); font-size: clamp(13px,1.2vw,18px); }

.excel-table-structure {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1.15fr);
  align-items: center;
  gap: 12px;
}

.excel-table-structure > i { color: var(--xl1-accent); font: 800 26px/1 "Manrope",sans-serif; font-style: normal; }
.excel-table-structure article > b { display: block; margin-top: 12px; color: var(--xl1-muted); font-size: 10px; line-height: 1.35; }
.excel-table-structure .is-problem > b { color: var(--xl1-problem); }
.excel-table-structure .is-solution > b { color: var(--xl1-accent); }
.excel-sheet-pile { position: relative; height: 128px; margin-top: 14px; }
.excel-sheet-pile span { position: absolute; left: 50%; width: 76%; padding: 11px; border: 1px solid var(--xl1-line); border-radius: 9px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 10px; font-weight: 800; text-align: center; transform: translateX(-50%); }
.excel-sheet-pile span:nth-child(1) { top: 0; transform: translateX(-58%) rotate(-4deg); }
.excel-sheet-pile span:nth-child(2) { top: 38px; transform: translateX(-42%) rotate(3deg); }
.excel-sheet-pile span:nth-child(3) { top: 76px; }
.excel-mini-table { display: grid; grid-template-columns: .7fr 1.3fr; gap: 1px; margin-top: 14px; overflow: hidden; border: 1px solid var(--xl1-line); border-radius: 10px; background: var(--xl1-line); }
.excel-mini-table span { padding: 8px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 9px; }
.excel-mini-table .is-header { color: #052718; background: var(--xl1-accent); font-weight: 800; }

.excel-sort-filter-board { display: grid; gap: 12px; }
.excel-sort-filter-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.excel-sort-filter-actions strong,
.excel-sort-filter-actions span { display: block; }
.excel-sort-filter-actions strong { margin-top: 12px; color: var(--xl1-ink); font-size: clamp(18px,1.8vw,28px); }
.excel-sort-filter-actions span { margin-top: 6px; color: var(--xl1-muted); font-size: 10px; }
.excel-filter-activity { padding: 14px; border: 1px solid rgba(118,226,170,.34); border-radius: 14px; background: rgba(16,124,65,.18); }
.excel-filter-activity > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; }
.excel-filter-activity span,
.excel-filter-activity strong { padding: 7px 9px; border-radius: 8px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 9px; }
.excel-filter-activity strong { color: #052718; background: var(--xl1-accent); }
.excel-filter-activity i { color: var(--xl1-accent); font-style: normal; }

.excel-data-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.excel-data-actions article > b { display: block; margin-top: 12px; color: var(--xl1-muted); font-size: 10px; line-height: 1.35; }
.excel-data-actions > p { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border-left: 3px solid var(--xl1-warn); border-radius: 0 10px 10px 0; color: var(--xl1-muted); background: rgba(255,211,122,.08); font-size: 10px; line-height: 1.45; }
.excel-normalization-rules { display: grid; gap: 5px; margin-top: 15px; }
.excel-normalization-rules span { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--xl1-line); border-radius: 8px; color: var(--xl1-ink); background: var(--xl1-panel-strong); }
.excel-normalization-rules b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: #052718; background: var(--xl1-accent); font-size: 8px; }
.excel-normalization-rules i { color: inherit; font-size: 8px; font-style: normal; font-weight: 750; }
.excel-dropdown-demo { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1px; margin-top: 15px; overflow: hidden; border: 1px solid var(--xl1-line); border-radius: 10px; background: var(--xl1-line); }
.excel-dropdown-demo > * { padding: 12px 9px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 11px; }
.excel-dropdown-demo strong { color: #052718; background: var(--xl1-accent); }
.excel-duplicate-demo { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: center; gap: 5px; margin-top: 15px; }
.excel-duplicate-demo > * { padding: 10px 6px; border-radius: 8px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 9px; text-align: center; }
.excel-duplicate-demo .is-duplicate { color: var(--xl1-problem); text-decoration: line-through; }
.excel-duplicate-demo i { color: var(--xl1-accent); background: transparent; font-style: normal; }
.excel-duplicate-demo strong { color: #052718; background: var(--xl1-accent); }

.excel-precedence-board { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.excel-precedence-board .excel-formula-bar { margin-top: 13px; }
.excel-precedence-board .excel-formula-bar code { font-size: clamp(13px,1.4vw,20px); }
.excel-precedence-board article > p { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--xl1-muted); font-size: 10px; }
.excel-precedence-board article > p i { color: var(--xl1-accent); font-style: normal; }
.excel-precedence-board article > p strong { color: var(--xl1-ink); font-size: clamp(20px,2vw,30px); text-align: right; }

.excel-count-board { display: grid; grid-template-columns: .7fr 1.3fr; gap: 12px; }
.excel-count-values { display: grid; gap: 6px; }
.excel-count-values span { display: flex; justify-content: space-between; gap: 9px; padding: 9px 11px; border: 1px solid var(--xl1-line); border-radius: 9px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 9px; }
.excel-count-values b { color: var(--xl1-muted); font-size: 8px; }
.excel-count-values .is-blank { color: var(--xl1-muted); border-style: dashed; }
.excel-count-results { display: grid; gap: 7px; }
.excel-count-results article { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--xl1-line); border-radius: 11px; background: rgba(16,124,65,.17); }
.excel-count-results small,
.excel-count-results code { grid-column: 1; }
.excel-count-results code { color: var(--xl1-accent); font-size: 9px; font-weight: 800; }
.excel-count-results strong { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--xl1-ink); font-size: clamp(22px,2.4vw,36px); }

.excel-type-game {
  display: grid;
  grid-template-columns: minmax(220px,.9fr) minmax(300px,1.1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--xl1-line);
  border-radius: 22px;
  background: var(--xl1-panel);
}

.excel-type-game-items {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.excel-type-game-items button {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--xl1-line);
  border-radius: 9px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  font: 700 9px/1.2 "Manrope","Noto Sans Thai",sans-serif;
  text-align: left;
  cursor: pointer;
}

.excel-type-game-items button > b {
  color: var(--xl1-muted);
  font-size: 8px;
}

.excel-type-game-items button > i {
  min-width: 50px;
  padding: 3px 5px;
  border-radius: 999px;
  color: var(--xl1-muted);
  background: rgba(128,145,163,.16);
  font-size: 6.5px;
  font-style: normal;
  text-align: center;
}

.excel-type-game-items button.is-selected {
  border-color: var(--xl1-accent);
  box-shadow: 0 0 0 2px rgba(118,226,170,.18);
}

.excel-type-game-items button.is-assigned > i { color: #052718; background: var(--xl1-accent); }
.excel-type-game-items button.is-correct { border-color: var(--xl1-accent); background: rgba(16,124,65,.2); }
.excel-type-game-items button.is-wrong { border-color: #ff8f8f; background: rgba(185,28,28,.14); }

.excel-type-game-table {
  display: grid;
  grid-template-rows: auto repeat(3,minmax(0,1fr)) auto auto;
  gap: 6px;
  min-width: 0;
}

.excel-type-game-table > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  color: var(--xl1-ink);
}

.excel-type-game-table > header strong { font-size: 12px; }
.excel-type-game-table > header span { color: var(--xl1-muted); font-size: 7px; }

.excel-type-game-bucket {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--xl1-line);
  border-radius: 11px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  cursor: pointer;
}

.excel-type-game-bucket > strong {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #052718;
  background: var(--xl1-accent);
  font: 800 9px/1 "Manrope",sans-serif;
}

.excel-type-game-slot {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 7px;
}

.excel-type-game-slot b {
  min-width: 22px;
  padding: 4px;
  border-radius: 6px;
  color: var(--xl1-ink);
  background: rgba(128,145,163,.18);
  font-size: 7px;
  text-align: center;
}

.excel-type-game-slot span { color: var(--xl1-muted); font-size: 7px; }
.excel-type-game-controls { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.excel-type-game-controls button { min-height: 30px; padding: 6px 10px; border: 1px solid var(--xl1-line); border-radius: 9px; color: var(--xl1-ink); background: var(--xl1-panel-strong); font-size: 8px; font-weight: 800; cursor: pointer; }
.excel-type-game-controls [data-type-game-check] { color: #052718; border-color: var(--xl1-accent); background: var(--xl1-accent); }
.excel-type-game-status { min-height: 18px; margin: 0; color: var(--xl1-muted); font-size: 8px; line-height: 1.35; }

html[data-theme="light"] .excel-story-page :where(.excel-slide-route span,.excel-program-grid article.is-excel,.excel-status-one,.excel-formula-map article.is-result,.excel-formula-cells .ref-result,.excel-answer-cards article) {
  background-color: rgba(16,124,65,.12);
}

@media (max-width: 980px) {
  .excel-story-page .excel-teaching-slide,
  .excel-story-page .presentation-brand-slide {
    grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
    padding: 44px;
  }

  .excel-program-grid article { min-height: 210px; }
  .excel-program-grid p { min-height: 58px; }
}

@media (max-width: 760px) {
  .excel-story-page .presentation-stage {
    overflow: auto;
  }

  .excel-story-page .excel-teaching-slide,
  .excel-story-page .presentation-brand-slide {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 16px;
    padding: 24px 18px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .excel-story-page .excel-teaching-slide h2,
  .excel-story-page .presentation-brand-cover h2 {
    font-size: clamp(28px, 8.4vw, 40px);
  }

  .excel-story-page .excel-teaching-slide .slide-lead {
    margin-top: 11px;
    font-size: 14px;
    line-height: 1.48;
  }

  .excel-story-page .presentation-visual,
  .excel-story-page .presentation-brand-slide .presentation-visual {
    display: block;
  }

  .excel-story-page :is(.excel-goal-grid,.excel-program-grid,.excel-tab-triptych,.excel-grid-demo,.excel-split-demo,.excel-type-board,.excel-code-demo,.excel-status-flow,.excel-number-format,.excel-wrap-compare,.excel-colour-roles,.excel-check-grid,.excel-formula-map,.excel-fill-table,.excel-summary-question,.excel-formula-checks,.excel-case-tasks,.excel-summary-pillars,.excel-operation-board,.excel-table-structure,.excel-sort-filter-board,.excel-data-actions,.excel-precedence-board,.excel-count-board,.excel-type-game) {
    display: grid;
  }

  .excel-story-page .presentation-brand-cover {
    width: 100%;
    justify-items: start;
    text-align: left;
  }

  .excel-story-page .presentation-brand-cover > img {
    width: min(260px, 70vw);
    max-height: 68px;
    margin-bottom: 13px;
    object-position: left;
  }

  .excel-shot-panel { border-radius: 15px; box-shadow: 0 14px 34px rgba(0,0,0,.2); }
  .excel-shot-panel figcaption { padding: 8px 10px; font-size: 9px; }
  .excel-shot-panel > img { aspect-ratio: 16 / 9; }
  .excel-focus-frame { height: 220px; }
  .excel-tab-focus { height: 105px; }
  .excel-self-check-board,
  .excel-review-board { gap: 7px; }
  .excel-self-check-board article,
  .excel-review-board article { min-height: 0; padding: 10px; border-radius: 12px; }
  .excel-self-check-board b,
  .excel-review-board b { width: 24px; height: 24px; font-size: 9px; }
  .excel-self-check-board strong,
  .excel-review-board strong { font-size: 11px; }
  .excel-self-check-board span,
  .excel-review-board span,
  .excel-self-check-board > p { font-size: 7px; }
  .excel-story-page .excel-tall-sheet > img { height: auto; max-height: none; aspect-ratio: 4 / 3; object-fit: cover !important; object-position: top; }
  .excel-dashboard-shot > img { aspect-ratio: 16 / 9; }
  .excel-annotation-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .excel-annotation-strip.compact { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .excel-annotation-strip span { padding: 7px 5px; }
  .excel-annotation-strip b { font-size: 8px; }
  .excel-annotation-strip small { font-size: 6px; }
  .excel-program-grid,
  .excel-type-board,
  .excel-tab-triptych { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .excel-program-grid article { min-height: 0; padding: 10px; border-radius: 12px; }
  .excel-program-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
  .excel-program-grid strong { margin-top: 8px; font-size: 12px; }
  .excel-program-grid p { min-height: 0; margin: 6px 0 0; font-size: 8px; }
  .excel-program-grid small { margin-top: 8px; padding-top: 7px; font-size: 7px; }
  .excel-tab-triptych img { aspect-ratio: 16 / 10; }
  .excel-tab-triptych figcaption { padding: 6px; }
  .excel-tab-triptych b { font-size: 8px; }
  .excel-tab-triptych span { font-size: 6px; }
  .excel-goal-grid,
  .excel-colour-roles,
  .excel-check-grid,
  .excel-formula-checks,
  .excel-case-tasks,
  .excel-summary-pillars { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .excel-goal-grid article { min-height: 0; }
  .excel-goal-grid article,
  .excel-colour-roles article,
  .excel-check-grid > span,
  .excel-formula-checks article,
  .excel-case-tasks article,
  .excel-summary-pillars article { padding: 10px; border-radius: 12px; }
  .excel-goal-grid b,
  .excel-formula-checks b,
  .excel-case-tasks b,
  .excel-summary-pillars b { width: 24px; height: 24px; font-size: 10px; }
  .excel-goal-grid strong,
  .excel-colour-roles strong,
  .excel-check-grid b,
  .excel-formula-checks strong,
  .excel-case-tasks strong,
  .excel-summary-pillars strong { margin-top: 6px; font-size: 11px; }
  .excel-goal-grid span,
  .excel-colour-roles span,
  .excel-check-grid small,
  .excel-formula-checks span,
  .excel-case-tasks span,
  .excel-summary-pillars span { margin-top: 3px; font-size: 7px; line-height: 1.3; }
  .excel-colour-roles article > b { width: 28px; height: 28px; }
  .excel-use-board,
  .excel-grid-demo,
  .excel-split-demo,
  .excel-status-flow,
  .excel-formula-entry,
  .excel-line-total,
  .excel-fill-table,
  .excel-summary-question,
  .excel-outlier-board { padding: 11px; border-radius: 14px; }
  .excel-use-tags span,
  .excel-challenge-chips span { padding: 6px 8px; font-size: 8px; }
  .excel-action-row { margin-top: 13px; }
  .excel-action-row b { padding: 8px 5px; font-size: 8px; }
  .excel-grid-demo { grid-template-columns: 28px repeat(4,minmax(36px,1fr)); }
  .excel-grid-demo > b,
  .excel-grid-demo > i,
  .excel-grid-demo > .corner { min-height: 34px; }
  .excel-grid-demo > b,
  .excel-grid-demo > .corner { min-height: 25px; }
  .excel-grid-key { flex-wrap: wrap; padding-top: 8px; }
  .excel-grid-key span { padding: 4px 6px; font-size: 7px; }
  .excel-split-demo,
  .excel-status-flow { grid-template-columns: 1fr auto 1.15fr; gap: 6px; }
  .excel-split-demo article,
  .excel-code-demo article,
  .excel-number-format article,
  .excel-wrap-compare article { padding: 9px; border-radius: 11px; }
  .excel-split-demo article > strong { margin-top: 8px; font-size: 11px; }
  .excel-split-demo article > div { margin-top: 5px; padding: 5px 6px; }
  .excel-split-demo article > div b { font-size: 6px; }
  .excel-split-demo article > div strong { font-size: 8px; }
  .excel-split-demo small,
  .excel-code-demo small,
  .excel-wrap-compare small { margin-top: 7px; font-size: 6.5px; }
  .excel-type-board article { padding: 10px; }
  .excel-type-board article > span { width: 27px; height: 27px; border-radius: 7px; font-size: 11px; }
  .excel-type-board strong { margin-top: 7px; font-size: 10px; }
  .excel-type-board b { margin-top: 7px; font-size: 12px; }
  .excel-type-board small { font-size: 7px; }
  .excel-code-demo { gap: 7px; }
  .excel-code-demo strong,
  .excel-code-demo b { font-size: 24px; }
  .excel-record-row > :where(b,span) { padding: 7px 5px; font-size: 7px; }
  .excel-record-row.is-focus > i { right: 6px; font-size: 6px; }
  .excel-status-many { gap: 4px; }
  .excel-status-many span { padding: 6px; font-size: 8px; }
  .excel-status-one { padding: 10px; }
  .excel-status-one small { font-size: 7px; }
  .excel-status-one strong { margin-top: 7px; font-size: 18px; }
  .excel-status-one p { margin-top: 7px; font-size: 6.5px; }
  .excel-number-format,
  .excel-wrap-compare { gap: 7px; }
  .excel-number-format strong,
  .excel-number-format b { font-size: 15px; }
  .excel-format-note { padding: 7px; font-size: 7px; }
  .excel-wrap-row { grid-template-columns: .7fr 1.4fr .55fr; }
  .excel-wrap-row > * { padding: 6px; font-size: 7px; }
  .excel-formula-map { gap: 5px; }
  .excel-formula-map article { min-height: 105px; padding: 8px; border-radius: 11px; }
  .excel-formula-map article > span { font-size: 8px; }
  .excel-formula-map article > small { font-size: 6px; }
  .excel-formula-map article > strong { margin-top: 6px; font-size: 19px; }
  .excel-formula-map article > code { margin-top: 5px; font-size: 7px; }
  .excel-formula-map > b,
  .excel-formula-map > i { font-size: 14px; }
  .excel-formula-bar { grid-template-columns: 30px 1fr; }
  .excel-formula-bar b,
  .excel-formula-bar code { padding: 7px 8px; }
  .excel-formula-bar code { font-size: 14px; }
  .excel-formula-cells { gap: 5px; margin-top: 10px; }
  .excel-formula-cells span { min-height: 62px; padding: 6px; border-width: 2px; }
  .excel-formula-cells small { font-size: 7px; }
  .excel-formula-cells strong { font-size: 18px; }
  .excel-formula-entry > p { margin-top: 9px; font-size: 8px; }
  .excel-input-output { gap: 5px; margin-top: 10px; font-size: 7px; }
  .excel-input-output b,
  .excel-input-output span:last-child { padding: 5px; }
  .excel-fill-table { gap: 5px; }
  .excel-fill-row > * { padding: 6px; font-size: 7px; }
  .excel-summary-question { grid-template-columns: .65fr 1.35fr; gap: 7px; }
  .excel-values { gap: 4px; }
  .excel-values span { padding: 6px; font-size: 7px; }
  .excel-answer-cards { gap: 5px; }
  .excel-answer-cards article { padding: 7px; }
  .excel-answer-cards small,
  .excel-answer-cards code { font-size: 6.5px; }
  .excel-answer-cards strong { font-size: 17px; }
  .excel-outlier-values { gap: 4px; }
  .excel-outlier-values span { padding: 8px 2px; font-size: 8px; }
  .excel-outlier-result { gap: 6px; margin-top: 8px; }
  .excel-outlier-result article { padding: 8px; }
  .excel-outlier-result strong { font-size: 17px; }
  .excel-outlier-result span { font-size: 6.5px; }
  .excel-slide-route { gap: 4px; margin-top: 11px; }
  .excel-slide-route span { padding: 5px 7px; font-size: 7px; }
  .excel-slide-link { margin-top: 11px; padding: 8px 12px; font-size: 11px; }
  .excel-story-page .presentation-toolbar { gap: 6px; padding: 7px 8px; }
  .excel-story-page .presentation-progress { min-width: 38px; gap: 0; }
  .excel-story-page .presentation-progress-track { display: none; }
  .excel-story-page .presentation-controls { gap: 3px; }
  .excel-story-page .presentation-controls button { width: 30px; height: 30px; font-size: 9px; }
  .excel-story-page .presentation-controls .presentation-zoom-control button { width: 25px; height: 25px; }
  .excel-story-page .presentation-controls .presentation-zoom-control [data-presentation-zoom-reset] { width: 37px; font-size: 7px; }
}

@media (orientation: landscape) and (max-height: 650px) {
  .excel-story-page .excel-teaching-slide,
  .excel-story-page .presentation-brand-slide {
    grid-template-columns: minmax(0,.92fr) minmax(340px,1.08fr);
    gap: 22px;
    padding: 22px 38px 16px;
  }

  .excel-story-page .excel-teaching-slide h2 { font-size: clamp(24px,3.15vw,38px); }
  .excel-story-page .excel-teaching-slide .slide-lead { margin-top: 9px; font-size: 12px; line-height: 1.38; }
  .excel-story-page .presentation-brand-cover > img { width: min(290px,30vw); max-height: 68px; margin-bottom: 12px; }
  .excel-shot-panel > img { max-height: 50vh; }
  .excel-story-page .excel-tall-sheet > img { max-height: 47vh; }
  .excel-goal-grid article { min-height: 105px; }
  .excel-self-check-board { gap: 8px; }
  .excel-self-check-board article { min-height: 112px; padding: 12px; }
  .excel-self-check-board > p { padding: 9px 12px; }
  .excel-program-grid article { min-height: 170px; padding: 12px; }
  .excel-program-grid p { min-height: 46px; }
  .excel-use-board,
  .excel-grid-demo,
  .excel-split-demo,
  .excel-status-flow,
  .excel-formula-entry,
  .excel-line-total,
  .excel-fill-table,
  .excel-summary-question,
  .excel-outlier-board { padding: 12px; }
  .excel-formula-map article { min-height: 112px; padding: 10px; }
  .excel-formula-cells span { min-height: 68px; }
  .excel-record-row > :where(b,span) { padding-block: 7px; }
}

@media (max-width: 900px) {
  .excel-course-map,
  .excel-tool-compare,
  .excel-formula-grid,
  .excel-download-grid,
  .excel-ui-gallery {
    grid-template-columns: 1fr;
  }

  .excel-hero-media,
  .excel-hero-media img {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .excel-course-step,
  .excel-tool-card,
  .excel-formula-card,
  .download-card {
    padding: 16px;
    border-radius: 16px;
  }

  .excel-ui-shot .excel-ui-crop {
    aspect-ratio: 16 / 10;
  }

  .excel-slide-formula {
    padding: 14px 16px;
  }
}

@media (orientation: landscape) and (max-height: 430px) and (max-width: 900px) {
  .excel-self-check-board { gap: 6px; }
  .excel-self-check-board article { min-height: 0; padding: 8px; }
  .excel-self-check-board > p { padding: 6px 10px; }

  .excel-story-page .presentation-brand-slide {
    gap: 14px;
    padding: 14px 30px 10px;
    overflow: hidden;
  }

  .excel-story-page .presentation-brand-cover > img {
    max-height: 56px;
    margin-bottom: 8px;
  }

  .excel-story-page .presentation-brand-cover h2 {
    margin-top: 5px;
  }

  .excel-story-page .presentation-brand-cover .slide-lead {
    margin-top: 5px;
  }
}

@media (max-width: 760px) {
  .excel-operation-board,
  .excel-table-structure,
  .excel-sort-filter-board,
  .excel-data-actions,
  .excel-precedence-board,
  .excel-count-board { padding: 10px; gap: 7px; border-radius: 14px; }
  .excel-operation-board article,
  .excel-precedence-board article,
  .excel-data-actions article,
  .excel-sort-filter-actions article,
  .excel-table-structure article { padding: 9px; border-radius: 11px; }
  .excel-operation-board small,
  .excel-table-structure small,
  .excel-sort-filter-board small,
  .excel-data-actions small,
  .excel-precedence-board small,
  .excel-count-results small { font-size: 6.5px; }
  .excel-operation-board article > div { margin-top: 8px; gap: 4px; }
  .excel-operation-board code,
  .excel-operation-board strong { font-size: 17px; }
  .excel-operation-board article > span { margin-top: 7px; font-size: 7px; }
  .excel-operation-activity { gap: 5px; padding: 8px; }
  .excel-operation-activity code,
  .excel-operation-activity strong { font-size: 8px; }
  .excel-table-structure { grid-template-columns: 1fr auto 1.15fr; }
  .excel-table-structure > i { font-size: 15px; }
  .excel-table-structure article > b { margin-top: 7px; font-size: 6.5px; }
  .excel-sheet-pile { height: 88px; margin-top: 8px; }
  .excel-sheet-pile span { padding: 6px; font-size: 6.5px; }
  .excel-sheet-pile span:nth-child(2) { top: 27px; }
  .excel-sheet-pile span:nth-child(3) { top: 54px; }
  .excel-mini-table { margin-top: 8px; }
  .excel-mini-table span { padding: 5px; font-size: 6px; }
  .excel-sort-filter-actions { gap: 6px; }
  .excel-sort-filter-actions strong { margin-top: 7px; font-size: 12px; }
  .excel-sort-filter-actions span { margin-top: 3px; font-size: 6.5px; }
  .excel-filter-activity { padding: 8px; }
  .excel-filter-activity > div { gap: 4px; margin-top: 6px; }
  .excel-filter-activity span,
  .excel-filter-activity strong { padding: 5px 6px; font-size: 6px; }
  .excel-data-actions article > b { margin-top: 7px; font-size: 6.5px; }
  .excel-data-actions > p { padding: 7px 8px; font-size: 6.5px; }
  .excel-dropdown-demo,
  .excel-duplicate-demo { margin-top: 8px; }
  .excel-dropdown-demo > * { padding: 7px 5px; font-size: 7px; }
  .excel-duplicate-demo > * { padding: 6px 3px; font-size: 6px; }
  .excel-precedence-board .excel-formula-bar { margin-top: 8px; }
  .excel-precedence-board .excel-formula-bar code { font-size: 10px; }
  .excel-precedence-board article > p { gap: 4px; margin-top: 8px; font-size: 6.5px; }
  .excel-precedence-board article > p strong { font-size: 15px; }
  .excel-count-board { grid-template-columns: .68fr 1.32fr; }
  .excel-count-values { gap: 4px; }
  .excel-count-values span { padding: 6px; font-size: 6.5px; }
  .excel-count-values b { font-size: 5.5px; }
  .excel-count-results { gap: 4px; }
  .excel-count-results article { padding: 6px 7px; }
  .excel-count-results code { font-size: 6px; }
  .excel-count-results strong { font-size: 17px; }
  .excel-type-game { grid-template-columns: .95fr 1.05fr; padding: 8px; gap: 6px; }
  .excel-type-game-items { gap: 2px; }
  .excel-type-game-items button { min-height: 22px; grid-template-columns: 20px 1fr auto; gap: 4px; padding: 3px 5px; border-radius: 6px; font-size: 6px; }
  .excel-type-game-items button > b { font-size: 5.5px; }
  .excel-type-game-items button > i { min-width: 34px; padding: 2px 3px; font-size: 5px; }
  .excel-type-game-table { gap: 3px; }
  .excel-type-game-table > header strong { font-size: 8px; }
  .excel-type-game-table > header span { font-size: 5px; }
  .excel-type-game-bucket { grid-template-columns: 52px 1fr; border-radius: 7px; }
  .excel-type-game-bucket > strong { padding: 4px; font-size: 6px; }
  .excel-type-game-slot { gap: 2px; padding: 4px; }
  .excel-type-game-slot b { min-width: 16px; padding: 2px; font-size: 5px; }
  .excel-type-game-slot span { font-size: 5px; }
  .excel-type-game-controls { gap: 3px; }
  .excel-type-game-controls button { min-height: 22px; padding: 3px 6px; border-radius: 6px; font-size: 5.5px; }
  .excel-type-game-status { min-height: 11px; font-size: 5.5px; }
}

@media (orientation: landscape) and (max-height: 650px) {
  .excel-operation-board,
  .excel-table-structure,
  .excel-sort-filter-board,
  .excel-data-actions,
  .excel-precedence-board,
  .excel-count-board { padding: 12px; gap: 8px; }
  .excel-operation-board article,
  .excel-precedence-board article,
  .excel-data-actions article,
  .excel-sort-filter-actions article,
  .excel-table-structure article { padding: 10px; }
  .excel-sheet-pile { height: 96px; }
  .excel-sheet-pile span { padding: 7px; }
  .excel-sheet-pile span:nth-child(2) { top: 30px; }
  .excel-sheet-pile span:nth-child(3) { top: 60px; }
}

/* Projector-first readability and deliberate Thai/English wrapping. */
.excel-story-page .excel-teaching-slide h2,
.excel-story-page .presentation-brand-cover h2 {
  max-width: 18ch;
  text-wrap: balance;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.excel-story-page .excel-teaching-slide .slide-lead {
  max-width: 62ch;
  text-wrap: pretty;
  word-break: normal;
  overflow-wrap: normal;
}

.excel-story-page .slide-title-line { display: block; }
.excel-story-page .slide-title-nowrap { white-space: nowrap; }
.excel-story-page .presentation-visual-focus-control[hidden] { display: none !important; }

.excel-course-outline,
.excel-edit-command-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.excel-course-outline article,
.excel-edit-command-board article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--xl1-line);
  border-radius: 16px;
  background: var(--xl1-panel);
}

.excel-course-outline article > b {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #052718;
  background: var(--xl1-accent);
  font: 800 15px/1 Manrope, sans-serif;
}

.excel-course-outline article > strong,
.excel-edit-command-board article > strong {
  color: var(--xl1-ink);
  font-size: clamp(16px, 1.15vw, 21px);
  line-height: 1.25;
}

.excel-course-outline article > span {
  color: var(--xl1-muted);
  font: 800 11px/1 Manrope, sans-serif;
}

.excel-edit-command-board article {
  grid-template-columns: 82px 1fr;
  padding: 14px 16px;
}

.excel-edit-command-board kbd {
  padding: 9px 8px;
  border: 1px solid var(--xl1-line);
  border-bottom-width: 3px;
  border-radius: 8px;
  color: var(--xl1-ink);
  background: var(--xl1-panel-strong);
  font: 800 12px/1 Manrope, sans-serif;
  text-align: center;
}

.excel-story-page .presentation-slide .excel-edit-command-board > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 16px;
  border-radius: 12px;
  color: #052718;
  background: #76e2aa;
  font-size: clamp(13px, .9vw, 16px);
  font-weight: 800;
  text-shadow: none;
}

html[data-theme="light"] .excel-story-page .presentation-slide .excel-edit-command-board > p {
  color: #fff;
  background: #006b35;
}

.excel-type-game,
.excel-type-game-items,
.excel-type-game-table,
.excel-type-game-items button,
.excel-type-game-items button > span,
.excel-type-game-bucket,
.excel-type-game-slot { min-width: 0; }

.excel-type-game-items button > span {
  overflow-wrap: anywhere;
}

.excel-story-page .presentation-shell.visual-focus .presentation-slide.is-active {
  display: block;
  padding: clamp(18px, 2.7vw, 44px) !important;
}

.excel-story-page .presentation-shell.visual-focus .presentation-slide.is-active .presentation-copy,
.excel-story-page .presentation-shell.visual-focus .presentation-slide.is-active .presentation-board {
  display: none !important;
}

.excel-story-page .presentation-shell.visual-focus .presentation-slide.is-active .presentation-visual {
  position: absolute;
  inset: clamp(18px, 2.7vw, 44px);
  z-index: 4;
  display: grid !important;
  width: auto;
  height: auto;
  min-width: 0;
  place-items: center;
  overflow: auto;
}

.excel-story-page .presentation-shell.visual-focus .presentation-slide.is-active .presentation-visual > * {
  width: min(100%, 1500px);
  max-width: 100%;
}

.excel-story-page .presentation-shell.visual-focus .presentation-slide.is-active .presentation-visual img {
  width: 100%;
  max-height: calc(100vh - 150px) !important;
  object-fit: contain !important;
}

@media (min-width: 901px) and (min-height: 651px) {
  .excel-story-page .excel-teaching-slide,
  .excel-story-page .presentation-brand-slide {
    gap: clamp(34px, 4vw, 76px);
    padding: clamp(58px, 6vw, 96px);
  }

  .excel-story-page .presentation-eyebrow {
    font-size: clamp(13px, .9vw, 16px);
    line-height: 1.25;
  }

  .excel-story-page .excel-teaching-slide h2 {
    font-size: clamp(42px, 3.6vw, 64px);
    line-height: 1.08;
  }

  .excel-story-page .excel-teaching-slide .slide-lead {
    margin-top: 20px;
    font-size: clamp(18px, 1.35vw, 24px);
    line-height: 1.52;
  }

  .excel-goal-grid article,
  .excel-summary-pillars article {
    min-height: 178px;
    padding: clamp(18px, 1.7vw, 26px);
  }

  .excel-goal-grid b,
  .excel-summary-pillars b,
  .excel-formula-checks b,
  .excel-case-tasks b {
    width: clamp(50px, 4vw, 66px);
    height: clamp(50px, 4vw, 66px);
    font-size: clamp(21px, 1.55vw, 27px);
  }

  .excel-goal-grid strong,
  .excel-summary-pillars strong,
  .excel-formula-checks strong,
  .excel-case-tasks strong,
  .excel-colour-roles strong,
  .excel-check-grid b {
    font-size: clamp(22px, 1.55vw, 29px);
    line-height: 1.25;
  }

  .excel-goal-grid span,
  .excel-summary-pillars span,
  .excel-formula-checks span,
  .excel-case-tasks span,
  .excel-colour-roles span,
  .excel-check-grid small {
    font-size: clamp(15px, 1.05vw, 19px);
    line-height: 1.45;
  }

  .excel-action-row {
    gap: 12px;
    margin-top: 30px;
  }

  .excel-action-row b {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 7px;
    padding: 16px 12px;
    font-size: clamp(21px, 1.55vw, 28px);
    line-height: 1.1;
  }

  .excel-action-row b > i {
    color: rgba(5, 39, 24, .66);
    font: 800 clamp(13px, .9vw, 16px)/1 Manrope, sans-serif;
    letter-spacing: .08em;
  }

  .excel-action-row b > span { display: block; }
  .excel-action-row > i { font-size: clamp(20px, 1.4vw, 26px); }

  .excel-program-grid strong { font-size: clamp(22px, 1.55vw, 28px); }
  .excel-program-grid p { font-size: clamp(15px, 1.02vw, 18px); line-height: 1.45; }
  .excel-program-grid small { font-size: clamp(13px, .88vw, 16px); }
  .excel-program-icon { width: 58px; height: 58px; font-size: 25px; }

  .excel-review-board b,
  .excel-self-check-board b { width: 48px; height: 48px; font-size: 19px; }
  .excel-review-board strong,
  .excel-self-check-board strong { font-size: clamp(20px, 1.4vw, 26px); }
  .excel-review-board span,
  .excel-self-check-board span,
  .excel-self-check-board > p { font-size: clamp(14px, .95vw, 18px); line-height: 1.45; }

  .excel-annotation-strip b { font-size: clamp(16px, 1.1vw, 20px); }
  .excel-annotation-strip small { font-size: clamp(13px, .85vw, 16px); }
  .excel-tab-triptych b { font-size: clamp(17px, 1.15vw, 21px); }
  .excel-tab-triptych span { font-size: clamp(13px, .9vw, 16px); }

  .excel-normalization-rules b { width: 34px; height: 34px; font-size: 14px; }
  .excel-normalization-rules i { font-size: clamp(13px, .9vw, 16px); }
  .excel-data-actions article > b,
  .excel-data-actions > p { font-size: clamp(13px, .9vw, 16px); }
  .excel-dropdown-demo > * { font-size: clamp(14px, 1vw, 18px); }

  .excel-type-board article > span { width: 54px; height: 54px; font-size: 24px; }
  .excel-type-board strong { font-size: clamp(22px, 1.55vw, 28px); }
  .excel-type-board b { font-size: clamp(24px, 1.75vw, 32px); }
  .excel-type-board small { font-size: clamp(14px, .95vw, 18px); }

  .excel-sort-filter-actions span,
  .excel-operation-board article > span,
  .excel-count-values span,
  .excel-table-structure article > b {
    font-size: clamp(13px, .9vw, 16px);
  }

  .excel-type-game-items button { min-height: 42px; font-size: clamp(11px, .82vw, 14px); }
  .excel-type-game-items button > b { font-size: 11px; }
  .excel-type-game-items button > i { font-size: 10px; }
  .excel-type-game-table > header strong { font-size: clamp(17px, 1.15vw, 21px); }
  .excel-type-game-table > header span,
  .excel-type-game-status,
  .excel-type-game-controls button { font-size: clamp(11px, .78vw, 14px); }
  .excel-type-game-bucket > strong { font-size: clamp(14px, .95vw, 18px); }
  .excel-type-game-slot b,
  .excel-type-game-slot span { font-size: clamp(10px, .7vw, 13px); }
}

/* Only landscape phones are an acceptance target; keep the visual available. */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 950px) {
  .excel-story-page .excel-teaching-slide,
  .excel-story-page .presentation-brand-slide {
    grid-template-columns: minmax(0, .9fr) minmax(300px, 1.1fr);
    align-items: center;
    gap: 16px;
    padding: 12px 24px 10px;
    overflow: auto;
  }

  .excel-story-page .presentation-visual,
  .excel-story-page .presentation-brand-slide .presentation-visual { display: grid; }
  .excel-story-page .excel-teaching-slide h2 { font-size: clamp(25px, 3.65vw, 31px); }
  .excel-story-page .excel-teaching-slide .slide-lead { margin-top: 7px; font-size: 10.5px; line-height: 1.3; }

  .excel-use-board { min-width: 0; padding: 9px; overflow: hidden; }
  .excel-use-tags { gap: 4px; }
  .excel-use-tags span { padding: 4px 6px; font-size: 7px; }
  .excel-action-row { gap: 3px; margin-top: 8px; }
  .excel-action-row b { display: grid; min-width: 0; flex: 1; gap: 2px; padding: 5px 3px; font-size: 8px; }
  .excel-action-row b > i { font-size: 6px; }
  .excel-action-row > i { flex: 0 0 auto; font-size: 9px; }
  .excel-use-board > p { margin-top: 7px; font-size: 6.5px; line-height: 1.3; }

  .excel-type-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .excel-type-board article { min-width: 0; padding: 8px; }
  .excel-type-board article > span { width: 25px; height: 25px; font-size: 10px; }
  .excel-type-board strong { margin-top: 5px; font-size: 9px; }
  .excel-type-board b { margin-top: 5px; font-size: 11px; }
  .excel-type-board small { font-size: 6px; line-height: 1.25; }

  .excel-sort-filter-board { padding: 8px; gap: 5px; }
  .excel-sort-filter-actions { gap: 5px; }
  .excel-sort-filter-actions article { padding: 7px; }
  .excel-filter-activity { padding: 6px; }

  .excel-type-game { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); padding: 6px; gap: 5px; }
  .excel-type-game-items { gap: 2px; }
  .excel-type-game-items button { min-height: 18px; grid-template-columns: 17px minmax(0, 1fr) 31px; gap: 3px; padding: 2px 4px; border-radius: 5px; font-size: 5.5px; }
  .excel-type-game-items button > b { font-size: 5px; }
  .excel-type-game-items button > i { min-width: 0; padding: 1px 2px; font-size: 4.5px; }
  .excel-type-game-table { gap: 2px; }
  .excel-type-game-table > header { padding-bottom: 3px; }
  .excel-type-game-table > header strong { font-size: 7px; }
  .excel-type-game-table > header span { font-size: 4.5px; }
  .excel-type-game-bucket { grid-template-columns: 42px minmax(0, 1fr); border-radius: 5px; }
  .excel-type-game-bucket > strong { padding: 3px; font-size: 5px; }
  .excel-type-game-slot { gap: 1px; padding: 3px; }
  .excel-type-game-slot b { min-width: 13px; padding: 1px; font-size: 4.5px; }
  .excel-type-game-slot span { font-size: 4.5px; }
  .excel-type-game-controls { gap: 2px; }
  .excel-type-game-controls button { min-height: 18px; padding: 2px 4px; border-radius: 5px; font-size: 5px; }
  .excel-type-game-status { min-height: 8px; font-size: 4.5px; }

  .excel-course-outline,
  .excel-edit-command-board { gap: 5px; }
  .excel-course-outline article,
  .excel-edit-command-board article { gap: 6px; padding: 7px; border-radius: 8px; }
  .excel-course-outline article > b { width: 24px; height: 24px; font-size: 8px; }
  .excel-course-outline article > strong,
  .excel-edit-command-board article > strong { font-size: 8px; }
  .excel-course-outline article > span { font-size: 6px; }
  .excel-edit-command-board article { grid-template-columns: 46px 1fr; }
  .excel-edit-command-board kbd { padding: 5px 3px; border-radius: 5px; font-size: 6px; }
  .excel-edit-command-board > p { padding: 7px; font-size: 6.5px; }
}

/* Three clearly separated delivery paths: web slides, learner files and print handout. */
.excel-resource-actions {
  flex-wrap: wrap;
  align-items: stretch;
}

.excel-resource-actions .story-action { min-height: 52px; }

.excel-download-button-pair {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 10px;
}

.excel-download-button-pair .story-action {
  flex: 1 1 220px;
}

.excel-resource-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.excel-resource-choice {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 300px;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(24px, 3vw, 36px);
  overflow: hidden;
  border: 1px solid rgba(31, 74, 109, .16);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(241, 247, 251, .92));
  box-shadow: 0 20px 54px rgba(10, 43, 66, .09);
}

.excel-resource-choice::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  content: "";
  background: #1f9d64;
}

.excel-resource-choice.is-instructor::before { background: #2879c8; }

.excel-resource-choice > span {
  color: #1f7a52;
  font: 800 12px/1.2 Manrope, sans-serif;
  letter-spacing: .13em;
}

.excel-resource-choice.is-instructor > span { color: #2879c8; }

.excel-resource-choice h3 {
  margin: 14px 0 10px;
  color: #0c2739;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
}

.excel-resource-choice p {
  max-width: 58ch;
  margin: 0 0 24px;
  color: #526472;
  font-size: 16px;
  line-height: 1.7;
}

.excel-resource-choice .story-action { margin-top: auto; }

.excel-direct-downloads {
  margin-top: 22px;
  border: 1px solid rgba(31, 74, 109, .15);
  border-radius: 20px;
  background: rgba(247, 250, 252, .78);
}

.excel-direct-downloads summary {
  padding: 20px 24px;
  color: #1f4a6d;
  font-weight: 800;
  cursor: pointer;
}

.excel-direct-downloads[open] summary { border-bottom: 1px solid rgba(31, 74, 109, .12); }
.excel-direct-downloads .excel-download-grid { padding: 22px; }

[data-theme="dark"] .excel-resource-choice {
  border-color: rgba(126, 178, 213, .22);
  background: linear-gradient(145deg, rgba(15, 40, 57, .98), rgba(10, 30, 44, .96));
  box-shadow: 0 20px 54px rgba(0, 0, 0, .22);
}

[data-theme="dark"] .excel-resource-choice h3 { color: #f2f7fb; }
[data-theme="dark"] .excel-resource-choice p { color: #b7c6d0; }
[data-theme="dark"] .excel-direct-downloads { background: rgba(9, 31, 46, .74); }

@media (max-width: 900px) {
  .excel-resource-choice-grid { grid-template-columns: 1fr; }
  .excel-resource-choice { min-height: 0; }
}

/* Excel Level 1 chapter dividers and the resource-use timeline follow the six-part course map. */
.excel-story-page .excel-teaching-slide.excel-chapter-slide {
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background-image: radial-gradient(circle at 98% 112%, color-mix(in srgb, var(--xl1-accent) 11%, transparent) 0 14%, transparent 14.2% 21%, color-mix(in srgb, var(--xl1-accent) 6%, transparent) 21.2% 28%, transparent 28.2%);
}

.excel-chapter-divider {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1220px, 100%);
  max-width: none;
  gap: clamp(28px, 4vh, 50px);
  align-self: center;
}

.excel-chapter-heading {
  display: grid;
  grid-template-columns: clamp(116px, 11vw, 180px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 62px);
}

.excel-chapter-heading > b {
  color: var(--xl1-accent-strong);
  font: 800 clamp(84px, 10vw, 168px)/.8 Manrope, sans-serif;
  letter-spacing: -.08em;
}

.excel-chapter-heading > div {
  display: grid;
  gap: 13px;
}

.excel-chapter-heading small {
  color: var(--xl1-accent-strong);
  font: 800 clamp(14px, 1vw, 18px)/1.2 Manrope, sans-serif;
  letter-spacing: .08em;
}

.excel-story-page .excel-chapter-heading h2 {
  max-width: 23ch;
  margin: 0;
  font-size: clamp(48px, 4.8vw, 82px);
  line-height: 1.08;
  text-wrap: balance;
}

.excel-chapter-heading p {
  max-width: 62ch;
  margin: 0;
  color: var(--xl1-muted);
  font-size: clamp(18px, 1.4vw, 25px);
  line-height: 1.5;
  text-wrap: pretty;
}

.excel-chapter-resource {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--xl1-line);
}

.excel-chapter-resource span {
  color: var(--xl1-accent-strong);
  font: 800 13px/1.2 Manrope, sans-serif;
  letter-spacing: .1em;
}

.excel-chapter-resource strong {
  min-width: 0;
  color: var(--xl1-ink);
  font-size: clamp(16px, 1.2vw, 22px);
  overflow-wrap: anywhere;
}

.excel-resource-timeline {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.excel-resource-timeline article {
  display: grid;
  grid-template-columns: minmax(78px, .62fr) minmax(150px, 1.18fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--xl1-line);
  border-radius: 15px;
  background: var(--xl1-panel);
}

.excel-resource-timeline article > b {
  color: var(--xl1-accent-strong);
  font-size: clamp(13px, .9vw, 16px);
}

.excel-resource-timeline article > strong {
  min-width: 0;
  color: var(--xl1-ink);
  font-size: clamp(15px, 1.05vw, 20px);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.excel-resource-timeline article > span {
  min-width: 0;
  color: var(--xl1-muted);
  font-size: clamp(13px, .88vw, 16px);
  line-height: 1.4;
}

/* The 10-item activity must fit an XGA projector without clipping the answer panel. */
@media (min-width: 901px) and (max-width: 1100px) and (min-height: 651px) {
  .excel-type-game { width: calc(100% - 8px); grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px; padding: 10px; justify-self: start; }
  .excel-type-game-items { gap: 3px; }
  .excel-type-game-items button {
    min-height: 34px;
    grid-template-columns: 24px minmax(0, 1fr) 43px;
    gap: 5px;
    padding: 4px 6px;
    font-size: 8.5px;
  }
  .excel-type-game-items button > b { font-size: 7.5px; }
  .excel-type-game-items button > i { min-width: 0; padding: 3px; font-size: 7px; }
  .excel-type-game-table { gap: 5px; }
  .excel-type-game-table > header strong { font-size: 13px; }
  .excel-type-game-table > header span,
  .excel-type-game-status,
  .excel-type-game-controls button { font-size: 8px; }
  .excel-type-game-bucket { grid-template-columns: 58px minmax(0, 1fr); }
  .excel-type-game-bucket > strong { padding: 6px; font-size: 9px; }
  .excel-type-game-slot { gap: 3px; padding: 6px; }
  .excel-type-game-slot b,
  .excel-type-game-slot span { font-size: 7px; }
}

@media (max-width: 900px) {
  .excel-story-page .excel-teaching-slide.excel-chapter-slide {
    grid-template-columns: minmax(0, 1fr);
  }
  .excel-resource-timeline article {
    grid-template-columns: 74px minmax(125px, .9fr) minmax(0, 1.1fr);
  }
}

@media (orientation: landscape) and (max-height: 430px) and (max-width: 950px) {
  .excel-story-page .excel-teaching-slide.excel-chapter-slide {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 38px 10px;
    overflow: hidden;
  }
  .excel-chapter-divider { gap: 12px; }
  .excel-chapter-heading { grid-template-columns: 70px minmax(0, 1fr); gap: 18px; }
  .excel-chapter-heading > b { font-size: 58px; }
  .excel-chapter-heading > div { gap: 5px; }
  .excel-chapter-heading small { font-size: 7px; }
  .excel-story-page .excel-chapter-heading h2 { max-width: 30ch; font-size: 26px; }
  .excel-chapter-heading p { font-size: 9px; line-height: 1.32; }
  .excel-chapter-resource { gap: 9px; padding-top: 8px; }
  .excel-chapter-resource span { font-size: 6px; }
  .excel-chapter-resource strong { font-size: 8px; }
  .excel-resource-timeline { gap: 4px; }
  .excel-resource-timeline article {
    grid-template-columns: 55px minmax(90px, .88fr) minmax(0, 1.12fr);
    gap: 6px;
    padding: 5px 7px;
    border-radius: 7px;
  }
  .excel-resource-timeline article > b { font-size: 6px; }
  .excel-resource-timeline article > strong { font-size: 7px; }
  .excel-resource-timeline article > span { font-size: 6px; line-height: 1.25; }
}

/* Keep the combined Normalization + Data Validation activity inside short
   landscape stages without dropping either principle or hiding the visual. */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 720px) {
  .excel-story-page .excel-teaching-slide[data-visual="validation-dedup"] {
    gap: 12px;
    padding-block: 8px 6px;
  }

  .excel-story-page .excel-teaching-slide[data-visual="validation-dedup"] h2 {
    font-size: clamp(22px, 3.45vw, 27px);
  }

  .excel-story-page .excel-teaching-slide[data-visual="validation-dedup"] .slide-lead {
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.22;
  }

  .excel-data-actions { gap: 4px; padding: 6px; border-radius: 10px; }
  .excel-data-actions article { padding: 6px; border-radius: 8px; }
  .excel-data-actions article > b { margin-top: 4px; font-size: 5.5px; line-height: 1.2; }
  .excel-normalization-rules { gap: 2px; margin-top: 5px; }
  .excel-normalization-rules span { gap: 4px; padding: 3px 4px; border-radius: 5px; }
  .excel-normalization-rules b { width: 16px; height: 16px; border-radius: 4px; font-size: 5.5px; }
  .excel-normalization-rules i { font-size: 5.5px; }
  .excel-dropdown-demo { margin-top: 5px; border-radius: 6px; }
  .excel-dropdown-demo > * { padding: 5px 4px; font-size: 6px; }
  .excel-data-actions > p { padding: 4px 6px; font-size: 5.5px; line-height: 1.2; }
}

/* The compact toolbar can otherwise impose an intrinsic width wider than a
   portrait phone. Clamp only the Excel presentation shell; desktop/projector
   and other article decks remain untouched. */
@media (orientation: portrait) and (max-width: 560px) {
  .excel-story-page .presentation-shell {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    overflow: hidden;
  }

  .excel-story-page .presentation-stage,
  .excel-story-page .presentation-toolbar,
  .excel-story-page .presentation-zoom-rail,
  .excel-story-page .presentation-zoom-viewport,
  .excel-story-page .presentation-zoom-content {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }

  .excel-story-page .presentation-stage { overflow-x: hidden; }
  .excel-story-page .presentation-toolbar { padding-inline: 6px; }
  .excel-story-page .presentation-progress { display: none; }
  .excel-story-page .presentation-controls { min-width: 0; justify-content: center; gap: 3px; }

  .excel-story-page .excel-edit-command-board { gap: 6px; }
  .excel-story-page .excel-edit-command-board article {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
    border-radius: 9px;
  }
  .excel-story-page .excel-edit-command-board article > strong { font-size: 11px; }
  .excel-story-page .excel-edit-command-board kbd { padding: 6px 4px; font-size: 8px; }
  .excel-story-page .excel-edit-command-board > p { padding: 8px; font-size: 9px; }
}
