/* BA Frame CSS (shell-only) v1.1
   Scope: header, sidebar, stage, footer, breakpoints, modal scaffolding.
   No feature skins. No calculator/tool styling.
*/

:root{
  /* Canonical header height */
  --ba-header-h: 64px;

  /* Sidebar widths */
  --ba-sidebar-w: 280px;
  --ba-sidebar-w-collapsed: 0px;

  /* Shell surfaces */
  --ba-shell-header-bg: #001f2d;
  --ba-shell-sidebar-bg: #001820;
  --ba-shell-border: rgba(255,255,255,0.10);

  /* Accent (hover/active only) */
  --ba-brand-hi: #FF7F00;

  /* Modal tokens */
  --ba-modal-z: 6500;
  --ba-modal-backdrop: rgba(0,0,0,0.66);
  --ba-modal-card-bg: rgba(8, 16, 20, 0.96);
  --ba-modal-border: rgba(255,255,255,0.14);
}

/* Body as a 3-row grid: header | layout | footer */
body{
  display: grid;
  grid-template-rows: var(--ba-header-h) 1fr auto;
  height: 100vh;     /* lock grid to viewport */
  min-height: 0;     /* allow 1fr row to shrink */
}

/* ---------------- Header ---------------- */
.ba-shell-header{
  height: var(--ba-header-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 16px;
  background: var(--ba-shell-header-bg);
  border-bottom: 1px solid var(--ba-shell-border);
  font-size: 13px;
}
/* Shell sidebar links must look identical to span-based menu rows */
.ba-shell-menu-link{
  display: block;
  width: 100%;

  /* normalize anchor defaults */
  font: inherit;
  font-size: 12.5px;     /* match .ba-shell-menu-item span */
  line-height: 1.15;     /* match .ba-shell-menu-item span */
  color: inherit;
  text-decoration: none;

  /* match the span left inset so the active rail spacing stays consistent */
  padding-left: 10px;
}

.ba-shell-menu-link:hover,
.ba-shell-menu-link:focus{
  text-decoration: none;
}

.ba-shell-header-left{
  display:flex;
  align-items:center;
  gap: 10px;
}
/* BEGIN PATCH: BA.Shell.OnlineStatus.CSS v1.0 */
.ba-shell-status{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.90;
}

.ba-shell-status-label{ opacity: 0.80; }

.ba-shell-status-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25); /* neutral while checking */
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25) inset;
}

.ba-shell-status-dot.is-online{ background: rgba(60, 214, 120, 0.95); }
.ba-shell-status-dot.is-offline{ background: rgba(235, 80, 80, 0.95); }

.ba-shell-status-state{ opacity: 0.85; }
/* END PATCH: BA.Shell.OnlineStatus.CSS v1.0 */

.ba-shell-brand-logo{
  height: 34px;
  width: auto;
  display:block;
}

.ba-shell-header-right{
  display:flex;
  align-items:center;
  gap: 12px;
}

.ba-shell-header-titles{
  display:flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: right;
}

.ba-shell-header-title{
  font-weight: 700;
}

.ba-shell-header-subtitle{
  opacity: 0.75;
  font-size: 12px;
}

/* Menu toggle button */
#ba-shell-menu-toggle{
  width: 40px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--ba-text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; /* slight rounding, not pill */
  cursor: pointer;
}

#ba-shell-menu-toggle:hover{
  background: rgba(255,127,0,0.08);
  border-color: rgba(255,127,0,0.45);
  color: var(--ba-brand-hi);
}

#ba-shell-menu-toggle:focus-visible{
  outline: 2px solid rgba(255,127,0,0.55);
  outline-offset: 2px;
}

/* ---------------- Layout row (sidebar + stage) ---------------- */
/* BEGIN PATCH: Shell.Desktop.MainWidthGuard v1.0
   Purpose: prevent desktop blanking when nav toggles by ensuring main column can shrink (minmax(0,1fr) + min-width:0)
*/

/* ---------------- Layout row (sidebar + stage) ---------------- */
.ba-shell-layout{
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: var(--ba-sidebar-w) minmax(0, 1fr);
}

