/*
 * TeachOB Elementor Companion 1.3.0
 * Final responsive layer. Loaded after Elementor page CSS.
 */

:root {
  --teachob-adminbar-h: 0px;
  --teachob-mobile-gutter: 16px;
}
body.admin-bar { --teachob-adminbar-h: 32px; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
}
body.menu-open { overflow: hidden !important; }

/* Keep the Elementor document canvas inside the real viewport. */
body .elementor,
body .elementor-page,
body .elementor-location-header,
body .elementor-location-footer,
body .elementor-widget-teachob-header,
body .elementor-widget-teachob-footer,
body .teachob-header-wrap,
body .teachob-footer-wrap,
body #main-content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
body .elementor-widget-teachob-header > .elementor-widget-container,
body .elementor-widget-teachob-footer > .elementor-widget-container,
body .elementor-widget-teachob-header .elementor-widget-container,
body .elementor-widget-teachob-footer .elementor-widget-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body .site-shell {
  width: 100% !important;
  max-width: calc(var(--shell) + 48px) !important;
  margin-inline: auto !important;
  padding-inline: 24px;
  box-sizing: border-box;
}

/* Header and off-canvas navigation. */
body .site-header {
  top: var(--teachob-adminbar-h) !important;
  width: 100% !important;
  max-width: 100% !important;
}
body .site-header__inner {
  width: 100% !important;
  max-width: calc(var(--shell) + 48px) !important;
  min-width: 0 !important;
}
body .brand,
body .brand__text,
body .primary-nav,
body .nav-cluster { min-width: 0; }
body .teachob-nav-overlay,
body .primary-nav__close { display: none; }

/* Footer always owns the whole viewport and never keeps desktop columns on phones. */
body .site-footer {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
}
body .site-footer__grid,
body .site-footer__bottom,
body .site-footer__grid > div {
  min-width: 0 !important;
  max-width: 100% !important;
}
body .site-footer__grid a,
body .site-footer__grid span,
body .site-footer__grid p,
body .site-footer__bottom span {
  overflow-wrap: break-word;
  word-break: normal;
}

