/*
 * NTIMA OS v12.0.6 — Global Mobile Compatibility and Desktop Header Layering
 * Presentation and accessibility compatibility layer only. No data, permission,
 * routing, calculation or workflow behaviour is changed.
 */

@media (max-width:900px){
  /* One vertical viewport for both private applications. Horizontal movement is
   * contained at component level (tables and swipe navigation), never on page. */
  html,
  body{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow-x:hidden!important;
    overscroll-behavior-x:none!important;
  }

  @supports (overflow:clip){
    html,
    body{overflow-x:clip!important}
  }

  body:has(.wfms-app),
  body:has(.genesis-admin-shell){
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
  }

  :is(
    .wfms-app,
    .wfms-main,
    .wfms-section,
    .wfms-card,
    .wfms-panel,
    .wfms-page,
    .wfms-wrap,
    .wfms-content,
    .genesis-admin-shell,
    .genesis-admin-main,
    .genesis-admin-content,
    .genesis-admin-topbar,
    .genesis-admin-page-heading,
    .genesis-admin-topbar-actions,
    .wtfms-panel,
    .ge-wrap,
    .ge-card,
    .genesis-workspace,
    .genesis-dreamers-page
  ){
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  :is(.wfms-app,.genesis-admin-shell) *,
  :is(.wfms-app,.genesis-admin-shell) *::before,
  :is(.wfms-app,.genesis-admin-shell) *::after{
    box-sizing:border-box;
  }

  :is(.wfms-app,.genesis-admin-shell) :is(
    img,
    video,
    iframe,
    object,
    embed,
    svg
  ){
    max-width:100%;
  }

  :is(.wfms-app,.genesis-admin-shell) :is(
    p,
    a,
    span,
    strong,
    small,
    label,
    li,
    dt,
    dd,
    td,
    th,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6
  ){
    overflow-wrap:anywhere;
  }

  :is(.wfms-app,.genesis-admin-shell) :is(pre,.code,code){
    max-width:100%;
    overflow-wrap:anywhere;
    white-space:pre-wrap;
  }

  /* Fixed mobile chrome uses the visual viewport width without creating a
   * 100vw scrollbar or extending beneath the iPhone side insets. */
  .wfms-member-v1082.wfms-dashboard-view .wfms-v1082-header,
  .wfms-v1089-secondary-nav{
    width:100%!important;
    max-width:980px!important;
  }

  .wfms-v1089-secondary-nav,
  .wfms-member-v1082.wfms-dashboard-view .wfms-v1082-header{
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
  }


  .genesis-mobile-drawer{
    width:min(92%,430px)!important;
    max-width:100%!important;
  }

  .genesis-admin-popover,
  .genesis-page-actions-popover,
  .wfms-account-popover,
  body > .wfms-account-popover.wfms-account-popover-viewport{
    max-width:calc(100% - 24px)!important;
  }

  /* Large data remains usable through a local scroller. It cannot widen the
   * application document itself. */
  :is(.wfms-app,.genesis-admin-shell) :is(
    .table-responsive,
    .wfms-table-wrap,
    .wtfms-table-wrap,
    .genesis-table-wrap,
    .wfms-kindle-table-wrap,
    .ge-table-wrap,
    .gen-table-scroll,
    .genesis-assistant-table-wrap,
    .genesis-admin-content table.widefat
  ){
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }

  :is(.wfms-app,.genesis-admin-shell) table{
    max-width:100%!important;
  }

  /* Legacy administration pages sometimes render a widefat table without a
   * dedicated wrapper. The table itself becomes the local scroll surface so
   * no column or action is lost while the document remains vertically fixed. */
  :is(.wfms-app,.genesis-admin-shell) table.widefat{
    display:block;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }

  :is(.wfms-app,.genesis-admin-shell) :is(div,section)[class*="table"]:has(> table){
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }

  /* All ordinary form controls respect their column. */
  :is(.wfms-app,.genesis-admin-shell) :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    textarea,
    select
  ){
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }

  /* Native selects remain the real interactive controls. A non-interactive
   * mirror is added only when the selected wording cannot fit on one line. */
  :is(.wfms-app,.genesis-admin-shell) select.genesis-selection-complete{
    min-height:46px!important;
    height:auto!important;
    padding-top:9px!important;
    padding-bottom:9px!important;
    padding-left:11px!important;
    padding-right:40px!important;
    color:inherit!important;
    font-size:clamp(11px,3.45vw,14px)!important;
    line-height:1.3!important;
    white-space:normal!important;
    text-overflow:clip!important;
  }

  .genesis-select-full-value{
    display:none;
    width:100%;
    max-width:100%;
    margin:5px 0 0;
    padding:7px 9px;
    border:1px solid rgba(8,116,67,.14);
    border-radius:9px;
    background:#f4faf6;
    color:#23483a;
    font-size:11px;
    font-weight:700;
    line-height:1.35;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  .genesis-select-full-value.is-visible{display:none!important}

  /* Administration inner pages use a compact header in normal document flow.
   * It remains fully below the iPhone safe area on first view, then scrolls away
   * with the page instead of covering statistics, cards or filters. */
  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    position:relative!important;
    top:auto!important;
    z-index:35!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:10px!important;
    width:auto!important;
    min-height:0!important;
    margin:0 -11px 12px!important;
    padding:max(9px,env(safe-area-inset-top,0px)) 11px 13px!important;
    border-bottom:1px solid rgba(var(--genesis-page-module-rgb,8,120,68),.13)!important;
    background:rgba(245,248,246,.985)!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    transition:none!important;
  }

  html.genesis-pwa-standalone .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  html.genesis-pwa-standalone .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    /* The standalone body already owns the hardware safe-area inset. */
    padding-top:9px!important;
  }

  body.admin-bar .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  body.admin-bar .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    top:auto!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar-actions,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar-actions{
    order:1!important;
    align-self:flex-end!important;
    display:flex!important;
    width:auto!important;
    max-width:100%!important;
    min-height:42px!important;
    margin:0!important;
    justify-content:flex-end!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar-actions :is(
    .genesis-page-actions-toggle,
    .genesis-assistant-launcher-topbar,
    .genesis-admin-icon-button,
    .genesis-admin-user-chip
  ){
    flex:0 0 42px!important;
    width:42px!important;
    min-width:42px!important;
    max-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    max-height:42px!important;
    padding:0!important;
    border-radius:13px!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-page-heading,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-page-heading{
    order:2!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-page-heading h1,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-page-heading h1{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 0 9px!important;
    color:var(--genesis-admin-text,#183d30)!important;
    font-size:clamp(25px,7.2vw,31px)!important;
    line-height:1.12!important;
    letter-spacing:-.035em!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:auto!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-location-row,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-location-row{
    display:grid!important;
    grid-template-columns:36px minmax(0,1fr)!important;
    align-items:start!important;
    gap:8px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-location-back,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-location-back{
    display:inline-flex!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-location-trail,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-location-trail{
    display:flex!important;
    align-items:center!important;
    align-content:flex-start!important;
    flex-wrap:wrap!important;
    gap:4px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding-top:7px!important;
    overflow:visible!important;
    color:#65796f!important;
    font-size:10.5px!important;
    line-height:1.35!important;
    white-space:normal!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-location-trail a span:not(.dashicons),
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-location-trail a span:not(.dashicons){
    display:inline!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-location-trail :is(a,.is-current,.is-context),
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-location-trail :is(a,.is-current,.is-context){
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  /* The page title already states the current location. Removing the duplicate
   * final breadcrumb keeps the header calm without removing any navigation. */
  .genesis-admin-shell.is-genesis-inner-page .genesis-location-trail .is-current,
  .genesis-admin-shell.is-genesis-inner-page .genesis-location-trail .genesis-location-separator:has(+ .is-current){
    display:none!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-page-heading>p,
  .genesis-admin-shell.is-genesis-inner-page .genesis-module-identity,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-page-heading>p,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-module-identity{
    display:none!important;
  }

  /* Member secondary pages: the measured fixed-control height becomes the exact
   * content offset. The fallback also includes the iPhone safe area. */
  .wfms-member-v1082.wfms-secondary-view .wfms-section.active{
    padding-top:var(--genesis-mobile-controls-offset,calc(76px + env(safe-area-inset-top,0px)))!important;
  }

  .wfms-member-v1082.wfms-secondary-view .wfms-section.active :is(
    .wfms-page-head,
    .wfms-title-row,
    .wfms-score-page-head,
    .wfms-contrib-heading,
    .wfms-v1082-history-head
  ){
    min-width:0!important;
    max-width:100%!important;
    flex-wrap:wrap!important;
  }

  .wfms-member-v1082.wfms-secondary-view .wfms-section.active :is(
    .wfms-page-head,
    .wfms-title-row,
    .wfms-score-page-head,
    .wfms-contrib-heading,
    .wfms-v1082-history-head
  ) > :first-child{
    min-width:0!important;
    max-width:100%!important;
  }

  .wfms-member-v1082.wfms-secondary-view .wfms-section.active :is(h1,h2){
    width:100%!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:anywhere!important;
  }
}

@media (max-width:420px){
  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar-actions,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar-actions{
    gap:5px!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar-actions :is(
    .genesis-page-actions-toggle,
    .genesis-assistant-launcher-topbar,
    .genesis-admin-icon-button,
    .genesis-admin-user-chip
  ){
    flex-basis:40px!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
  }
}

@media (max-width:360px){
  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar-actions,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar-actions{
    gap:4px!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar-actions :is(
    .genesis-page-actions-toggle,
    .genesis-assistant-launcher-topbar,
    .genesis-admin-icon-button,
    .genesis-admin-user-chip
  ){
    flex-basis:39px!important;
    width:39px!important;
    min-width:39px!important;
    max-width:39px!important;
    height:39px!important;
    min-height:39px!important;
    max-height:39px!important;
  }
}

@media print{
  .genesis-select-full-value{display:none!important}
}


/* Dreamers hero secondary action remains legible over its amber background. */
.genesis-dreamers-hero-actions .button:not(.button-primary){
  border-color:rgba(255,255,255,.42)!important;
  background:rgba(255,255,255,.12)!important;
  color:#fff!important;
}
.genesis-dreamers-hero-actions .button:not(.button-primary):hover,
.genesis-dreamers-hero-actions .button:not(.button-primary):focus-visible{
  background:rgba(255,255,255,.22)!important;
  color:#fff!important;
}


/* v12.0.4 — Desktop administration inner-page header layering.
 *
 * Internal pages intentionally retain a sticky command header on desktop.
 * Previously that header was transparent until the window-level compact-state
 * controller detected scrolling. Installed desktop PWAs can scroll through a
 * different surface, leaving the title and account controls visible underneath
 * green banners, cards and forms. The header now owns an opaque stacking layer
 * in every state, without relying on JavaScript scroll detection. */
@media (min-width:901px){
  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-main{
    position:relative!important;
    isolation:isolate!important;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    position:sticky!important;
    top:0!important;
    z-index:200000!important;
    isolation:isolate!important;
    overflow:visible!important;
    opacity:1!important;
    background:#f5f8f6!important;
    background-color:#f5f8f6!important;
    background-image:none!important;
    border-bottom:1px solid rgba(var(--genesis-page-module-rgb,8,120,68),.14)!important;
    box-shadow:0 9px 24px rgba(16,60,45,.09)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    transform:translateZ(0);
  }

  /* A dedicated opaque paint layer prevents content from showing through even
   * when a browser promotes sticky descendants to separate compositor layers. */
  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar::before,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar::before{
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    border-radius:inherit;
    background:#f5f8f6;
    pointer-events:none;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar > *,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar > *{
    position:relative;
    z-index:1;
  }

  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-content{
    position:relative!important;
    z-index:1!important;
  }

  body.admin-bar .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  body.admin-bar .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    top:32px!important;
  }

  html.genesis-pwa-standalone body.genesis-pwa-admin .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  html.genesis-pwa-standalone body.genesis-pwa-admin .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    top:0!important;
  }
}

@media print{
  .genesis-admin-shell.is-genesis-inner-page .genesis-admin-topbar,
  .genesis-admin-shell.is-genesis-inner-page.is-genesis-scroll-compact .genesis-admin-topbar{
    position:static!important;
    top:auto!important;
    box-shadow:none!important;
    transform:none!important;
  }
}

/* UX18.32 — Platform form cleanliness rule.
 * Selected values live only inside their native control. Legacy mirrors remain
 * suppressed everywhere, while real help/error/status text is untouched. */
.genesis-select-full-value,
.genesis-select-full-value.is-visible{display:none!important}

/* Organisation access: one compact professional row on wide desktop. */
@media (min-width:1380px){
  .genesis-admin-shell .ntima-access-grant-form-v1832{
    grid-template-columns:minmax(170px,1.35fr) minmax(190px,1.35fr) minmax(150px,1.15fr) minmax(125px,.9fr) minmax(140px,1.05fr) minmax(140px,1.05fr) minmax(130px,.95fr) minmax(230px,1.55fr)!important;
    gap:8px!important;
    align-items:end!important;
    padding:12px!important;
  }
  .genesis-admin-shell .ntima-access-grant-form-v1832>label{margin:0!important;align-self:end!important}
  .genesis-admin-shell .ntima-access-grant-form-v1832>.button{
    width:100%!important;
    min-height:46px!important;
    height:auto!important;
    margin:0!important;
    padding-inline:12px!important;
    white-space:normal!important;
    line-height:1.15!important;
  }
}

/* Security step-up: password, MFA code and confirmation action share one row
 * on desktop; phone layouts continue to stack. */
@media (min-width:901px){
  .genesis-admin-shell .ntima-mfa-stepup form{
    display:grid!important;
    grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) minmax(240px,auto)!important;
    gap:12px!important;
    align-items:end!important;
  }
  .genesis-admin-shell .ntima-mfa-stepup form>label{margin:0!important;min-width:0!important}
  .genesis-admin-shell .ntima-mfa-stepup form>.button{min-height:46px!important;margin:0!important}
}
@media (max-width:900px){
  .genesis-admin-shell .ntima-mfa-stepup form{grid-template-columns:1fr!important}
}