/* BEGIN PATCH: Shell.Desktop.LayoutRow.HeightLock v1.0
   Purpose: prevent stage paint/click collapse on desktop when nav toggles
*/
@media (min-width: 901px){
  .ba-shell-layout{
    height: 100%;     /* fill the body’s 1fr row */
    min-height: 0;    /* allow internal scroll */
  }
}

/* END PATCH: Shell.Desktop.LayoutRow.HeightLock v1.0 */


/* Stage */
.ba-shell-main{
  min-height: 0;
  min-width: 0;              /* CRITICAL: prevents 1fr column from collapsing/blanking */
  overflow: auto;            /* Stage scroll */
  background: var(--ba-bg);

  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ba-shell-main::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* ---------------- Desktop sidebar closed (slide, stage expands) ---------------- */
/* BEGIN PATCH: Shell.Desktop.NavToggle.SingleSource v1.0
   Purpose: single, desktop-only toggle behavior.
   Fixes: layout shifting when viewport crosses responsive breakpoints.
*/

@media (min-width: 901px){

  /* Sidebar slides off-canvas (no display:none to avoid paint blanking) */
  .ba-shell-sidebar{
    will-change: transform;
    transition: transform 180ms ease;
  }

  body.ba-shell-nav-closed .ba-shell-sidebar{
    transform: translateX(-105%);
    width: 0;
    min-width: 0;
    padding: 0;
    border-right: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
  }

  /* Collapse the grid column on desktop only (no negative margin tricks) */
  body.ba-shell-nav-closed .ba-shell-layout{
    grid-template-columns: 0px minmax(0, 1fr);
  }

  /* Keep stage stable */
  .ba-shell-main{
    transition: none;
    margin-left: 0 !important;
    min-width: 0;
  }
}
/* END PATCH: Shell.Desktop.NavToggle.SingleSource v1.0 */


/* Sidebar */
.ba-shell-sidebar{
  min-height: 0;
  background: var(--ba-shell-sidebar-bg);
  border-right: 1px solid var(--ba-shell-border);
  overflow: hidden;          /* inner handles scroll */
  position: relative;
}

.ba-shell-sidebar-inner{
  height: 100%;
  overflow-y: auto;
  padding: 12px 12px 14px;

  /* Hide scrollbar but keep scroll */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}
.ba-shell-sidebar-inner::-webkit-scrollbar{
  width: 0;
  height: 0;
}

.ba-shell-sidebar-hr{
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 12px 0;
}

/* Optional weather card */
.ba-weather{
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 10px 12px;
  background: rgba(255,255,255,0.04);
}
.ba-weather-line1{ font-weight: 700; }
.ba-weather-line2,
.ba-weather-line3,
.ba-weather-tip{ opacity: 0.85; font-size: 12px; margin-top: 4px; }

/* Menu list label */
.ba-shell-menu-label{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.70;
  margin: 0 0 8px;
}

/* ---------------- Sidebar menu (EX1 compact mode) ---------------- */
.ba-shell-menu-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* terminal-style rows (no pill cards) */
.ba-shell-menu-item{
  position: relative;
  display: flex;
  align-items: center;

  padding: 7px 10px;
  border-radius: 8px;

  cursor: pointer;
  user-select: none;

  color: rgba(219,228,232,0.88);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.ba-shell-menu-item span{
  padding-left: 10px; /* space for left rail on active */
  font-size: 12.5px;
  line-height: 1.15;
}

.ba-shell-menu-item:hover{
  background: rgba(255,127,0,0.06);
  border-color: rgba(255,127,0,0.25);
  color: var(--ba-brand-hi);
}

/* Active state: left rail + subtle highlight */
.ba-shell-menu-item--active{
  background: rgba(255,127,0,0.08);
  border-color: rgba(255,127,0,0.30);
  color: var(--ba-brand-hi);
}

.ba-shell-menu-item--active::before{
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--ba-brand-hi);
  opacity: 0.95;
}

/* Keyboard focus */
.ba-shell-menu-item:focus-visible{
  outline: 2px solid rgba(255,127,0,0.45);
  outline-offset: 2px;
}

/* Optional footnote */
.ba-shell-menu-footnote{
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.72;
  line-height: 1.35;
}


.ba-shell-main-inner{
  min-height: 100%;
  padding: 16px;
}

/* Footer */
.ba-shell-footer{
  border-top: 1px solid var(--ba-shell-border);
  padding: 10px 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.85;
  background: rgba(0,0,0,0.12);
}



/* ---------------- Mobile overlay mode ---------------- */
.ba-shell-sidebar-backdrop{
  display: none;
}

@media (max-width: 900px){
.ba-shell-layout{
  grid-template-columns: 1fr;
}

.ba-shell-sidebar{
  position: fixed;
  top: var(--ba-header-h);
  left: 0;
  height: calc(100vh - var(--ba-header-h));
  width: min(var(--ba-sidebar-w), 86vw);
  z-index: 5000;
  transform: translateX(-105%);
  transition: transform 180ms ease;
  display: block;
}

.ba-shell-sidebar-backdrop{
  position: fixed;
  top: var(--ba-header-h);
  left: 0;
  height: calc(100vh - var(--ba-header-h));
  width: 100vw;
  background: rgba(0,0,0,0.55);
  z-index: 4900;
  display: none;
}

  .ba-shell-sidebar{
  transform: translateX(-105%);
}

.ba-shell-sidebar.ba-shell-sidebar--open{
  transform: translateX(0%);
}

.ba-shell-sidebar-backdrop{
  display: none;
}

.ba-shell-sidebar-backdrop.ba-shell-sidebar-backdrop--visible{
  display: block;
}

/* BEGIN PATCH: Shell.Mobile.HomeStack v0.1 */
.ba-skin-home-grid{
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

.ba-skin-home-media{
  max-width: none;
  width: 100%;
  margin: 0;
}
/* END PATCH: Shell.Mobile.HomeStack v0.1 */

/* BEGIN PATCH: Shell.Mobile.FooterClearance v0.1 */
.ba-shell-main{
  padding-bottom: 90px; /* gives breathing room above footer */
}
} /*closing @media */

/* END PATCH: Shell.Mobile.FooterClearance v0.1 */





/* ---------------- Helpers Panel Host (disabled for now) ---------------- */
#ba-helpers-panel{ display:none !important; }

/* ---------------- Modal scaffolding (Helpers overlay) ---------------- */

/* Scroll lock helper class used by modals */
body.ba-modal-lock{
  overflow: hidden !important;
}

.ba-modal{
  position: fixed;
  inset: 0;
  z-index: var(--ba-modal-z);
}

/* Respect existing aria-hidden toggle */
.ba-modal[aria-hidden="true"]{
  display: none;
}
.ba-modal[aria-hidden="false"]{
  display: block;
}

.ba-modal-backdrop{
  position: absolute;
  inset: 0;
  background: var(--ba-modal-backdrop);
}

/* Card */
.ba-modal-card{
  position: absolute;
  left: 50%;
  top: calc(var(--ba-header-h) + 18px);
  transform: translateX(-50%);

  width: min(1120px, calc(100vw - 28px));
  height: min(760px, calc(100vh - var(--ba-header-h) - 36px));

  background: var(--ba-modal-card-bg);
  border: 1px solid var(--ba-modal-border);
  border-radius: 14px;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  box-shadow: 0 14px 38px rgba(0,0,0,0.55);
}

.ba-modal-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.ba-modal-title{
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.ba-modal-close{
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  color: var(--ba-text);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.ba-modal-close:hover{
  background: rgba(255,127,0,0.08);
  border-color: rgba(255,127,0,0.45);
  color: var(--ba-brand-hi);
}
.ba-modal-close:focus-visible{
  outline: 2px solid rgba(255,127,0,0.55);
  outline-offset: 2px;
}

/* Body is an iframe host */
.ba-modal-body{
  position: relative;
  flex: 1;
  min-height: 0;
  background: rgba(255,255,255,0.02);
}

/* If your JS injects an iframe, it will fill properly */
.ba-modal-body iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Mobile modal sizing */
@media (max-width: 900px) and (hover: none) and (pointer: coarse){
  .ba-modal-card{
    top: calc(var(--ba-header-h) + 12px);
    width: calc(100vw - 18px);
    height: calc(100vh - var(--ba-header-h) - 24px);
    border-radius: 12px;
  }
}
/* BEGIN BLOCK: BA.Helpers.Modal.PolishCSS v1.0 */

/* Split layout inside #ba-modal-body */
#ba-helpers-layout{
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100%;
}

/* Left column */
.ba-helpers-left{
  border-right: 1px solid rgba(255,255,255,0.10);
  padding: 12px;
  overflow: auto;
  min-height: 0;

  /* hide scrollbar but keep scrolling */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ba-helpers-left::-webkit-scrollbar{ width:0; height:0; }

.ba-helpers-hint{
  opacity: 0.80;
  font-size: 12px;
  margin-bottom: 10px;
}

#ba-helpers-list{
  display: grid;
  gap: 8px;
}

/* Helper rows */
.ba-helpers-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 10px;
  border-radius: 12px;

  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);

  cursor: pointer;
  user-select: none;
}

.ba-helpers-item:hover{
  border-color: rgba(255,127,0,0.45);
}

.ba-helpers-item.is-active{
  border-color: rgba(255,127,0,0.75);
  box-shadow: 0 0 0 1px rgba(255,127,0,0.20) inset;
}

.ba-helpers-item-name{
  font-size: 13px;
}

.ba-helpers-item-tag{
  font-size: 11px;
  opacity: 0.75;
  white-space: nowrap;
}

/* Right column */
.ba-helpers-right{
  position: relative;
  min-height: 0;
}

#ba-helpers-empty{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.75;
  text-align: center;
  padding: 16px;
}

