/* Screen LMS v210 Hotfix 03
   Shared page-header isolation, search/dropdown lifecycle, and professional
   Email Templates / Progress Logic / Reporting layouts. */

/* Hotfix 147: compact the authenticated desktop chrome. The previous 1fr
   brand column expanded into unused whitespace before search. Keep a fixed
   working gap, let search use the space, and retain right-aligned actions. */
@media (min-width: 1101px) {
  #main-content > header {
    grid-template-columns: max-content minmax(360px, 620px) minmax(max-content, 1fr) !important;
    column-gap: clamp(16px, 2vw, 30px) !important;
    padding-inline: clamp(20px, 3vw, 36px) !important;
  }
  #main-content > header .header-brand-line {
    width: max-content !important;
    max-width: 280px !important;
  }
  #main-content > header .global-page-search {
    width: 100% !important;
    max-width: 620px !important;
    margin: 0 !important;
    justify-self: start !important;
  }
  #main-content > header .top-links {
    justify-self: end !important;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  #main-content > header {
    grid-template-columns: 92px minmax(160px, 1fr) auto !important;
    gap: 8px !important;
    padding-inline: 12px !important;
  }
  #main-content > header .header-brand-line {
    width: 92px !important;
    min-width: 92px !important;
    overflow: visible !important;
  }
  #main-content > header .header-screen-lms-logo {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    flex-basis: 92px !important;
  }
  #main-content > header .global-page-search {
    width: 100% !important;
    max-width: none !important;
    min-width: 160px !important;
    margin: 0 !important;
  }
  #main-content > header .top-links {
    gap: 4px !important;
  }
  #main-content > header .top-links > a:not(.top-profile-widget) > span,
  #main-content > header .top-notification-button > span,
  #main-content > header .top-profile-text {
    display: none !important;
  }
  #main-content > header .top-profile-widget {
    grid-template-columns: 34px !important;
    padding-inline: 5px !important;
  }
}

/* The application chrome is #main-content > header. Page-level semantic
   headers and nested main regions must never inherit shell dimensions. */
#main-content > .content header,
#main-content > .content main {
  height: auto;
  min-height: 0;
  width: auto;
  max-width: 100%;
  margin: 0;
  color: inherit;
}
#main-content > .content main {
  margin-left: 0;
}

/* Native hidden state is authoritative for every shared dropdown. */
.hotfix03-enabled [hidden],
.hotfix03-enabled [aria-hidden="true"][role="listbox"],
.hotfix03-enabled [aria-hidden="true"].global-page-results,
.hotfix03-enabled [aria-hidden="true"].combobox-options,
.hotfix03-enabled [aria-hidden="true"].fuzzy-select-menu {
  display: none !important;
}

/* Permission Finder deliberately uses the live count only; no separate banner. */
.hotfix03-enabled [data-permission-no-results],
.hotfix03-enabled .permission-matrix-search-empty,
.hotfix03-enabled .permission-search-empty {
  display: none !important;
}

/* Prevent application-shell or old runtime classification classes from
   constraining page scrolling. */
body.hotfix02-email-templates,
body.hotfix02-progress-logic,
body.hotfix02-reports {
  overflow-y: auto !important;
  overflow-x: hidden;
}
body.hotfix02-email-templates #main-content,
body.hotfix02-progress-logic #main-content,
body.hotfix02-reports #main-content,
body.hotfix02-email-templates #main-content > .content,
body.hotfix02-progress-logic #main-content > .content,
body.hotfix02-reports #main-content > .content {
  overflow: visible !important;
  min-height: 0;
}

