/* Shared React public shell refinements. The component owns these dimensions;
   page-specific legacy selectors must not create a second header variant. */
.header2.public-header {
  overflow: visible;
  height: auto;
  padding: 0;
  background: rgba(247,245,239,.035);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(2px);
  transition: padding .42s cubic-bezier(.22,1,.36,1), background-color .4s ease, box-shadow .4s ease, backdrop-filter .4s ease;
}
.header2.public-header.is-scrolled {
  padding: 0;
  background: rgba(247,245,239,.96);
  box-shadow: 0 10px 30px rgba(6,20,38,.04);
  backdrop-filter: blur(16px);
}
.header2.public-header .header-inner {
  width: min(100% - 40px,1500px);
  height: 88px;
  grid-template-columns: 170px minmax(0, 1fr) 350px;
  padding-inline: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--m-line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.header2.public-header.is-scrolled .header-inner { height: 68px; border-bottom-color: var(--m-line-strong); }
.header2.public-header .nav2 {
  gap: 5px;
  padding: 5px;
  justify-self: center;
  background: rgba(6,20,38,.035);
  border: 1px solid rgba(6,20,38,.06);
  border-radius: 12px;
}
.header2.public-header .nav2 a {
  min-height: 38px;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
}
.header2.public-header .nav2 a::after { display: none; }
.header2.public-header .nav2 a small {
  min-width: 23px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: rgba(6,20,38,.55);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(6,20,38,.08);
  border-radius: 6px;
  opacity: 1;
}
.header2.public-header .nav2 a:hover {
  color: var(--m-ink);
  background: rgba(255,255,255,.86);
  border-color: rgba(6,20,38,.08);
  box-shadow: 0 6px 16px rgba(6,20,38,.055);
}
.header2.public-header .nav2 a:hover small {
  color: var(--m-blue-dark);
  background: rgba(47,110,244,.08);
  border-color: rgba(47,110,244,.12);
}
.footer2 { margin-top: 0; }
.header-account-link {
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--m-line-strong);
  border-radius: 9px;
  color: var(--m-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .25s var(--m-ease);
}
.header-account-link:hover { border-color: rgba(47,110,244,.32); background: rgba(47,110,244,.07); color: var(--m-blue-dark); transform: translateY(-1px); }
.header-account-link .lucide { width: 16px; height: 16px; }
.public-header .mini-cta {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--m-blue);
  border-radius: 10px;
  background: var(--m-blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47,110,244,.16);
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s var(--m-ease);
}
.public-header .mini-cta:hover {
  border-color: var(--m-blue-dark);
  background: var(--m-blue-dark);
  color: #fff;
  box-shadow: 0 14px 28px rgba(47,110,244,.22);
  transform: translateY(-1px);
}
.public-header .mini-cta:hover > .lucide { color: #fff; }
.brand2 .brand-logo-light { display: none; }
.header2--dark:not(.is-scrolled) .header-inner { border-bottom-color: rgba(255,255,255,.13); }
.header2--dark:not(.is-scrolled) .brand-logo-normal { display: none; }
.header2--dark:not(.is-scrolled) .brand-logo-light { display: block; }
.header2--dark:not(.is-scrolled) .nav2 a { color: rgba(255,255,255,.72); }
.header2--dark:not(.is-scrolled) .nav2 a small { color: #fff; opacity: .5; }
.header2--dark:not(.is-scrolled) .nav2 a.is-active,
.header2--dark:not(.is-scrolled) .nav2 a:hover { color: #fff; }
.header2--dark:not(.is-scrolled) .mini-cta { color: #fff; border-bottom-color: rgba(255,255,255,.62); }
.header2--dark:not(.is-scrolled) .header-account-link { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.04); }
.header2--dark:not(.is-scrolled) .header-account-link:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.1); }
.header2--dark:not(.is-scrolled) .menu-toggle { color: #fff; border-color: rgba(255,255,255,.55); }

/* Public chrome is intentionally identical to the homepage on every route. */
.case-page .header2.public-header:not(.is-scrolled) .header-inner { border-bottom-color: var(--m-line); }
.case-page .header2.public-header:not(.is-scrolled) .brand2 img { filter: none; }
.case-page .header2.public-header:not(.is-scrolled) .nav2 a { color: rgba(6,20,38,.66); }
.case-page .header2.public-header:not(.is-scrolled) .nav2 a small { color: var(--m-ink); opacity: .34; }
.case-page .header2.public-header:not(.is-scrolled) .mini-cta { color: var(--m-ink); border-bottom-color: rgba(6,20,38,.55); }
.case-page .header2.public-header:not(.is-scrolled) .menu-toggle { color: var(--m-ink); border-color: var(--m-ink); }
.mobile-menu2.public-mobile-menu {
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  overflow: clip;
  contain: layout paint size;
}

@media (max-width: 1180px) {
  .header2.public-header .header-inner { grid-template-columns: 155px minmax(0, 1fr) 245px; }
  .header-account-link span { display: none; }
  .header-account-link { width: 44px; padding: 0; justify-content: center; }
  .nav2 { gap: clamp(14px,2vw,26px); }
}
@media (max-width: 980px) {
  .header2.public-header,
  .header2.public-header.is-scrolled { padding-block: 14px; backdrop-filter: blur(10px); }
  .header2.public-header.is-scrolled { padding-block: 4px; }
  .header2.public-header .header-inner,
  .header2.public-header.is-scrolled .header-inner {
    width: min(100% - 32px,1500px);
    height: 60px;
    grid-template-columns: 1fr auto;
  }
  .header-account-link { display: inline-flex; }
  .header-action { gap: 8px; }

  .mobile-menu2.public-mobile-menu .drawer-panel {
    width: min(88vw,390px);
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    padding: calc(18px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
    background: var(--m-paper);
    border: 0;
    border-left: 1px solid var(--m-line-strong);
    border-radius: 16px 0 0 16px;
  }
  .public-mobile-menu .drawer-head {
    min-height: 58px;
    flex: 0 0 auto;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--m-line-strong);
  }
  .public-mobile-menu .drawer-close {
    width: 44px;
    height: 44px;
    border: 1px solid var(--m-line-strong);
    border-radius: 50%;
    background: transparent;
  }
  .mobile-menu2.public-mobile-menu .drawer-panel nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
    gap: 0;
    margin-top: 18px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(47,110,244,.45) transparent;
  }
  .mobile-menu2.public-mobile-menu .drawer-panel nav a {
    min-height: 0;
    grid-template-columns: 34px minmax(0,1fr) 20px;
    padding: 13px 2px;
    color: var(--m-ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--m-line);
    border-radius: 0;
    font-size: .9rem;
    box-shadow: none;
  }
  .mobile-menu2.public-mobile-menu .drawer-panel nav a:hover {
    color: var(--m-ink);
    background: transparent;
    border-color: var(--m-line);
  }
  .mobile-menu2.public-mobile-menu .drawer-panel nav a.is-active {
    padding-right: 12px;
    color: var(--m-blue-dark);
    background: transparent;
    border-color: var(--m-line);
  }
  .mobile-menu2.public-mobile-menu .drawer-panel nav small {
    width: auto;
    height: auto;
    display: block;
    color: var(--m-blue-dark);
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .public-mobile-menu .drawer-foot { flex: 0 0 auto; margin-top: 0; }
}
@media (max-width: 760px) {
  .header2.public-header,
  .header2.public-header.is-scrolled { padding-block: 8px; }
  .header2.public-header.is-scrolled { padding-block: 3px; }
  .header2.public-header .header-inner,
  .header2.public-header.is-scrolled .header-inner { height: 54px; }

  /* The assessment used to keep the min-content width of its long action
     labels, producing a 580px form inside a 360px viewport. */
  .start-page .start-assessment {
    width: auto;
    min-width: 0;
    grid-template-columns: minmax(0,1fr);
  }
  .start-page :where(
    .start-form-panel,
    .start-form,
    .start-form-step,
    .start-route-fieldset,
    .start-route-grid,
    .start-route-card,
    .start-form-actions
  ) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .start-page .start-route-grid { grid-template-columns: minmax(0,1fr); }
  .start-page .start-form-actions { display: grid; grid-template-columns: 1fr; }
  .start-page :where(.start-next,.start-submit,.start-back) {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
  .start-page .start-step-error { width: 100%; }

  /* Horizontal policy navigation must scroll inside its own track instead
     of making the entire document as wide as every item combined. */
  .policy-page .policy-layout { min-width: 0; grid-template-columns: minmax(0,1fr); }
  .policy-page .policy-toc { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
  .policy-page .policy-toc nav { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }

  .case-page .study-story-grid { min-width: 0; grid-template-columns: minmax(0,1fr); }
  .case-page .study-toc { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
  .case-page .study-toc nav { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
  .case-page .player-system-map { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 440px) { .header-account-link { display: none; } }

/* Browser-independent form controls */
.react-ui-select { width: 100%; }
.react-ui-select .ui-select-trigger {
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid rgba(6,20,38,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 22px rgba(6,20,38,.035);
  transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease, transform .22s var(--m-ease);
}
.react-ui-select .ui-select-trigger:hover { border-color: rgba(47,110,244,.34); background: #fff; }
.react-ui-select.is-open .ui-select-trigger {
  border-color: var(--m-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47,110,244,.11), 0 14px 32px rgba(6,20,38,.07);
}
.react-ui-select .ui-select-chevron { display: none; }
.ui-select-chevron-icon { width: 18px; height: 18px; color: var(--m-blue-dark); transition: transform .25s var(--m-ease); }
.react-ui-select.is-open .ui-select-chevron-icon { transform: rotate(180deg); }
.react-ui-select .ui-select-menu {
  margin-top: 8px;
  padding: 7px;
  border: 1px solid rgba(6,20,38,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 60px rgba(6,20,38,.14);
  backdrop-filter: blur(18px);
}
.react-ui-select .ui-select-option {
  min-height: 44px;
  margin: 2px 0;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 9px;
  transition: color .2s ease, background-color .2s ease, transform .2s var(--m-ease);
}
.react-ui-select .ui-select-option:hover,
.react-ui-select .ui-select-option:focus-visible { color: var(--m-blue-dark); background: rgba(47,110,244,.08); transform: translateX(2px); }
.react-ui-select .ui-select-option[aria-selected="true"] { color: #fff; background: var(--m-blue); }
.react-ui-select .ui-select-option .lucide { width: 16px; height: 16px; }
.react-ui-select.is-invalid .ui-select-trigger { border-color: #c54438; box-shadow: 0 0 0 3px rgba(197,68,56,.1); }
.react-ui-checkbox { width: 24px; height: 24px; flex: 0 0 24px; }
.react-ui-checkbox .ui-checkbox-box {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(6,20,38,.2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(6,20,38,.04);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s var(--m-ease);
}
.react-ui-checkbox .ui-checkbox-box::after { display: none; }
.react-ui-checkbox .ui-checkbox-box .lucide { width: 15px; height: 15px; color: #fff; opacity: 0; transform: scale(.7); transition: opacity .18s ease, transform .2s var(--m-ease); }
.react-ui-checkbox .ui-checkbox-native:checked + .ui-checkbox-box { border-color: var(--m-blue); background: var(--m-blue); box-shadow: 0 9px 20px rgba(47,110,244,.2); }
.react-ui-checkbox .ui-checkbox-native:checked + .ui-checkbox-box .lucide { opacity: 1; transform: scale(1); }
.react-ui-checkbox .ui-checkbox-native:focus-visible + .ui-checkbox-box { border-color: var(--m-blue); box-shadow: 0 0 0 3px rgba(47,110,244,.14); }

/* Keep every public text field aligned with the account forms. Custom selects,
   checkboxes and native upload/range controls intentionally remain untouched. */
.public-page :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="hidden"]),
  textarea
) {
  border-radius: 10px !important;
  transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.public-page :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="hidden"]),
  textarea
):focus {
  border-color: var(--m-blue);
  box-shadow: 0 0 0 3px rgba(47,110,244,.11);
}

/* Dashboard overview states and next-action rail */
.dashboard-project-focus,
.dashboard-health-card {
  display: flex;
  flex-direction: column;
}

.dashboard-panel-empty {
  min-height: 250px;
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.dashboard-panel-empty strong { font-size: 15px; }
.dashboard-panel-empty a {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--m-blue);
  background: rgba(47,110,244,.08);
  border: 1px solid rgba(47,110,244,.16);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}
.dashboard-project-focus .dashboard-panel-empty a {
  color: #fff;
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.14);
}

.dashboard-decision-strip {
  min-height: 94px;
  margin-top: 18px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(105deg,#0a1f38,#102f52);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
}
.dashboard-decision-strip > div { min-width: 0; display: grid; gap: 5px; }
.dashboard-decision-strip > div > span {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  color: #8fb1ff;
  font-size: 8px;
  letter-spacing: .14em;
}
.dashboard-decision-strip strong { font-size: 13px; line-height: 1.8; }
.dashboard-decision-strip > a {
  min-height: 44px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: none;
  color: var(--m-ink);
  background: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
}
.dashboard-decision-strip > a svg { width: 15px; height: 15px; }

@media (max-width: 640px) {
  .dashboard-panel-empty { min-height: 190px; }
  .dashboard-decision-strip { padding: 18px; display: grid; gap: 16px; }
  .dashboard-decision-strip > a { width: 100%; }
}

/* Dashboard action system: consistent contrast, touch targets and states. */
.dashboard-app main button {
  min-height: 40px;
  font-family: inherit;
  touch-action: manipulation;
}
.dashboard-app main button[aria-label] { min-width: 40px; }
.dashboard-app main button:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.dashboard-app :is(button,a):focus-visible {
  outline: 3px solid rgba(47,110,244,.28);
  outline-offset: 3px;
}
.dashboard-app .mm-button--primary,
.dashboard-app main [class*="_pageHead"] > button,
.dashboard-app main [class*="_createForm"] > button,
.dashboard-app main [class*="_chat"] form button,
.dashboard-app main [class*="_upload"] > button {
  color: #fff;
}
.dashboard-app .dashboard-sidebar-close {
  width: 42px;
  height: 42px;
}
.dashboard-app .dashboard-user > button {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
.dashboard-app [class*="_filterChips"] button,
.dashboard-app [class*="_pagination"] button,
.dashboard-app [class*="_preview"] > header button {
  min-height: 40px;
}
@media (hover: hover) {
  .dashboard-app main [class*="_pageHead"] > button:hover,
  .dashboard-app .mm-button--primary:not(:disabled):hover {
    box-shadow: 0 12px 26px rgba(47,110,244,.2);
    transform: translateY(-1px);
  }
}