#ba-helpers-iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
}

#ba-helpers-iframe.is-visible{
  display: block;
}

/* Mobile stack */
@media (max-width: 820px){
  #ba-helpers-layout{
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
  }
  .ba-helpers-left{
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.10);
  }
}

/* END BLOCK: BA.Helpers.Modal.PolishCSS v1.0 */
/* BEGIN BLOCK: BA.Helpers.Modal.ScrollbarSleek v1.0
   Scope: modal-only scrollbars (keeps sidebar/stage rules unchanged)
*/
.ba-modal-card *{
  scrollbar-width: thin;                         /* Firefox */
  scrollbar-color: rgba(255,127,0,0.55) transparent;
}

/* WebKit (Chrome/Edge/Safari) */
.ba-modal-card *::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}

.ba-modal-card *::-webkit-scrollbar-track{
  background: transparent;
}

.ba-modal-card *::-webkit-scrollbar-thumb{
  background: rgba(255,127,0,0.28);
  border-radius: 999px;
  border: 3px solid rgba(0,0,0,0.35);            /* creates a slim “pill” thumb */
}

.ba-modal-card *::-webkit-scrollbar-thumb:hover{
  background: rgba(255,127,0,0.45);
}

.ba-modal-card *::-webkit-scrollbar-corner{
  background: transparent;
}
/* END BLOCK: BA.Helpers.Modal.ScrollbarSleek v1.0 */
/* BEGIN BLOCK: BA.Helpers.Modal.ScrollbarSleek.Override v1.0
   Purpose: override earlier "hide scrollbar" rules inside Helpers modal panes
*/