/* ---------- Email Template Studio ---------- */
.email-template-admin {
  display: grid;
  gap: 1.25rem;
  width: min(100%, 1560px);
  margin-inline: auto;
  min-width: 0;
  padding-bottom: 3rem;
}
.email-template-admin .email-admin-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.5rem;
  margin: 0;
  padding: clamp(1.35rem, 2.6vw, 2.25rem);
  border: 1px solid #d7e4f2;
  border-radius: 24px;
  background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 56%, #f9fbfd 100%);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .07);
}
.email-template-admin .email-admin-title > div:first-child {
  min-width: 0;
  max-width: 880px;
}
.email-template-admin .email-admin-title h1 {
  margin: .15rem 0 .55rem;
  color: #10223f;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.email-template-admin .email-admin-title .lead {
  margin: 0;
  max-width: 820px;
  line-height: 1.65;
}
.email-template-admin .email-admin-title .button-row {
  justify-content: flex-end;
  align-self: start;
}
.email-template-admin .email-scope-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, .9fr);
  align-items: end;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  overflow: visible;
}
.email-template-admin .email-scope-card h2 { margin-bottom: .35rem; }
.email-template-admin .email-scope-card p { margin: 0; }
.email-template-admin .email-scope-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(120px, .5fr) auto;
  gap: .8rem;
  align-items: end;
  margin: 0;
}
.email-template-admin .email-scope-form label,
.email-template-admin .email-test-form label {
  margin: 0;
  min-width: 0;
}
.email-template-admin .email-scope-form input,
.email-template-admin .email-scope-form select,
.email-template-admin .email-test-form input {
  margin-bottom: 0;
}
.email-template-admin .email-template-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin: 0;
  min-width: 0;
}
.email-template-admin .template-list-card {
  position: sticky;
  top: 84px;
  height: calc(100dvh - 110px);
  max-height: calc(100dvh - 110px);
  min-height: 32rem;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
}
.email-template-admin .template-list-card .title-row { margin-bottom: .6rem; }
.email-template-admin .template-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  padding-right: .35rem;
}
.email-template-admin .template-list-item {
  min-width: 0;
  overflow: hidden;
}
.email-template-admin .email-editor-stack {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
  width: 100%;
  margin: 0;
}
.email-template-admin .email-editor-stack > .card {
  min-width: 0;
  overflow: visible;
  padding: clamp(1.1rem, 2vw, 1.5rem);
}
.email-template-admin .email-editor-heading,
.email-template-admin .email-preview-card > .title-row,
.email-template-admin .email-compare-card > .title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.email-template-admin .email-template-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.email-template-admin .email-template-fields > .span-2 { grid-column: 1 / -1; }
.email-template-admin .email-template-fields > div { min-width: 0; }
.email-template-admin .email-template-fields input,
.email-template-admin .email-template-fields select,
.email-template-admin .email-template-fields textarea {
  margin-bottom: .25rem;
}
.email-template-admin .email-template-fields textarea {
  min-height: 13rem;
  max-height: 48rem;
  resize: vertical;
}
.email-template-admin #email-template-html { min-height: 20rem; }
.email-template-admin .email-variable-panel,
.email-template-admin .email-preview-card,
.email-template-admin .email-history-card,
.email-template-admin .email-audit-card,
.email-template-admin .email-compare-card {
  min-width: 0;
}
.email-template-admin .table-wrap,
.email-template-admin .hotfix02-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border-radius: 14px;
  scrollbar-gutter: stable;
}
.email-template-admin .table-wrap table {
  min-width: 760px;
  margin: 0;
}
.email-template-admin .email-test-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr);
  align-items: end;
}
.email-template-admin .email-test-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: .75rem;
  align-items: end;
  margin: 0;
}
.email-template-admin .email-preview-frame {
  min-height: min(720px, 75dvh);
}