/* Chapter shell: desktop and tablet maintain a real sidebar. */
@media (min-width: 768px) {
  body.teachob-chapter-page .chapter-page-shell.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner {
    --display: flex !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: clamp(24px, 4vw, 68px) !important;
    width: 100% !important;
    max-width: calc(var(--shell) + 48px) !important;
    min-width: 0 !important;
  }
  body.teachob-chapter-page .teachob-sidebar-column.e-con {
    --display: block !important;
    display: block !important;
    flex: 0 0 clamp(210px, 22vw, 270px) !important;
    width: clamp(210px, 22vw, 270px) !important;
    max-width: 270px !important;
    min-width: 0 !important;
  }
  body.teachob-chapter-page .chapter-main.e-con {
    --display: block !important;
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  body .chapter-sidebar__mobile-toggle { display: none !important; }
  body .chapter-sidebar__drawer { display: block !important; }
}

/* Protect content media at every width. */
body .chapter-main,
body .chapter-main .elementor-element,
body .chapter-main .elementor-widget-container,
body .resource-hero,
body .page-banner-band,
body .visual-story,
body .chapter-dashboard,
body .editable-content-section,
body .editable-content-section__grid,
body .resource-list,
body .resource-accordion,
body .resource-accordion__panel,
body .lesson-tabs,
body .lesson-panel,
body .source-content {
  min-width: 0 !important;
  max-width: 100% !important;
}
body .source-content,
body .editable-content-section,
body .resource-accordion__title,
body .resource-hero__content {
  overflow-wrap: break-word !important;
  word-break: normal !important;
}
body .source-content img,
body .editable-content-section img,
body .visual-card img,
body .page-banner-band img,
body .chapter-dashboard img,
body .resource-feature-image img,
body .lesson-plan-preview img {
  max-width: 100% !important;
  height: auto !important;
}
body .table-scroll {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
body .source-content table { max-width: none; }

/* Author section: prevent the desktop grid/full-bleed trick from creating horizontal overflow. */
body .authors-layout.e-con,
body .authors-layout.e-con > .e-con-inner,
body .authors-heading,
body .authors-list,
body .author-row,
body .author-row__bio {
  min-width: 0 !important;
  max-width: 100% !important;
}
body .author-row__bio,
body .author-row__bio p {
  overflow-wrap: break-word !important;
  word-break: normal !important;
  white-space: normal !important;
}

/* ---------------------------------------------------------------
   Compact devices: Elementor phone breakpoint and below.
   --------------------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --header-h: 72px;
    --teachob-mobile-gutter: 16px;
  }
  body.admin-bar { --teachob-adminbar-h: 46px; }

  body .site-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: var(--teachob-mobile-gutter) !important;
  }
  body .section-space {
    padding-block: 34px 54px !important;
  }
  body .e-con,
  body .e-con-inner,
  body .elementor-element,
  body .elementor-widget,
  body .elementor-widget-container {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Mobile header */
  body .site-header {
    position: sticky !important;
    z-index: 10020 !important;
  }
  body .site-header__inner {
    min-height: var(--header-h) !important;
    padding: 10px var(--teachob-mobile-gutter) !important;
    gap: 12px !important;
  }
  body .brand {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: calc(100% - 60px) !important;
    min-width: 0 !important;
    gap: 10px !important;
  }
  body .brand__mark {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 4px !important;
  }
  body .brand__text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  body .brand__text strong {
    display: block;
    max-width: 100%;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }
  body .brand__text small { display: none !important; }
  body .menu-toggle {
    display: block !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    border-radius: 3px !important;
    position: relative !important;
    z-index: 10031 !important;
  }
  body .primary-nav {
    position: fixed !important;
    z-index: 10030 !important;
    top: calc(var(--teachob-adminbar-h) + var(--header-h)) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    inset: auto 0 0 auto !important;
    margin-top: calc(var(--teachob-adminbar-h) + var(--header-h)) !important;
    width: min(88vw, 360px) !important;
    height: calc(100dvh - var(--teachob-adminbar-h) - var(--header-h)) !important;
    max-width: 100% !important;
    padding: 64px 20px 32px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    background: var(--surface) !important;
    box-shadow: -18px 0 50px rgba(8, 29, 37, .18) !important;
    transform: translateX(110%) !important;
    transition: transform .28s ease !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  body .primary-nav.is-open { transform: translateX(0) !important; }
  body .primary-nav__close {
    display: grid !important;
    place-items: center;
    position: absolute;
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
  }
  body .primary-nav > a,
  body .nav-cluster > button {
    width: 100% !important;
    min-height: 54px !important;
    padding: 15px 4px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: left !important;
    border-radius: 0 !important;
  }
  body .nav-account {
    margin-top: 18px !important;
    padding: 14px 16px !important;
    text-align: center !important;
    border: 0 !important;
    border-radius: 3px !important;
  }
  body .nav-logout {
    padding: 15px 4px !important;
    text-align: center !important;
  }
  body .mega-menu {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: 1fr !important;
    margin: 8px 0 14px !important;
    border-radius: 3px !important;
    box-shadow: none !important;
  }
  body .mega-menu__intro { min-height: 150px !important; padding: 22px !important; }
  body .mega-menu__links { grid-template-columns: 1fr !important; padding: 10px !important; }
  body .teachob-nav-overlay {
    display: block !important;
    position: fixed !important;
    z-index: 10025 !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    background: rgba(8, 29, 37, .48) !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
  }
  body .teachob-nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* Homepage */
  body .home-hero--photo {
    min-height: min(760px, calc(100dvh - var(--header-h))) !important;
    padding: 72px 0 90px !important;
    background-position: 48% center !important;
  }
  body .home-hero__center {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 18px !important;
  }
  body .home-hero__center h1 {
    max-width: 100% !important;
    margin-inline: auto !important;
    font-size: clamp(42px, 12vw, 58px) !important;
    line-height: .98 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  body .hero-statement--center { max-width: 100% !important; }
  body .button-row--center { width: 100% !important; }
  body .button-row--center .button { width: 100% !important; }
  body .chapter-entry__inner,
  body .leadership-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body .chapter-entry__nav { grid-template-columns: 1fr !important; }
  body .leadership-photo,
  body .leadership-photo img {
    min-height: 320px !important;
    height: 320px !important;
  }
  body .editorial-heading h2,
  body .authors-heading h2 {
    font-size: clamp(42px, 13vw, 56px) !important;
    line-height: 1 !important;
  }

  /* Author rows */
  body .authors-layout.e-con,
  body .authors-layout.e-con > .e-con-inner {
    --display: block !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 56px var(--teachob-mobile-gutter) !important;
    box-shadow: none !important;
    clip-path: none !important;
    background: var(--navy) !important;
  }
  body .authors-heading {
    position: static !important;
    width: 100% !important;
    margin-bottom: 36px !important;
  }
  body .authors-list.e-con {
    --display: block !important;
    display: block !important;
    width: 100% !important;
  }
  body .author-row {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    grid-auto-rows: auto !important;
    column-gap: 14px !important;
    row-gap: 12px !important;
    padding: 30px 0 34px !important;
  }
  body .author-row__number {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  body .author-row h3 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    margin: -5px 0 0 !important;
    font-size: 29px !important;
    line-height: 1.08 !important;
    overflow-wrap: break-word !important;
  }
  body .author-row__image {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 86px !important;
    height: 86px !important;
  }
  body .author-row__bio {
    grid-column: 2 !important;
    grid-row: auto !important;
    width: 100% !important;
  }
  body .author-row__bio,
  body .author-row__bio p {
    font-size: 15px !important;
    line-height: 1.72 !important;
  }

  /* Mobile chapter navigation and content stack */
  body.teachob-chapter-page .chapter-page-shell.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner {
    --display: flex !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px var(--teachob-mobile-gutter) 56px !important;
  }
  body.teachob-chapter-page .teachob-sidebar-column.e-con,
  body.teachob-chapter-page .chapter-main.e-con {
    --display: block !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body .chapter-sidebar {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 3px !important;
    overflow: hidden !important;
  }
  body .chapter-sidebar__mobile-toggle {
    display: flex !important;
    width: 100% !important;
    min-height: 58px !important;
    padding: 13px 15px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    border: 0 !important;
    background: var(--navy) !important;
    color: #fff !important;
    text-align: left !important;
    cursor: pointer;
  }
  body .chapter-sidebar__mobile-toggle span { min-width: 0; }
  body .chapter-sidebar__mobile-toggle strong {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.15;
  }
  body .chapter-sidebar__mobile-toggle small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.66);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  body .chapter-sidebar__mobile-toggle i {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.26);
    font-style: normal;
    font-size: 20px;
    transition: transform .2s ease;
  }
  body .chapter-sidebar__mobile-toggle[aria-expanded="true"] i { transform: rotate(45deg); }
  body .chapter-sidebar__drawer { display: none !important; }
  body .chapter-sidebar__drawer.is-open { display: block !important; }
  body .chapter-sidebar__head { display: none !important; }
  body .chapter-sidebar nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    padding: 6px 12px !important;
    overflow: visible !important;
  }
  body .chapter-sidebar__link {
    width: 100% !important;
    min-width: 0 !important;
    padding: 13px 10px !important;
  }
  body .chapter-sidebar .download-card {
    display: flex !important;
    margin: 0 12px 12px !important;
  }

  body .resource-hero--photo {
    min-height: 300px !important;
    width: 100% !important;
    padding: 24px 20px 28px !important;
    border-radius: 3px !important;
    background-position: center !important;
  }
  body .resource-hero__content { width: 100% !important; }
  body .resource-hero .breadcrumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
    margin-bottom: 34px !important;
    font-size: 11px !important;
  }
  body .resource-hero h1 {
    max-width: 100% !important;
    font-size: clamp(38px, 11vw, 50px) !important;
    line-height: .98 !important;
    letter-spacing: -.035em !important;
    overflow-wrap: break-word !important;
  }
  body .resource-hero p { font-size: 15px !important; }
  body .resource-hero__chapter { display: none !important; }

  body .page-banner-band,
  body .page-banner-band--reverse,
  body .chapter-dashboard--photo,
  body .visual-story__split,
  body .visual-story__split--reverse,
  body .visual-story__grid,
  body .visual-story__grid--three,
  body .visual-story__grid--four,
  body .visual-story__grid--feature,
  body .visual-story__media-stack,
  body .editable-content-section__grid,
  body .editable-content-section--left .editable-content-section__grid,
  body .editable-content-section--right .editable-content-section__grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body .page-banner-band__media,
  body .chapter-dashboard__photo {
    min-height: 220px !important;
  }
  body .page-banner-band__content,
  body .chapter-dashboard__primary,
  body .visual-story__header,
  body .visual-story__copy,
  body .visual-story__grid,
  body .editable-content-section {
    padding: 22px !important;
  }
  body .page-banner-band__content h2,
  body .visual-story__header h2,
  body .visual-story__copy h2,
  body .editable-content-section h2,
  body .chapter-dashboard h2,
  body .content-heading h2 {
    font-size: clamp(32px, 9.5vw, 43px) !important;
    line-height: 1.03 !important;
    overflow-wrap: break-word !important;
  }
  body .mini-link-grid,
  body .mini-link-grid--three,
  body .mini-link-grid--four,
  body .quick-overview,
  body .metrics-inline,
  body .metric-row,
  body .basic-resource-grid,
  body .section-card-grid,
  body .topic-grid,
  body .icon-stat-grid {
    grid-template-columns: 1fr !important;
  }
  body .visual-card img,
  body .mini-figure img { aspect-ratio: 16 / 10 !important; }
  body .resource-filter,
  body .content-actions,
  body .resource-toolbar,
  body .page-turn {
    width: 100% !important;
    max-width: 100% !important;
  }
  body .content-actions,
  body .resource-filter {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  body .lo-jump,
  body .download-actions { width: 100% !important; }
  body .download-actions { display: flex !important; flex-wrap: wrap !important; }
  body .resource-accordion__trigger {
    width: 100% !important;
    grid-template-columns: 30px minmax(0, 1fr) 34px !important;
    padding: 16px 13px !important;
    gap: 9px !important;
  }
  body .resource-accordion__title strong {
    font-size: 19px !important;
    line-height: 1.15 !important;
  }
  body .resource-accordion__title small,
  body .resource-accordion__meta .pill { display: none !important; }
  body .resource-toolbar {
    position: static !important;
    padding: 10px 12px !important;
  }
  body .resource-toolbar > span { display: none !important; }
  body .resource-toolbar > div { margin-left: 0 !important; width: 100% !important; display: flex !important; flex-wrap: wrap !important; }
  body .resource-accordion__panel > .source-content,
  body .source-content {
    padding: 20px !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
  }
  body .source-content h2 { font-size: 30px !important; margin-top: 38px !important; }
  body .source-content h3 { font-size: 24px !important; }
  body .source-content th,
  body .source-content td {
    min-width: 180px !important;
    padding: 11px !important;
  }

  body .lesson-tabs__nav,
  body .teachob-external-tabs {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  body .lesson-tabs__nav button,
  body .teachob-external-tabs button {
    flex: 0 0 165px !important;
    min-width: 165px !important;
  }
  body .lesson-panel,
  body .teachob-external-panel { width: 100% !important; max-width: 100% !important; }

  body .page-turn {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  body .page-turn__next { text-align: left !important; align-items: flex-start !important; }

  /* Login/signup and contact */
  body .access-page {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
  }
  body .access-page__visual {
    width: 100% !important;
    min-height: 430px !important;
  }
  body .access-page__visual-copy {
    left: 20px !important;
    right: 20px !important;
    bottom: 34px !important;
  }
  body .access-page__visual-copy h1 { font-size: clamp(44px, 14vw, 60px) !important; }
  body .access-page__form-wrap {
    width: 100% !important;
    min-height: 0 !important;
    padding: 44px var(--teachob-mobile-gutter) 60px !important;
  }
  body .login-card,
  body .contact-card { width: 100% !important; max-width: 100% !important; }
  body .auth-form-grid,
  body .form-grid { grid-template-columns: 1fr !important; }

  /* Footer */
  body .site-footer { padding-top: 0 !important; }
  body .site-footer .site-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 20px !important;
  }
  body .site-footer__grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    width: 100% !important;
    padding-top: 48px !important;
    padding-bottom: 42px !important;
  }
  body .site-footer__grid > div,
  body .site-footer__grid > div:first-child {
    display: flex !important;
    grid-column: 1 !important;
    width: 100% !important;
    align-items: flex-start !important;
  }
  body .site-footer .brand {
    max-width: 100% !important;
  }
  body .site-footer .brand__text small { display: block !important; }
  body .site-footer__bottom {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 0 !important;
    padding-top: 24px !important;
    padding-bottom: 28px !important;
    text-align: center !important;
  }
  body .site-footer__bottom .image-credits {
    order: 3 !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    text-align: center !important;
    line-height: 1.5 !important;
  }
}

@media (max-width: 420px) {
  :root { --teachob-mobile-gutter: 14px; }
  body .brand__text strong { font-size: 12px !important; }
  body .resource-hero h1 { font-size: clamp(35px, 10.8vw, 44px) !important; }
  body .page-banner-band__content,
  body .chapter-dashboard__primary,
  body .visual-story__header,
  body .visual-story__copy,
  body .visual-story__grid,
  body .editable-content-section { padding: 19px !important; }
  body .resource-accordion__panel > .source-content,
  body .source-content { padding: 17px !important; }
}

/* 1.3.0 final specificity corrections for Elementor container output. */
@media (max-width: 767px) {
  body .primary-nav {
    display: none !important;
    transform: none !important;
    visibility: visible !important;
  }
  body .primary-nav.is-open { display: flex !important; }
  body .teachob-nav-overlay { display: none !important; }
  body .teachob-nav-overlay.is-open { display: block !important; }

  body.teachob-chapter-page .chapter-page-shell.e-con > .teachob-sidebar-column.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .chapter-main.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner > .teachob-sidebar-column.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner > .chapter-main.e-con {
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: stretch !important;
    grid-column: 1 !important;
    order: initial !important;
  }
  body.teachob-chapter-page .chapter-page-shell.e-con > .teachob-sidebar-column.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner > .teachob-sidebar-column.e-con {
    grid-row: 1 !important;
  }
  body.teachob-chapter-page .chapter-page-shell.e-con > .chapter-main.e-con,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner > .chapter-main.e-con {
    grid-row: 2 !important;
  }
}

/* Keep the closed tablet navigation out of layout calculations as well. */
@media (min-width: 768px) and (max-width: 980px) {
  body .primary-nav {
    display: none !important;
    transform: none !important;
    visibility: visible !important;
    top: calc(var(--teachob-adminbar-h) + var(--header-h)) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    inset: auto 0 0 auto !important;
    margin-top: calc(var(--teachob-adminbar-h) + var(--header-h)) !important;
    width: min(78vw, 420px) !important;
    height: calc(100dvh - var(--teachob-adminbar-h) - var(--header-h)) !important;
    max-width: 100% !important;
    padding: 64px 24px 36px !important;
    background: var(--surface) !important;
    box-shadow: -18px 0 50px rgba(8, 29, 37, .18) !important;
    overflow-y: auto !important;
  }
  body .primary-nav.is-open { display: flex !important; }
  body .primary-nav__close {
    display: grid !important;
    place-items: center;
    position: absolute;
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 25px;
  }
  body .teachob-nav-overlay {
    display: none !important;
    position: fixed !important;
    z-index: 10025 !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    background: rgba(8, 29, 37, .48) !important;
  }
  body .teachob-nav-overlay.is-open { display: block !important; }
}

/* Final off-canvas geometry: exact top/bottom bounds, no margin-based positioning. */
@media (max-width: 980px) {
  body .primary-nav {
    inset: calc(var(--teachob-adminbar-h) + var(--header-h)) 0 0 auto !important;
    margin: 0 !important;
    height: auto !important;
  }
}

/* Client feedback v1.4.0: final responsive safeguards. */
body .resource-overview,
body .teachob-lo-tabs,
body .teachob-lo-panel,
body .teachob-config-approach { min-width: 0; max-width: 100%; }
body .resource-overview__grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
body .topic-grid a { grid-template-columns: 50px minmax(0,1fr) auto; }
body .topic-grid__lo { white-space: nowrap; }
body .teachob-config-table { width: 100%; }
body .teachob-config-table th,
body .teachob-config-table td { overflow-wrap: anywhere; }
@media (max-width: 767px) {
  body .resource-overview__grid { grid-template-columns: 1fr; }
  body .topic-grid a { grid-template-columns: 34px minmax(0,1fr) auto !important; }
  body .topic-grid__lo { min-width: 58px; font-size: 9px; }
  body .teachob-config-table { min-width: 760px; }
  body .teachob-lo-tabs .lo-jump { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; }
  body .teachob-lo-tabs .lo-jump > span { flex: 0 0 100%; }
  body .teachob-lo-tabs .lo-jump a { flex: 0 0 auto; }
}

/* ================================================================
   TeachOB Elementor 1.4.0 — final container compatibility layer
   Supports both Elementor Flexbox Containers (.e-con) and legacy/
   rendered Elementor containers (.elementor-container).
   ================================================================ */
@media (min-width: 768px) {
  body.teachob-chapter-page .chapter-page-shell.e-con,
  body.teachob-chapter-page .chapter-page-shell.elementor-container,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner,
  body.teachob-chapter-page .chapter-page-shell.elementor-container > .e-con-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: clamp(24px, 4vw, 68px) !important;
    width: min(calc(100% - 48px), var(--shell)) !important;
    max-width: var(--shell) !important;
    min-width: 0 !important;
    margin-inline: auto !important;
  }
  body.teachob-chapter-page .chapter-page-shell > .teachob-sidebar-column,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .teachob-sidebar-column {
    display: block !important;
    flex: 0 0 clamp(210px, 20vw, 270px) !important;
    width: clamp(210px, 20vw, 270px) !important;
    max-width: 270px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    order: 0 !important;
  }
  body.teachob-chapter-page .chapter-page-shell > .chapter-main,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .chapter-main {
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    order: 1 !important;
  }
}