/* Apply only to the Helpers modal panes */
.ba-helpers-left,
.ba-helpers-right{
  scrollbar-width: thin !important;  /* Firefox */
  scrollbar-color: rgba(255,127,0,0.55) transparent !important;
}

/* WebKit (Chrome/Edge/Safari) */
.ba-helpers-left::-webkit-scrollbar,
.ba-helpers-right::-webkit-scrollbar{
  width: 10px !important;
  height: 10px !important;
}

.ba-helpers-left::-webkit-scrollbar-track,
.ba-helpers-right::-webkit-scrollbar-track{
  background: transparent !important;
}

.ba-helpers-left::-webkit-scrollbar-thumb,
.ba-helpers-right::-webkit-scrollbar-thumb{
  background: rgba(255,127,0,0.28) !important;
  border-radius: 999px !important;
  border: 3px solid rgba(0,0,0,0.35) !important; /* slim pill effect */
}

.ba-helpers-left::-webkit-scrollbar-thumb:hover,
.ba-helpers-right::-webkit-scrollbar-thumb:hover{
  background: rgba(255,127,0,0.45) !important;
}
/* END BLOCK: BA.Helpers.Modal.ScrollbarSleek.Override v1.0 */

/* =========================================================
   Shell: single-scroll container (remove double scrollbar) v1.1
   ========================================================= */