/* ---------- Progress Logic ---------- */
.progress-logic-page {
  display: grid;
  gap: 1.25rem;
  width: min(100%, 1500px);
  margin-inline: auto;
  padding-bottom: 3rem;
  min-width: 0;
}
.progress-logic-page .progress-logic-hero {
  min-height: 0;
  align-items: center;
  padding: clamp(1.35rem, 2.8vw, 2.35rem);
  border-radius: 24px;
}
.progress-logic-page .progress-program-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: end;
  overflow: visible;
}
.progress-logic-page .progress-program-toolbar > div { min-width: 0; }
.progress-logic-page .progress-program-toolbar input { margin-bottom: 0; }
.progress-logic-page .progress-rule-card {
  overflow: clip;
  border-radius: 24px;
}
.progress-logic-page .progress-rule-card-header {
  height: auto;
  min-height: 0;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, #fbfdff, #f1f7ff);
  color: inherit;
}
.progress-logic-page .progress-rule-form {
  display: grid;
  gap: 0;
  padding: 1.35rem 1.5rem 1.6rem;
}
.progress-logic-page .progress-builder-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}
.progress-logic-page .progress-step-content {
  min-width: 0;
  padding: 0 0 1.5rem;
}
.progress-logic-page .progress-step-content > header {
  height: auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 .9rem;
  border: 0;
  background: transparent;
  color: inherit;
}
.progress-logic-page .progress-step-content > header > div { min-width: 0; }
.progress-logic-page .progress-step-content > header h3,
.progress-logic-page .progress-step-content > header p { overflow-wrap: anywhere; }
.progress-logic-page .form-grid.three-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, .55fr) minmax(260px, 1fr);
  gap: 1rem;
  align-items: start;
}
.progress-logic-page .progress-scope-columns,
.progress-logic-page .progress-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.progress-logic-page .progress-course-panel,
.progress-logic-page .progress-segmented-choice,
.progress-logic-page .progress-requirement-grid,
.progress-logic-page .progress-summary-panel,
.progress-logic-page .progress-impact-panel {
  min-width: 0;
  overflow: visible;
}
.progress-logic-page .progress-requirement-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.progress-logic-page .progress-requirement-grid > label,
.progress-logic-page .progress-course-choice,
.progress-logic-page .progress-order-grid > label {
  min-width: 0;
  overflow: hidden;
}
.progress-logic-page .progress-requirement-grid small,
.progress-logic-page .progress-course-choice small,
.progress-logic-page .progress-order-grid small {
  overflow-wrap: anywhere;
}
.progress-logic-page .progress-save-bar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #cfe0f5;
  border-radius: 16px;
  background: #f5f9ff;
}

