/* NSS AUTOCARE V11.8.3 — reversible curtain navigation, TRAINING-only.
   Workspaces use one Dashboard return button and one current-module label.
   The full previously approved module grid returns on Dashboard click. */
@media screen {
  /* Preserve car, remove its independent opaque honeycomb rectangle. */
  #mainApp .brand::after {
    background: url('icons/nss-headlight-cutout.png?v=11.8.3') right center / contain no-repeat !important;
    opacity:.96 !important;
    width:clamp(180px,20vw,295px) !important;
    height:100%;
    right:0; top:0; bottom:0;
    pointer-events:none;
  }
  #mainApp .brand { isolation:isolate; }
  #mainApp .brand::before {z-index:-1;}
  #mainApp .brand::after {z-index:-1;}
  /* Return the space to forms and tables: the big header is never sticky. */
  #mainApp .topbar {position:relative !important;top:auto !important;}
  #mainApp.nss1183-workspace .brand,
  #mainApp:not(:has(#dashboard.active)) .brand {
    min-height:87px !important;
    padding:9px clamp(12px,2.3vw,34px) !important;
    gap:clamp(10px,1.9vw,22px) !important;
  }
  #mainApp.nss1183-workspace .brand .logo,
  #mainApp:not(:has(#dashboard.active)) .brand .logo {
    width:clamp(130px,17.3vw,230px) !important;
  }
  #mainApp.nss1183-workspace .brand h1,
  #mainApp:not(:has(#dashboard.active)) .brand h1 {
    font-size:clamp(18px,2.35vw,32px) !important;
  }
  #mainApp.nss1183-workspace .top-actions,
  #mainApp:not(:has(#dashboard.active)) .top-actions {
    padding:6px clamp(11px,1.8vw,25px) !important;
  }
  /* Collapsed module strip: only Dashboard and current workspace. */
  #mainApp.nss1183-workspace #tabs,
  #mainApp:not(:has(#dashboard.active)) #tabs {
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    gap:12px !important;
    min-height:54px !important;
    padding:7px clamp(9px,2.2vw,30px) !important;
    margin:0 !important;
    background:#0a1011 !important;
    border-top:1px solid #465254 !important;
    border-bottom:1px solid #566062 !important;
    isolation:isolate;
  }
  #mainApp.nss1183-workspace #tabs::after,
  #mainApp:not(:has(#dashboard.active)) #tabs::after {display:none!important;content:none!important;}
  #mainApp.nss1183-workspace #tabs .tab:not([data-page="dashboard"]),
  #mainApp:not(:has(#dashboard.active)) #tabs .tab:not([data-page="dashboard"]) {
    display:none !important;
  }
  #mainApp.nss1183-workspace #tabs [data-page="dashboard"],
  #mainApp:not(:has(#dashboard.active)) #tabs [data-page="dashboard"] {
    flex:1 1 auto;
    min-width:0;
    padding:9px clamp(13px,2vw,24px) !important;
    min-height:40px !important;
    border:1px solid #667174 !important;
    border-left:4px solid #f34e02 !important;
    background:linear-gradient(90deg,#202729,#101516) !important;
    color:#e7ebec !important;
    text-align:left !important;
    border-radius:8px !important;
    font-size:clamp(15px,1.35vw,20px) !important;
    font-weight:800 !important;
    font-style:italic !important;
    cursor:pointer;
    justify-content:flex-start !important;
    box-shadow:none !important;
  }
  #mainApp.nss1183-workspace #tabs [data-page="dashboard"]::before,
  #mainApp:not(:has(#dashboard.active)) #tabs [data-page="dashboard"]::before {
    content:'⌂';mask:none!important;-webkit-mask:none!important;
    background:none!important;color:#f34e02!important;
    font:normal 23px/1 Arial,sans-serif; flex:0 0 auto;
  }
  #mainApp #tabs #nss1183-current-module {
    display:none;
    flex:0 0 auto;
    margin-left:auto;
    min-width:0;
    max-width:min(45%,360px);
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    padding:9px 15px;
    color:#ffc09a;
    font-size:clamp(12px,1.05vw,15px);
    font-weight:750;
    border:1px solid #da662f;
    border-radius:999px;
    background:#291c17;
    text-align:center;
  }
  #mainApp.nss1183-workspace #tabs #nss1183-current-module,
  #mainApp:not(:has(#dashboard.active)) #tabs #nss1183-current-module {
    display:block;
  }
  /* Work area begins directly after the slim return bar. */
  #mainApp.nss1183-workspace .page.active,
  #mainApp:not(:has(#dashboard.active)) .page.active {
    padding-top:10px !important;
  }
  /* Curtain opens DOWN when Dashboard is selected again. */
  #mainApp:has(#dashboard.active) #tabs .tab:not([data-page="dashboard"]) {
    animation:nss1183CurtainDrop .27s cubic-bezier(.2,.75,.27,1) both;
    transform-origin:top center;
  }
  @keyframes nss1183CurtainDrop {
    from {opacity:0;transform:translateY(-10px) scaleY(.88)}
    to {opacity:1;transform:translateY(0) scaleY(1)}
  }
  @media (prefers-reduced-motion:reduce) {
    #mainApp #tabs .tab {animation:none!important;transition:none!important;}
  }
  @media(max-width:760px) {
    #mainApp .brand::after {display:none !important;}
    #mainApp.nss1183-workspace #tabs,
    #mainApp:not(:has(#dashboard.active)) #tabs {gap:6px!important;padding:6px 9px!important;min-height:48px!important;}
    #mainApp #tabs #nss1183-current-module{max-width:50%;font-size:11px;padding:7px 9px;}
    #mainApp.nss1183-workspace #tabs [data-page="dashboard"],
    #mainApp:not(:has(#dashboard.active)) #tabs [data-page="dashboard"] {
      font-size:15px!important;padding:7px 10px!important;min-height:37px!important;
    }
    #mainApp.nss1183-workspace .brand,
    #mainApp:not(:has(#dashboard.active)) .brand {min-height:83px!important;}
  }
}