html, body{
  height: 100%;
  margin: 0;
  overflow: hidden;           /* lock BOTH html + body */
}

/* Make the shell layout fit inside the viewport */
.ba-shell-layout{
  min-height: 0; /* keep */
}


/* Main becomes the ONLY scroller */
.ba-shell-main{
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Inner wrapper must allow children to shrink/scroll */
.ba-shell-main-inner{
  min-height: 0;
}

/* BEGIN PATCH: Home.MobileImageSwap v1.1 (Brix) */
.ba-skin-image--desktop{
  display: block !important;
}

.ba-skin-image--mobile{
  display: none !important;
}

@media (max-width: 600px){
  .ba-skin-image--desktop{
    display: none !important;
  }

  .ba-skin-image--mobile{
    display: block !important;
  }
}
/* END PATCH: Home.MobileImageSwap v1.1 (Brix) */

.ba-signal-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  text-decoration: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.ba-signal-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #ff7f00;
  opacity: 1;
  box-shadow: none;
}

.ba-signal-status[hidden] {
  display: none;
}

/* BEGIN BLOCK: BA.Shell.CommunityDrawer v1.0 */
.ba-community-drawer{
  position: fixed;
  inset: var(--ba-header-h) 0 0 0;
  z-index: 9000;
  pointer-events: none;
}

.ba-community-drawer[hidden]{
  display: none !important;
}

.ba-community-drawer-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 8, 13, 0.50);
  pointer-events: auto;
}

.ba-community-drawer-panel{
  position: relative;
  width: 100%;
  height: min(76vh, calc(100dvh - var(--ba-header-h) - 18px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 138, 0, 0.34);
  background: #06131c;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46);
  pointer-events: auto;
  animation: ba-community-drawer-in 180ms ease-out both;
}

.ba-community-drawer-bar{
  min-height: 54px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: #001820;
}

.ba-community-drawer-kicker{
  color: #68d391;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ba-community-drawer-title{
  margin-top: 2px;
  color: rgba(255,255,255,0.94);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
}

.ba-community-drawer-return{
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid rgba(255,138,0,0.62);
  border-radius: 7px;
  background: rgba(255,138,0,0.08);
  color: #ffad4d;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ba-community-drawer-return:hover,
.ba-community-drawer-return:focus-visible{
  border-color: #ff8a00;
  background: rgba(255,138,0,0.15);
  color: #fff;
  outline: none;
}

.ba-community-drawer-frame{
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  border: 0;
  background: #06131c;
}

@keyframes ba-community-drawer-in{
  from{ transform: translateY(-18px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

@media (max-width: 900px){
  .ba-community-drawer-panel{
    height: calc(100dvh - var(--ba-header-h));
  }
}

@media (max-width: 560px){
  .ba-community-drawer-bar{
    min-height: 48px;
    padding: 7px 10px;
  }

  .ba-community-drawer-kicker{ font-size: 9px; }
  .ba-community-drawer-title{ font-size: 13px; }
  .ba-community-drawer-return{ min-height: 32px; padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce){
  .ba-community-drawer-panel{ animation: none; }
}
/* END BLOCK: BA.Shell.CommunityDrawer v1.0 */