/* ---------- Reporting Centre ---------- */
.reporting-page {
  width: min(100%, 1580px);
  margin-inline: auto;
  padding-bottom: 3rem;
  min-width: 0;
}
.reporting-page .reporting-hero {
  height: auto;
  min-height: 0;
  padding: clamp(1.4rem, 2.8vw, 2.35rem);
  overflow: hidden;
  color: inherit;
}
.reporting-page .reporting-hero > div:first-child { min-width: 0; }
.reporting-page .reporting-hero h1,
.reporting-page .reporting-hero p { overflow-wrap: anywhere; }
.reporting-page .report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.reporting-page .report-summary-card {
  min-width: 0;
  overflow: hidden;
}
.reporting-page .reporting-catalogue-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: end;
  gap: 1rem;
  overflow: visible;
}
.reporting-page .report-catalogue-search { width: 100%; min-width: 0; }
.reporting-page .report-catalogue-search input { margin: 0; }
.reporting-page .report-catalogue-group {
  min-width: 0;
  overflow: visible;
}
.reporting-page .report-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.reporting-page .report-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: none;
}
.reporting-page .report-card:hover {
  transform: none;
}
.reporting-page .report-card h3,
.reporting-page .report-card p,
.reporting-page .report-card-footer,
.reporting-page .report-card-footer > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.reporting-page .report-card h3 a { display: inline; }
.reporting-page .report-card-footer {
  align-items: flex-end;
  flex-wrap: wrap;
}
.reporting-page .reporting-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.reporting-page .reporting-secondary-grid > .card { min-width: 0; overflow: hidden; }
.reporting-page .report-filter-form,
.reporting-page .report-preset-form { min-width: 0; }
.reporting-page .report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
  align-items: end;
}
.reporting-page .report-filter-grid label { min-width: 0; }
.reporting-page .report-filter-grid input,
.reporting-page .report-filter-grid select { margin-bottom: 0; }
.reporting-page .report-filter-actions,
.reporting-page .report-table-toolbar,
.reporting-page .report-export-actions {
  min-width: 0;
  flex-wrap: wrap;
}
.reporting-page .report-table-card { min-width: 0; overflow: hidden; }
.reporting-page .report-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.reporting-page .report-data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.reporting-page .report-data-table th,
.reporting-page .report-data-table td {
  min-width: 9rem;
  max-width: 26rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.reporting-page .report-data-table th { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .email-template-admin .email-scope-card { grid-template-columns: 1fr; align-items: start; }
  .email-template-admin .email-template-layout { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .progress-logic-page .form-grid.three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-logic-page .form-grid.three-col > :first-child { grid-column: 1 / -1; }
  .progress-logic-page .progress-requirement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reporting-page .report-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reporting-page .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .email-template-admin .email-admin-title,
  .email-template-admin .email-scope-card,
  .email-template-admin .email-template-layout,
  .email-template-admin .email-test-card,
  .progress-logic-page .progress-program-toolbar,
  .reporting-page .reporting-catalogue-toolbar,
  .reporting-page .reporting-secondary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .email-template-admin .email-admin-title .button-row { justify-content: flex-start; }
  .email-template-admin .template-list-card { position: static; height: auto; min-height: 0; max-height: none; overflow: visible; }
  .email-template-admin .template-list { overflow: visible; padding-right: 0; }
  .email-template-admin .template-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-logic-page .progress-scope-columns,
  .progress-logic-page .progress-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .reporting-page .reporting-hero { display: grid; grid-template-columns: minmax(0, 1fr); }
  .reporting-page .reporting-hero-meta { justify-self: start; min-width: 0; }
}

@media (max-width: 680px) {
  .email-template-admin,
  .progress-logic-page,
  .reporting-page { gap: 1rem; }
  .email-template-admin .email-admin-title,
  .email-template-admin .email-scope-card,
  .email-template-admin .email-editor-stack > .card,
  .progress-logic-page .progress-logic-hero,
  .progress-logic-page .progress-program-toolbar,
  .reporting-page .reporting-hero,
  .reporting-page .reporting-catalogue-toolbar { padding: 1rem; border-radius: 18px; }
  .email-template-admin .email-scope-form,
  .email-template-admin .email-template-fields,
  .email-template-admin .email-test-form,
  .email-template-admin .template-list,
  .progress-logic-page .form-grid.three-col,
  .progress-logic-page .progress-requirement-grid,
  .reporting-page .report-card-grid,
  .reporting-page .report-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .email-template-admin .email-template-fields > .span-2,
  .progress-logic-page .form-grid.three-col > :first-child { grid-column: auto; }
  .email-template-admin .email-editor-heading,
  .progress-logic-page .progress-rule-card-header,
  .progress-logic-page .progress-step-content > header,
  .progress-logic-page .progress-save-bar,
  .reporting-page .report-table-toolbar,
  .reporting-page .report-card-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .progress-logic-page .progress-rule-form { padding: 1rem; }
  .progress-logic-page .progress-builder-step { grid-template-columns: 34px minmax(0, 1fr); gap: .65rem; }
  .reporting-page .report-card-footer .btn,
  .email-template-admin .button-row .btn,
  .progress-logic-page .progress-save-bar .button { width: 100%; text-align: center; }
}

/* Hotfix 67: expose the complete email-template catalogue. */
.email-template-admin .template-list-card{
  position:static!important;
  top:auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
.email-template-admin .template-list{
  flex:none!important;
  max-height:none!important;
  overflow:visible!important;
  padding-right:0!important;
}

/* Hotfix 151: make the desktop header's reserved width match its visible
   content. The timezone chip previously clipped its label while its hidden
   children still consumed grid space, leaving a large empty band. */
@media (min-width: 1101px) {
  #main-content > header {
    min-height: 70px !important;
    grid-template-columns: max-content minmax(320px, 560px) minmax(0, 1fr) !important;
    column-gap: clamp(14px, 1.5vw, 22px) !important;
    padding: 9px clamp(18px, 2.2vw, 28px) !important;
  }
  #main-content > header .header-brand-line {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    gap: 10px !important;
    overflow: visible !important;
  }
  #main-content > header .header-screen-lms-logo {
    width: 112px !important;
    min-width: 112px !important;
    max-width: 112px !important;
    flex: 0 0 112px !important;
  }
  #main-content > header .timezone-status-chip {
    width: auto !important;
    min-width: 0 !important;
    max-width: 136px !important;
    padding: 7px 10px !important;
    gap: 0 !important;
    overflow: hidden !important;
  }
  #main-content > header .timezone-status-label,
  #main-content > header .timezone-check-button {
    display: none !important;
  }
  #main-content > header .timezone-status-value {
    display: block !important;
    max-width: 116px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  #main-content > header .global-page-search {
    width: 100% !important;
    max-width: 560px !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-self: start !important;
  }
  #main-content > header .global-page-search-shell {
    min-height: 48px !important;
  }
  #main-content > header .top-links {
    min-width: 0 !important;
    gap: 6px !important;
    justify-self: end !important;
  }
}