@media (max-width: 767px) {
  body.teachob-chapter-page .chapter-page-shell.e-con,
  body.teachob-chapter-page .chapter-page-shell.elementor-container,
  body.teachob-chapter-page .chapter-page-shell.e-con > .e-con-inner,
  body.teachob-chapter-page .chapter-page-shell.elementor-container > .e-con-inner {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 24px var(--teachob-mobile-gutter) 56px !important;
  }
  body.teachob-chapter-page .chapter-page-shell > .teachob-sidebar-column,
  body.teachob-chapter-page .chapter-page-shell > .chapter-main,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .teachob-sidebar-column,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .chapter-main {
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: stretch !important;
    order: initial !important;
  }
  body.teachob-chapter-page .chapter-page-shell > .teachob-sidebar-column,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .teachob-sidebar-column { order: 0 !important; }
  body.teachob-chapter-page .chapter-page-shell > .chapter-main,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .chapter-main { order: 1 !important; }

  body.teachob-chapter-page .resource-hero,
  body.teachob-chapter-page .page-banner-band,
  body.teachob-chapter-page .visual-story,
  body.teachob-chapter-page .content-actions,
  body.teachob-chapter-page .editable-content-section,
  body.teachob-chapter-page .resource-overview,
  body.teachob-chapter-page .resource-filter,
  body.teachob-chapter-page .resource-list,
  body.teachob-chapter-page .teachob-config-approach,
  body.teachob-chapter-page .lesson-tabs,
  body.teachob-chapter-page .page-turn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
  }
  body.teachob-chapter-page .resource-hero h1,
  body.teachob-chapter-page .page-banner-band h2,
  body.teachob-chapter-page .visual-story h2,
  body.teachob-chapter-page .editable-content-section h2,
  body.teachob-chapter-page .source-content h2,
  body.teachob-chapter-page .source-content h3,
  body.teachob-chapter-page .source-content h4 {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }
  body.teachob-chapter-page .resource-hero h1 {
    font-size: clamp(38px, 11vw, 52px) !important;
    line-height: 1.02 !important;
  }
  body.teachob-chapter-page .resource-hero p,
  body.teachob-chapter-page .source-content,
  body.teachob-chapter-page .source-content p,
  body.teachob-chapter-page .source-content li {
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }
}

