/* By Night topbar — exact SIFT structure shared by every system */
.bn-unified-topbar{
  height:72px!important;min-height:72px!important;
  padding:0 clamp(20px,3vw,46px)!important;
  display:flex!important;align-items:center!important;gap:14px!important;
  position:sticky!important;top:0!important;z-index:70!important;
  background:rgba(246,247,249,.9)!important;
  backdrop-filter:blur(18px)!important;
  border-bottom:1px solid rgba(225,225,229,.7)!important;
  box-shadow:none!important
}
.bn-unified-topbar>.topbar-live{display:contents!important}
.bn-unified-topbar>.topbar-page-title{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important}
.bn-unified-topbar>.mobile-menu{display:none!important}

/* 1 — city + solar, exact SIFT footprint */
.bn-unified-topbar .topbar-city{
  order:1!important;flex:0 1 auto!important;max-width:360px!important;margin:0 auto 0 0!important;
  min-width:0!important;display:grid!important;
  grid-template-columns:max-content minmax(0,120px)!important;
  align-items:center!important;column-gap:6px!important;row-gap:0!important
}
.bn-unified-topbar .topbar-city-picker{grid-column:2!important;grid-row:1!important;min-width:0!important}
.bn-unified-topbar .topbar-city-picker>form,
.bn-unified-topbar .topbar-city-picker>label{display:block!important;margin:0!important;min-width:0!important;width:100%!important}
.bn-unified-topbar .topbar-city-picker label:not(:has(select)){display:none!important}
.bn-unified-topbar .topbar-city-picker select{
  width:100%!important;height:36px!important;min-height:36px!important;
  margin:0!important;padding:0 9px!important;
  border:1px solid #dedee3!important;border-radius:13px!important;
  background:#fff!important;color:#222!important;
  font-size:11px!important;font-weight:700!important;outline:none!important
}
.bn-unified-topbar .topbar-city-picker select:disabled{opacity:1!important;color:#555!important}
.bn-unified-topbar .topbar-city-picker input[type=hidden],
.bn-unified-topbar .topbar-city-picker noscript,
.bn-unified-topbar .topbar-city-picker .workspace-city-label{display:none!important}
.bn-unified-topbar .topbar-solar{
  grid-column:1!important;grid-row:1!important;
  display:grid!important;grid-template-rows:10px 10px 12px!important;
  height:32px!important;gap:0!important;align-items:center!important;justify-items:end!important;
  font-size:9px!important;line-height:10px!important;color:#74747b!important
}
.bn-unified-topbar .topbar-solar i{font-style:normal!important}
.bn-unified-topbar .topbar-local-time{
  padding-left:0!important;border-left:0!important;
  font-size:11px!important;line-height:12px!important;font-weight:800!important;color:#171719!important;
  font-variant-numeric:tabular-nums!important
}
.bn-unified-topbar .topbar-local-time::before{content:"◷ "!important;font-weight:400!important;color:#74747b!important}

/* 2 — four menu buttons, exact SIFT dock */
.bn-unified-topbar>.bn-unified-nav{
  position:static!important;z-index:4!important;order:2!important;
  flex:0 1 430px!important;width:min(430px,42vw)!important;min-width:300px!important;min-height:64px!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:0!important;padding:5px!important;transform:none!important;
  border:1px solid rgba(215,215,222,.9)!important;border-radius:20px!important;
  background:rgba(255,255,255,.94)!important;
  box-shadow:0 12px 35px rgba(20,20,30,.18)!important;
  backdrop-filter:blur(22px)!important;white-space:nowrap!important
}
.bn-unified-topbar>.bn-unified-nav>a,
.bn-unified-topbar>.bn-unified-nav>button{
  display:grid!important;place-items:center!important;align-content:center!important;gap:3px!important;
  min-width:0!important;min-height:52px!important;width:auto!important;
  margin:0!important;padding:0!important;border:0!important;border-radius:15px!important;
  background:transparent!important;color:#777!important;text-decoration:none!important;box-shadow:none!important
}
.bn-unified-topbar>.bn-unified-nav>a>span,
.bn-unified-topbar>.bn-unified-nav>button>span,
.bn-unified-topbar>.bn-unified-nav>a>svg,
.bn-unified-topbar>.bn-unified-nav>button>svg{
  width:auto!important;height:21px!important;min-width:0!important;
  font-size:18px!important;line-height:20px!important;color:inherit!important
}
.bn-unified-topbar>.bn-unified-nav>a>b,
.bn-unified-topbar>.bn-unified-nav>button>b,
.bn-unified-topbar>.bn-unified-nav .nav-link>span:last-child{
  font-size:8px!important;font-weight:700!important;line-height:1.1!important;text-align:center!important;white-space:nowrap!important
}
.bn-unified-topbar>.bn-unified-nav .active{background:#fff0f1!important;color:#e0242e!important}
.bn-unified-topbar>.bn-unified-nav .dock-add>span,
.bn-unified-topbar>.bn-unified-nav .new-job>span{
  display:grid!important;place-items:center!important;width:30px!important;height:30px!important;
  border-radius:10px!important;background:#e0242e!important;color:#fff!important;font-size:24px!important;line-height:1!important
}

/* 3 — next publication, exact SIFT position and dimensions */
.bn-unified-topbar .topbar-publication{
  order:3!important;flex:0 1 320px!important;max-width:320px!important;margin-left:auto!important;
  min-width:0!important;display:grid!important;justify-items:center!important;align-content:center!important;
  gap:2px!important;text-align:center!important;line-height:1.15!important
}
.bn-unified-topbar .topbar-publication small{
  font-size:10px!important;font-weight:700!important;color:#74747b!important;
  text-transform:uppercase!important;letter-spacing:.08em!important
}
.bn-unified-topbar .topbar-publication b{
  max-width:100%!important;white-space:normal!important;font-size:13px!important;color:#171719!important
}
.bn-unified-topbar .topbar-publication span{
  max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  font-size:9px!important;color:#74747b!important
}

/* 4 — system key, exact SIFT keyboard key */
.bn-unified-topbar>.bn-system-switcher{
  order:4!important;position:relative!important;flex:0 0 44px!important;
  width:44px!important;max-width:44px!important;min-width:44px!important;perspective:900px!important
}
.bn-system-switcher>summary{
  position:relative!important;width:44px!important;height:44px!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) 7px!important;align-items:center!important;gap:1px!important;
  padding:4px 4px 5px!important;border:2px solid #666e78!important;border-bottom-color:#32373e!important;border-right-color:#3b4149!important;
  border-radius:10px!important;background:linear-gradient(180deg,#6f7680 0%,#5b626c 10%,#4a5059 45%,#3a4048 72%,#30353c 100%)!important;
  color:#fff!important;cursor:pointer!important;list-style:none!important;overflow:hidden!important;
  box-shadow:0 5px 0 #20242a,0 8px 14px rgba(10,14,20,.28),inset 0 1px 0 rgba(255,255,255,.34),inset 1px 0 0 rgba(255,255,255,.08),inset -1px 0 0 rgba(0,0,0,.28),inset 0 -2px 0 rgba(0,0,0,.34)!important;
  transform:translateY(0)!important;transition:transform .08s ease,box-shadow .08s ease,filter .12s ease!important
}
.bn-system-switcher>summary::before{content:""!important;position:absolute!important;inset:2px 5px auto!important;height:38%!important;border-radius:7px!important;background:linear-gradient(180deg,rgba(255,255,255,.20),rgba(255,255,255,.03))!important;pointer-events:none!important}
.bn-system-switcher>summary::after{content:""!important;position:absolute!important;inset:5px!important;border:1px solid rgba(255,255,255,.10)!important;border-radius:6px!important;pointer-events:none!important}
.bn-system-switcher>summary::-webkit-details-marker{display:none!important}
.bn-system-switcher>summary:hover{filter:brightness(1.06)!important}
.bn-system-switcher>summary:active{transform:translateY(4px)!important;box-shadow:0 1px 0 #20242a,0 3px 6px rgba(10,14,20,.24),inset 0 2px 4px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.08)!important}
.bn-system-title{position:relative!important;z-index:1!important;display:block!important;text-align:center!important;padding-left:6px!important;font-size:10px!important;line-height:1!important;font-weight:850!important;letter-spacing:.03em!important;color:#cfd5dc!important;text-shadow:0 -1px 0 rgba(255,255,255,.10),0 1px 0 rgba(0,0,0,.86),0 2px 2px rgba(0,0,0,.20)!important}
.bn-system-chevron{position:relative!important;z-index:1!important;justify-self:end!important;width:7px!important;height:7px!important;margin-right:0!important}
.bn-system-chevron::before{content:""!important;position:absolute!important;left:1px!important;top:1px!important;width:5px!important;height:5px!important;border-right:1.5px solid #cfd5dc!important;border-bottom:1.5px solid #cfd5dc!important;transform:rotate(45deg)!important;box-shadow:1px 1px 0 rgba(0,0,0,.62),-1px -1px 0 rgba(255,255,255,.05)!important;transition:transform .14s ease,top .14s ease!important}
.bn-system-switcher[open] .bn-system-chevron::before{transform:rotate(225deg)!important;top:3px!important}
.bn-system-menu{
  position:absolute!important;top:calc(100% + 8px)!important;right:0!important;z-index:100!important;width:240px!important;
  display:grid!important;gap:3px!important;padding:8px!important;border:1px solid #dfe5ec!important;border-radius:16px!important;
  background:#fff!important;box-shadow:0 20px 48px rgba(15,23,42,.18)!important
}
.bn-system-menu a{min-height:48px!important;display:grid!important;grid-template-columns:34px minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;align-items:center!important;column-gap:9px!important;padding:7px 9px!important;border-radius:11px!important;color:#334155!important;text-decoration:none!important;background:transparent!important}
.bn-system-menu a>span{grid-row:1/3!important;width:34px!important;height:34px!important;display:grid!important;place-items:center!important;border-radius:10px!important;background:#eef2f7!important;color:#475569!important;font-size:10px!important;font-weight:900!important}
.bn-system-menu a>b{align-self:end!important;font-size:11px!important;line-height:1.1!important}.bn-system-menu a>small{align-self:start!important;font-size:7px!important;line-height:1.1!important;color:#94a3b8!important}
.bn-system-menu a:hover,.bn-system-menu a.is-current{background:#f1f5f9!important;color:#111827!important}.bn-system-menu a.is-current>span{background:#172033!important;color:#fff!important}
.bn-system-menu a.is-current::after{content:"Actif"!important;grid-column:3!important;grid-row:1/3!important;align-self:center!important;padding:4px 6px!important;border-radius:999px!important;background:#e7f7ee!important;color:#17834b!important;font-size:7px!important;font-weight:800!important}

@media(max-width:1100px) and (min-width:761px){
  .bn-unified-topbar{gap:8px!important;padding-left:24px!important;padding-right:24px!important}
  .bn-unified-topbar>.bn-unified-nav{flex-basis:340px!important;width:min(340px,38vw)!important;min-width:270px!important}
  .bn-unified-topbar .topbar-publication{flex-basis:220px!important;max-width:220px!important}
}
@media(max-width:760px){
  .bn-unified-topbar{height:72px!important;min-height:72px!important;padding:0 8px!important;gap:5px!important}
  .bn-unified-topbar>.bn-unified-nav{display:none!important}
  .bn-unified-topbar .topbar-city{
    flex:0 1 auto!important;max-width:132px!important;margin-right:0!important;
    grid-template-columns:40px minmax(0,86px)!important;column-gap:4px!important
  }
  .bn-unified-topbar .topbar-city-picker select{
    height:34px!important;min-height:34px!important;padding:0 5px!important;font-size:10px!important;border-radius:10px!important
  }
  .bn-unified-topbar .topbar-solar{font-size:7px!important;line-height:8px!important;grid-template-rows:8px 8px 10px!important;height:26px!important}
  .bn-unified-topbar .topbar-local-time{font-size:9px!important;line-height:10px!important}

  .bn-unified-topbar .topbar-publication{
    display:grid!important;flex:1 1 72px!important;max-width:none!important;min-width:56px!important;
    margin-left:0!important;gap:0!important;line-height:1.02!important
  }
  .bn-unified-topbar .topbar-publication small{
    font-size:6px!important;line-height:7px!important;letter-spacing:.02em!important;white-space:nowrap!important
  }
  .bn-unified-topbar .topbar-publication b{
    font-size:9px!important;line-height:10px!important;white-space:nowrap!important
  }
  .bn-unified-topbar .topbar-publication span{
    font-size:6px!important;line-height:7px!important;white-space:nowrap!important;max-width:100%!important
  }

  .bn-unified-topbar>.bn-system-switcher{
    flex:0 0 40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;margin-left:0!important
  }
  .bn-system-switcher>summary{
    width:40px!important;height:40px!important;grid-template-columns:minmax(0,1fr) 6px!important;
    gap:1px!important;padding:4px 3px!important;border-radius:9px!important
  }
  .bn-system-title{padding-left:1px!important;font-size:8px!important;letter-spacing:0!important}
  .bn-system-chevron{width:6px!important;height:6px!important}
  .bn-system-chevron::before{width:4px!important;height:4px!important;border-right-width:1.5px!important;border-bottom-width:1.5px!important}
  .bn-system-menu{width:210px!important}
}

.bn-preserved-controls[hidden]{display:none!important}

/* =========================================================
   BY NIGHT UNIFIED SHELL
   The shared topbar is the only desktop chrome.
   Legacy sidebars/brands remain in DOM only when app JS needs them.
   ========================================================= */

/* Legacy sidebars / logos / old global menus */
.app-body > .sidebar,
.app-shell > .sidebar,
#workspace > .sidebar,
#shell > .sidebar,
#shell > aside {
  display:none!important;
}

/* Nothing is allowed above the shared topbar inside authenticated workspaces */
.by-night-roles {
  display:none!important;
}

/* Old SIFT drawer mechanics are obsolete when the unified topbar is active */
.app-body > .menu-backdrop,
.bn-unified-topbar > .mobile-menu {
  display:none!important;
}

/* All application canvases start at x=0, directly below the shared topbar */
.app-body > .main,
.app-shell > .main,
#workspace > main,
#shell > main,
#shell > .workspace {
  margin-left:0!important;
  width:100%!important;
  max-width:none!important;
}

#workspace,
#shell {
  grid-template-columns:1fr!important;
}

/* Radar previously reserved space for its former fixed mobile header */
.app-shell > .main {
  padding-top:0!important;
}

/* Prevent stale menu-open states from shifting/locking the page */
body.menu-open {
  overflow:auto!important;
}

/* Keep only content-local navigation below the bar; never resurrect legacy global chrome */
.bn-preserved-controls,
.bn-preserved-controls[hidden] {
  display:none!important;
}

@media(min-width:761px){
  .app-body > .main,
  .app-shell > .main,
  #workspace > main,
  #shell > main,
  #shell > .workspace {
    margin-left:0!important;
    width:100%!important;
  }
}

/* Make the shared bar span exactly the same visual width as SIFT,
   even when legacy app containers keep padding for their page content. */
body > main.main > .bn-unified-topbar {
  margin-left:-24px!important;
  margin-right:-24px!important;
  width:calc(100% + 48px)!important;
  max-width:none!important;
}
.app-shell > main.main > .bn-unified-topbar {
  margin-left:-42px!important;
  margin-right:-42px!important;
  width:calc(100% + 84px)!important;
  max-width:none!important;
}

@media(max-width:760px){
  body > main.main > .bn-unified-topbar {
    margin-left:-13px!important;
    margin-right:-13px!important;
    width:calc(100% + 26px)!important;
  }
  .app-shell > main.main > .bn-unified-topbar {
    margin-left:-14px!important;
    margin-right:-14px!important;
    width:calc(100% + 28px)!important;
  }
}
@media(max-width:380px){
  body > main.main > .bn-unified-topbar {
    margin-left:-9px!important;
    margin-right:-9px!important;
    width:calc(100% + 18px)!important;
  }
}


/* BY NIGHT SHARED TOPBAR V2 — geometry lock */
.bn-unified-topbar,
.bn-unified-topbar *{box-sizing:border-box}
.bn-unified-topbar{
  width:100%!important;max-width:none!important;
  flex-wrap:nowrap!important;overflow:visible!important;
  contain:layout style!important;
  isolation:isolate!important
}
.bn-unified-topbar>.topbar-live{min-width:0!important}
.bn-unified-topbar>.bn-unified-nav{align-self:center!important}
.bn-unified-topbar>.bn-system-switcher{align-self:center!important}
.bn-unified-topbar .bn-unified-left,
.bn-unified-topbar .bn-unified-right,
.bn-unified-topbar .bn-unified-context,
.bn-unified-topbar .bn-unified-status,
.bn-unified-topbar .private-pill,
.bn-unified-topbar .phase,
.bn-unified-topbar #mobile-logout,
.bn-unified-topbar #refresh{display:none!important}

/* The application owns content; the shell alone owns global chrome. */
.bn-unified-topbar{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important}
.bn-unified-topbar button,.bn-unified-topbar select{font-family:inherit!important}

/* Keyboard/focus quality */
.bn-unified-topbar a:focus-visible,
.bn-unified-topbar button:focus-visible,
.bn-unified-topbar select:focus-visible,
.bn-system-switcher>summary:focus-visible{
  outline:2px solid #e0242e!important;outline-offset:2px!important
}
.bn-system-menu a{transition:background-color .12s ease,color .12s ease,transform .12s ease!important}
.bn-system-menu a:hover{transform:translateX(2px)!important}

/* Keep the shell visually stable while destination content paints. */
@media(prefers-reduced-motion:no-preference){
  .bn-unified-topbar{transition:none!important}
  .bn-system-menu{animation:bnMenuIn .12s ease-out}
}
@keyframes bnMenuIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}


/* BY NIGHT SHARED TOPBAR V2.1 — polish */
:root{
  --bn-shell-h:72px;
  --bn-shell-radius:20px;
  --bn-shell-red:#e0242e;
  --bn-shell-bg:rgba(246,247,249,.92);
}
.bn-unified-topbar{
  height:var(--bn-shell-h)!important;
  min-height:var(--bn-shell-h)!important;
  background:var(--bn-shell-bg)!important;
  -webkit-backdrop-filter:blur(18px) saturate(1.08)!important;
  backdrop-filter:blur(18px) saturate(1.08)!important;
  transform:translateZ(0)!important;
  backface-visibility:hidden!important;
}
.bn-unified-topbar>.bn-unified-nav{
  border-radius:var(--bn-shell-radius)!important;
  box-shadow:0 9px 28px rgba(20,20,30,.13),0 1px 2px rgba(20,20,30,.06)!important;
}
.bn-unified-topbar>.bn-unified-nav>a,
.bn-unified-topbar>.bn-unified-nav>button{
  transition:background-color .12s ease,color .12s ease,transform .08s ease!important;
}
.bn-unified-topbar>.bn-unified-nav>a:hover,
.bn-unified-topbar>.bn-unified-nav>button:hover{
  background:rgba(17,24,39,.035)!important;
}
.bn-unified-topbar>.bn-unified-nav>a:active,
.bn-unified-topbar>.bn-unified-nav>button:active{transform:scale(.985)!important}
.bn-unified-topbar>.bn-unified-nav .active:hover{
  background:#fff0f1!important;color:var(--bn-shell-red)!important
}
.bn-system-switcher[open]>summary{
  filter:brightness(1.08)!important;
  box-shadow:0 3px 0 #20242a,0 6px 12px rgba(10,14,20,.23),inset 0 1px 0 rgba(255,255,255,.3)!important;
}
.bn-system-menu{
  transform-origin:top right!important;
  max-height:min(520px,calc(100vh - 96px))!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-width:thin!important;
}
.bn-system-menu a[aria-current="page"]{background:#f1f5f9!important;color:#111827!important}
.bn-system-menu a[aria-current="page"]>span{background:#172033!important;color:#fff!important}
.bn-unified-topbar.bn-shell-switching::after{
  content:""!important;position:absolute!important;left:0!important;right:0!important;bottom:-1px!important;
  height:2px!important;background:var(--bn-shell-red)!important;
  transform-origin:left center!important;animation:bnShellProgress .55s ease-out forwards!important;
}
@keyframes bnShellProgress{from{transform:scaleX(.08);opacity:.55}to{transform:scaleX(.82);opacity:1}}
@media(max-width:760px){
  :root{--bn-shell-h:72px}
  .bn-system-menu{
    position:fixed!important;top:76px!important;right:8px!important;
    width:min(280px,calc(100vw - 16px))!important;
    max-height:calc(100vh - 88px)!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .bn-unified-topbar *,
  .bn-unified-topbar *::before,
  .bn-unified-topbar *::after{animation-duration:.001ms!important;transition-duration:.001ms!important}
}


/* BY NIGHT SHARED TOPBAR V3 — master viewport grid
   One geometry for every By Night system, independent from app containers. */
.bn-unified-topbar{
  display:grid!important;
  grid-template-columns:220px 430px minmax(150px,1fr) 44px!important;
  grid-template-rows:72px!important;
  align-items:center!important;
  column-gap:14px!important;
  row-gap:0!important;
  width:100vw!important;
  max-width:100vw!important;
  min-width:0!important;
  margin-left:calc(50% - 50vw)!important;
  margin-right:calc(50% - 50vw)!important;
  padding:0 clamp(20px,3vw,46px)!important;
}
.bn-unified-topbar>.topbar-live{display:contents!important}
.bn-unified-topbar .topbar-city{
  grid-column:1!important;grid-row:1!important;
  width:220px!important;max-width:220px!important;min-width:220px!important;
  margin:0!important;
  grid-template-columns:70px minmax(0,1fr)!important;
  column-gap:8px!important;
}
.bn-unified-topbar .topbar-city-picker{
  width:100%!important;min-width:0!important;max-width:none!important
}
.bn-unified-topbar .topbar-city-picker select{
  width:100%!important;max-width:none!important;
  height:36px!important;min-height:36px!important
}
.bn-unified-topbar .topbar-solar{
  width:70px!important;min-width:70px!important;max-width:70px!important;
  justify-items:end!important
}
.bn-unified-topbar>.bn-unified-nav{
  grid-column:2!important;grid-row:1!important;
  width:430px!important;min-width:430px!important;max-width:430px!important;
  height:64px!important;min-height:64px!important;max-height:64px!important;
  margin:0!important;justify-self:start!important;
  grid-template-columns:repeat(4,1fr)!important
}
.bn-unified-topbar>.bn-unified-nav>*{
  min-width:0!important;width:100%!important;max-width:none!important;
  height:52px!important;min-height:52px!important;max-height:52px!important
}
.bn-unified-topbar>.bn-unified-nav>.bn-nav-placeholder{
  visibility:hidden!important;pointer-events:none!important
}
.bn-unified-topbar .topbar-publication{
  grid-column:3!important;grid-row:1!important;
  width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:0 10px!important;
  justify-self:stretch!important
}
.bn-unified-topbar>.bn-system-switcher{
  grid-column:4!important;grid-row:1!important;
  width:44px!important;min-width:44px!important;max-width:44px!important;
  margin:0!important;justify-self:end!important
}
.bn-system-switcher>summary{
  width:44px!important;min-width:44px!important;max-width:44px!important;
  height:44px!important;min-height:44px!important;max-height:44px!important
}
.bn-system-menu{
  right:0!important;left:auto!important;
  width:240px!important;min-width:240px!important;max-width:240px!important
}

/* Tablet: same master proportions on every system. */
@media(max-width:1180px) and (min-width:761px){
  .bn-unified-topbar{
    grid-template-columns:180px 340px minmax(90px,1fr) 44px!important;
    column-gap:8px!important;padding:0 16px!important
  }
  .bn-unified-topbar .topbar-city{
    width:168px!important;min-width:168px!important;max-width:168px!important;
    grid-template-columns:62px minmax(0,1fr)!important;column-gap:6px!important
  }
  .bn-unified-topbar .topbar-solar{
    width:62px!important;min-width:62px!important;max-width:62px!important
  }
  .bn-unified-topbar>.bn-unified-nav{
    width:340px!important;min-width:340px!important;max-width:340px!important
  }
}

/* Mobile: city | status | system key. Navigation remains the common bottom/local dock. */
@media(max-width:760px){
  .bn-unified-topbar{
    grid-template-columns:132px minmax(56px,1fr) 40px!important;
    grid-template-rows:72px!important;
    column-gap:5px!important;
    width:100vw!important;max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    padding:0 8px!important
  }
  .bn-unified-topbar>.bn-unified-nav{display:none!important}
  .bn-unified-topbar .topbar-city{
    grid-column:1!important;grid-row:1!important;
    width:132px!important;min-width:132px!important;max-width:132px!important;
    grid-template-columns:40px minmax(0,86px)!important;column-gap:4px!important
  }
  .bn-unified-topbar .topbar-solar{
    width:40px!important;min-width:40px!important;max-width:40px!important
  }
  .bn-unified-topbar .topbar-publication{
    grid-column:2!important;grid-row:1!important;padding:0 2px!important
  }
  .bn-unified-topbar>.bn-system-switcher{
    grid-column:3!important;grid-row:1!important;
    width:40px!important;min-width:40px!important;max-width:40px!important
  }
  .bn-system-switcher>summary{
    width:40px!important;min-width:40px!important;max-width:40px!important;
    height:40px!important;min-height:40px!important;max-height:40px!important
  }
}

/* Very narrow phones keep the same three anchors. */
@media(max-width:380px){
  .bn-unified-topbar{
    grid-template-columns:124px minmax(48px,1fr) 40px!important;
    padding-left:6px!important;padding-right:6px!important;column-gap:4px!important
  }
  .bn-unified-topbar .topbar-city{
    width:124px!important;min-width:124px!important;max-width:124px!important;
    grid-template-columns:38px minmax(0,82px)!important
  }
  .bn-unified-topbar .topbar-solar{
    width:38px!important;min-width:38px!important;max-width:38px!important
  }
}

/* BY NIGHT — system selector width x2 */
.bn-unified-topbar>.bn-system-switcher{
  flex:0 0 75px!important;
  width:75px!important;
  min-width:75px!important;
  max-width:75px!important;
}
.bn-system-switcher>summary{
  width:75px!important;
  min-width:75px!important;
  max-width:75px!important;
}
.bn-unified-topbar{
  grid-template-columns:220px 430px minmax(150px,1fr) 75px!important;
}

@media(max-width:1180px) and (min-width:761px){
  .bn-unified-topbar{
    grid-template-columns:180px 340px minmax(90px,1fr) 75px!important;
  }
  .bn-unified-topbar>.bn-system-switcher,
  .bn-system-switcher>summary{
    width:75px!important;
    min-width:75px!important;
    max-width:75px!important;
  }
}

@media(max-width:760px){
  .bn-unified-topbar{
    grid-template-columns:132px minmax(56px,1fr) 68px!important;
  }
  .bn-unified-topbar>.bn-system-switcher,
  .bn-system-switcher>summary{
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
  }
}

/* Legacy containers must share the viewport width without a horizontal overhang. */
body > main.main > .bn-unified-topbar,
.app-shell > main.main > .bn-unified-topbar {
 width:100vw!important;max-width:100vw!important;
 margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;
}

/* ByNight work library — all styles scoped to avoid changing host applications. */
.bn-system-menu .bn-knowledge-launch{display:block;width:100%;grid-column:1/-1;border:1px solid #cbd5d1;border-radius:10px;background:#edf3ef;color:#193f32;padding:12px;font:600 13px/1.3 system-ui,sans-serif;cursor:pointer;text-align:center;margin-top:5px}
.bn-k-dialog{box-sizing:border-box;width:min(1120px,calc(100vw - 32px));max-width:1120px;height:min(880px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid #d9dfdb;border-radius:20px;background:#f7f8f5;color:#24342d;box-shadow:0 24px 90px #11271f33;font:14px/1.55 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color-scheme:light;overflow:auto;overscroll-behavior:contain}
.bn-k-dialog::backdrop{background:#12251dc2}
.bn-k-dialog *{box-sizing:border-box}
.bn-k-dialog :is(h2,h3,p){margin:0}
.bn-k-dialog button,.bn-k-dialog input,.bn-k-dialog select,.bn-k-dialog textarea{font:inherit;letter-spacing:normal;text-transform:none}
.bn-k-dialog :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #477c65;outline-offset:3px}
.bn-k-dialog :is(button,a){touch-action:manipulation}
.bn-k-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:26px 28px 20px;border-bottom:1px solid #dde3dc;background:#fff}
.bn-k-header h2{font-size:clamp(22px,3vw,30px);line-height:1.2;font-weight:650;color:#1e3027;letter-spacing:-.6px;margin:5px 0 8px}
.bn-k-header p:not(.bn-k-eyebrow){color:#59675e;max-width:650px}
.bn-k-eyebrow{font-size:10px!important;font-weight:700;letter-spacing:1.6px;text-transform:uppercase;color:#556d60}
.bn-k-tools{display:grid;grid-template-columns:minmax(220px,2fr) minmax(150px,1fr) minmax(150px,1fr) auto;gap:12px;padding:20px 28px 8px;align-items:end}
.bn-k-field{display:flex;flex-direction:column;gap:6px;min-width:0;font-weight:550;font-size:12px;color:#485e50}
.bn-k-field :is(input,select,textarea){width:100%;min-width:0;border:1px solid #cdd6ce;border-radius:9px;background:#fff;color:#24342d;padding:10px 12px;box-shadow:none;font-size:14px;line-height:1.4;height:auto;margin:0}
.bn-k-field textarea{resize:vertical;min-height:64px;max-height:260px}
.bn-k-favorite-filter{display:flex;align-items:center;gap:8px;min-height:42px;white-space:nowrap;font-size:12px}
.bn-k-dialog input[type=checkbox]{width:17px;height:17px;min-width:17px;accent-color:#265f45;margin:2px 0;padding:0}
.bn-k-count{padding:6px 28px 12px;font-size:12px;color:#647366}
.bn-k-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:18px;padding:0 28px 22px;align-items:start}
.bn-k-results{display:flex;flex-direction:column;gap:9px;max-height:570px;overflow:auto;padding:3px}
.bn-k-card{display:flex;flex-direction:column;gap:5px;width:100%;background:#fff;border:1px solid #dce2da;border-radius:12px;color:#3d5044;padding:14px;text-align:left;cursor:pointer;white-space:normal;box-shadow:none;line-height:1.5}
.bn-k-card strong{font-size:14px;font-weight:650;color:#243d2e}
.bn-k-card>span:last-child{font-size:12px;color:#607064}
.bn-k-card[aria-pressed=true]{border-color:#47775b;background:#eef4ee;box-shadow:inset 3px 0 #47775b}
.bn-k-card:hover{border-color:#799583}
.bn-k-tag{font-size:10px;font-weight:650;color:#59745f;text-transform:uppercase;letter-spacing:.5px}
.bn-k-detail{min-width:0;background:#fff;padding:22px;border:1px solid #dce2da;border-radius:14px;overflow-wrap:anywhere}
.bn-k-detail-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.bn-k-detail h3{font-size:22px;line-height:1.3;letter-spacing:-.3px;font-weight:650;color:#203c2b}
.bn-k-lead{margin:9px 0 16px!important;color:#5b6a60}
.bn-k-progress{font-size:12px;font-weight:650;color:#466a53;margin:16px 0 10px!important}
.bn-k-steps{padding:0;margin:0 0 20px;list-style:none;display:flex;flex-direction:column;gap:10px}
.bn-k-steps label{display:flex;align-items:flex-start;gap:10px;font-weight:400;color:#334d3c;cursor:pointer}
.bn-k-callout{padding:14px 16px;background:#f4f5ee;border-left:3px solid #94a178;border-radius:0 9px 9px 0;font-size:13px}
.bn-k-callout p{margin-top:7px;color:#58634e}
.bn-k-template{margin-top:18px;border-top:1px solid #e0e6dd;padding-top:14px}
.bn-k-template summary{cursor:pointer;color:#28543a;font-weight:650;padding:4px 0}
.bn-k-template>p{font-size:12px;color:#687362;margin:10px 0 14px}
.bn-k-template .bn-k-field{margin-top:12px}
.bn-k-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:20px}
.bn-k-dialog .bn-k-primary,.bn-k-dialog .bn-k-secondary{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbd6cc;border-radius:9px;padding:9px 13px;background:#fff;color:#30533c;font-size:12px;font-weight:600;line-height:1.4;cursor:pointer;min-height:38px;box-shadow:none;white-space:normal}
.bn-k-dialog .bn-k-primary{background:#295b40;border-color:#295b40;color:white}
.bn-k-dialog .bn-k-native{font-size:12px;color:#28543a;text-decoration:underline;text-underline-offset:3px;padding:8px 0}
.bn-k-caption{margin-top:12px!important;font-size:11px;color:#6b776d}
.bn-k-footer{border-top:1px solid #dce2da;padding:14px 28px;color:#627262;font-size:11px;background:#f0f3ed}
.bn-k-notice:not(:empty){margin-top:8px;font-size:12px;font-weight:600;color:#28543a}
@media(max-width:760px){.bn-k-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:14px}.bn-k-header{padding:18px 16px;gap:12px}.bn-k-header h2{font-size:23px}.bn-k-header>button{flex-shrink:0}.bn-k-tools{grid-template-columns:1fr 1fr;padding:16px 16px 6px}.bn-k-tools>.bn-k-field:first-child{grid-column:1/-1}.bn-k-favorite-filter{grid-column:1/-1;min-height:28px}.bn-k-count{padding:6px 16px 10px}.bn-k-layout{grid-template-columns:1fr;padding:0 13px 16px;gap:14px}.bn-k-results{max-height:210px}.bn-k-card{padding:11px 13px}.bn-k-detail{padding:17px}.bn-k-detail h3{font-size:21px}.bn-k-detail-top{align-items:flex-start}.bn-k-footer{padding:13px 16px}}
@media(prefers-reduced-motion:reduce){.bn-k-dialog,.bn-k-dialog *{scroll-behavior:auto!important;transition:none!important}}