/* Hotfix 154: the timezone control is account metadata, not primary chrome.
   Keep the brand column equal to the visible logo at every authenticated
   breakpoint so it cannot reserve an invisible band before search. This block
   intentionally follows Hotfix 151 so its dimensions are authoritative. */
@media (min-width: 1101px) {
  #main-content > header {
    grid-template-columns: 112px minmax(320px, 560px) minmax(0, 1fr) !important;
    column-gap: 14px !important;
  }
  #main-content > header .header-brand-line {
    width: 112px !important;
    min-width: 112px !important;
    max-width: 112px !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    overflow: hidden !important;
  }
  #main-content > header .timezone-status-chip {display:none!important}
}
@media (min-width: 901px) and (max-width: 1100px) {
  #main-content > header .header-brand-line {
    width:92px!important;min-width:92px!important;max-width:92px!important;
    flex-wrap:nowrap!important;gap:0!important;overflow:hidden!important;
  }
  #main-content > header .timezone-status-chip {display:none!important}
}
@media (max-width: 900px) {
  #main-content > header .timezone-status-chip {display:none!important}
}

/* Hotfix 155: compact desktop chrome. Keep visible controls together instead
   of distributing blank grid space between the logo, search, and actions. */
@media (min-width: 1101px) {
  #main-content > header {
    height: 58px !important;
    min-height: 58px !important;
    grid-template-columns: 104px minmax(300px, 500px) minmax(0, 1fr) !important;
    column-gap: 10px !important;
    padding: 6px 18px !important;
  }
  #main-content > header .header-brand-line,
  #main-content > header .header-screen-lms-logo {
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    flex-basis: 104px !important;
  }
  #main-content > header .global-page-search {
    max-width: 500px !important;
  }
  #main-content > header .global-page-search-box {
    min-height: 42px !important;
    height: 42px !important;
  }
  #main-content > header .global-page-search input {
    margin: 0 !important;
  }
  #main-content > header .top-links {
    justify-self: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
  }
  #main-content > header .top-links > a:not(.top-profile-widget),
  #main-content > header .top-links > button,
  #main-content > header .top-notification-button {
    min-height: 36px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  #main-content > header .top-profile-widget {
    grid-template-columns: 34px minmax(96px, 158px) !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 5px 7px !important;
  }
  #main-content > header .top-avatar {
    width: 32px !important;
    height: 32px !important;
  }
}

/* Hotfix 185: mobile-first authenticated shell and dashboard refinement.
   The previous phone layout exposed stacked desktop chrome, duplicated brand
   treatments, oversized controls, and a chat launcher that obscured content. */