/* Preserve the exact Word-document configuration palette against generic
   source-table first-row styling. */
body .source-content .teachob-config-table tr.config-objective > th,
body .source-content .teachob-config-table tr.config-objective > td { background: #FCE4D6 !important; }
body .source-content .teachob-config-table tr.config-before > th,
body .source-content .teachob-config-table tr.config-before > td { background: #FFF2CC !important; }
body .source-content .teachob-config-table tr.config-during > th,
body .source-content .teachob-config-table tr.config-during > td { background: #E2EFDA !important; }
body .source-content .teachob-config-table tr.config-after > th,
body .source-content .teachob-config-table tr.config-after > td { background: #D9E1F2 !important; }

/* v1.5.0 final mobile safeguards */
@media (max-width: 767px) {
  html, body { max-width: 100%; overflow-x: clip !important; }
  .elementor, .elementor-element, .e-con, .e-con-inner,
  .chapter-main, .chapter-page-shell, .source-content,
  .resource-accordion, .resource-accordion__panel,
  .editable-content-section, .page-banner-band, .visual-story,
  .lesson-tabs, .lesson-panel { min-width: 0 !important; max-width: 100% !important; }
  .source-content :is(img,video,iframe,svg,canvas) { max-width: 100% !important; height: auto; }
  .table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* v1.5.0 Elementor + legacy-container chapter layout guarantee */
@media (max-width: 767px) {
  body.teachob-chapter-page .chapter-page-shell,
  body.teachob-chapter-page .chapter-page-shell.e-con,
  body.teachob-chapter-page .chapter-page-shell.elementor-container,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.teachob-chapter-page .chapter-page-shell > .teachob-sidebar-column,
  body.teachob-chapter-page .chapter-page-shell > .chapter-main,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .teachob-sidebar-column,
  body.teachob-chapter-page .chapter-page-shell > .e-con-inner > .chapter-main {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}


/* v1.5.3 nested chapter navigation */
@media (max-width:767px) {
 body .mega-menu--folders { max-height:none!important; overflow:visible!important; }
 body .mega-menu--folders .mega-menu__links { display:block!important; overflow:visible!important; }
 body .mega-menu__group { margin-bottom:7px!important; border-radius:3px!important; }
 body .mega-menu__links .mega-menu__parent { padding:12px!important; }
 body .mega-menu__subnav { padding:5px 7px 8px!important; }
 body .mega-menu__subnav a { padding:9px 8px 9px 19px!important; font-size:12px!important; }
 body .site-footer__grid .footer-chapter-nav__parent { padding-block:11px!important; }
 body .footer-chapter-nav__toggle { width:42px!important; min-width:42px!important; }
 body .site-footer__grid .footer-chapter-nav__subnav a { padding:8px 0 8px 14px!important; font-size:12px!important; }
}