@media (max-width: 900px) {
  :root {
    --mobile-shell-gutter: 14px;
    --mobile-control-height: 44px;
  }

  body {
    background: #f5f8fc !important;
  }

  /* Compact native-style app bar. */
  .sidebar,
  aside.sidebar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    min-height: 64px !important;
    border-bottom: 1px solid rgba(203, 213, 225, .82) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .07) !important;
    background: rgba(255, 255, 255, .96) !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
  }
  .sidebar .brand {
    min-height: 64px !important;
    padding: 9px 68px 9px 14px !important;
    gap: 10px !important;
    border-bottom: 0 !important;
  }
  .sidebar .brand .brand-mark,
  .sidebar .brand > span:first-child,
  .sidebar .brand > div:first-child {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }
  .sidebar .brand strong {
    font-size: 1rem !important;
    line-height: 1.15 !important;
  }
  .sidebar .brand span {
    font-size: .78rem !important;
    line-height: 1.15 !important;
  }
  .mobile-menu-toggle {
    position: absolute !important;
    top: 10px !important;
    right: 12px !important;
    z-index: 1003 !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 13px !important;
    border: 1px solid #d9e2ef !important;
    background: #f8fafc !important;
    box-shadow: none !important;
  }
  .mobile-menu-toggle .mobile-menu-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .mobile-menu-toggle .mobile-menu-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
  }

  /* Remove duplicated mobile branding and expose only useful controls. */
  #main-content > header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 10px var(--mobile-shell-gutter) 12px !important;
    background: #fff !important;
    border-bottom: 1px solid #e5ebf3 !important;
  }
  #main-content > header .header-brand-line,
  #main-content > header .mobile-header-logout-form {
    display: none !important;
  }
  #main-content > header .top-links {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(3, 44px) minmax(0, 1fr) !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  #main-content > header .global-page-search {
    order: 2 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }
  #main-content > header .global-page-search-box {
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .055) !important;
  }
  #main-content > header .global-page-search input {
    min-height: 0 !important;
    height: 42px !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 650 !important;
    text-overflow: ellipsis !important;
  }
  #main-content > header .global-page-results {
    top: 130px !important;
    left: var(--mobile-shell-gutter) !important;
    right: var(--mobile-shell-gutter) !important;
    max-height: calc(100dvh - 150px) !important;
  }

  #main-content > header .top-links > a:not(.top-profile-widget),
  #main-content > header .top-notification-widget,
  #main-content > header .top-notification-button {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 13px !important;
    justify-content: center !important;
    border: 1px solid #dbe4ef !important;
    background: #fff !important;
    box-shadow: 0 4px 13px rgba(15, 23, 42, .05) !important;
  }
  #main-content > header .top-links > a:not(.top-profile-widget) > span:not(.nav-attention-badge),
  #main-content > header .top-upgrade-link > span:not(.top-upgrade-dot) {
    display: none !important;
  }
  #main-content > header .top-links .nav-icon,
  #main-content > header .top-notification-button .nav-icon {
    width: 19px !important;
    height: 19px !important;
  }
  #main-content > header .top-profile-widget {
    order: 10 !important;
    grid-column: 4 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 4px 10px 4px 5px !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 8px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    justify-content: stretch !important;
  }
  #main-content > header .top-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }
  #main-content > header .top-profile-text {
    display: grid !important;
    align-content: center !important;
    min-width: 0 !important;
  }
  #main-content > header .top-profile-text strong,
  #main-content > header .top-profile-text em {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  #main-content > header .top-profile-text strong {
    font-size: .84rem !important;
    line-height: 1.1 !important;
  }
  #main-content > header .top-profile-text em {
    margin-top: 2px !important;
    font-size: .68rem !important;
    line-height: 1 !important;
  }

  /* Tighter page rhythm and cards without sacrificing touch targets. */
  #main-content > .content {
    padding: 18px var(--mobile-shell-gutter) 84px !important;
  }
  #main-content > .content > .title-row {
    margin: 0 0 14px !important;
    padding: 0 2px 14px !important;
    border-bottom: 1px solid #dfe7f1 !important;
  }
  #main-content > .content > .title-row .eyebrow {
    margin-bottom: 4px !important;
    font-size: .7rem !important;
    letter-spacing: .075em !important;
  }
  #main-content > .content > .title-row h1 {
    margin: 0 !important;
    font-size: clamp(1.65rem, 7vw, 2rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.035em !important;
  }
  .dashboard-ecosystem-panel,
  .instructor-kpi-panel,
  .guided-empty-state {
    margin-top: 0 !important;
    padding: 18px !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .065) !important;
  }
  .dashboard-ecosystem-head {
    display: grid !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }
  .dashboard-ecosystem-head h2 {
    margin: 3px 0 7px !important;
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
  }
  .dashboard-ecosystem-head .muted {
    margin: 0 !important;
    font-size: .9rem !important;
    line-height: 1.5 !important;
  }
  .dashboard-ecosystem-head > .btn,
  .dashboard-ecosystem-head > a.btn {
    width: auto !important;
    justify-self: start !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
  }
  .dashboard-ecosystem-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .dashboard-ecosystem-kpis article {
    min-width: 0 !important;
    padding: 12px !important;
    border-radius: 14px !important;
  }

  /* Mobile chat is a compact floating action button and never masks copy. */
  .screen-chat-launcher {
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px)) !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 30px rgba(29, 78, 216, .28) !important;
  }
  .screen-chat-launcher::before {
    content: "\1F4AC";
    font-size: 1.25rem;
    line-height: 1;
  }
  .screen-chat-launcher .dot,
  .screen-chat-launcher .live-label {
    display: none !important;
  }
  .screen-chat-launcher .chat-count {
    right: -5px !important;
    top: -6px !important;
  }
}

@media (max-width: 420px) {
  #main-content > header .top-links {
    grid-template-columns: repeat(3, 42px) minmax(0, 1fr) !important;
    gap: 7px !important;
  }
  #main-content > header .top-links > a:not(.top-profile-widget),
  #main-content > header .top-notification-widget,
  #main-content > header .top-notification-button {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
  }
}
