.bos-common-toolbar{
  position:sticky;
  top:calc(var(--topbar-height) + 43px);
  z-index:27;
  min-height:52px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 16px;
  background:color-mix(in srgb,var(--surface) 96%,var(--bos-blue) 4%);
  border-bottom:1px solid var(--border);
  box-shadow:0 2px 7px rgba(0,0,0,.06);
  overflow-x:auto;
  scrollbar-width:thin;
}

/* Keep all shell utility icons visually consistent. The Search, Reminders and
   Notifications helpers use viewBox-only SVG markup, so define their actual size
   and stroke treatment here instead of allowing the browser intrinsic SVG size. */
.topbar-actions > a.icon-button > svg{
  width:19px;
  height:19px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex:none;
}
.popover-action-icon svg{
  width:17px;
  height:17px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Keep the common actions on the right whenever they fit. If the toolbar becomes
   wider than the viewport, the auto margin collapses so every action remains scrollable. */
.bos-common-toolbar-button:first-child{margin-left:auto}

/* Common BOS action order:
   New, Save, Save & Print, Export, Delete, Refresh, [space], Exit.
   Modify is still preserved when MainMenuTree explicitly enables it and stays with
   the edit actions before Export so existing BOS behavior is not removed. */
.bos-common-toolbar-button[data-bos-common-action="new"]{order:10}
.bos-common-toolbar-button[data-bos-common-action="save"]{order:20}
.bos-common-toolbar-button[data-bos-common-action="saveandprint"]{order:30}
.bos-common-toolbar-button[data-bos-common-action="modify"]{order:35}
.bos-common-toolbar-button[data-bos-common-action="export"]{order:40}
.bos-common-toolbar-button[data-bos-common-action="delete"]{order:50}
.bos-common-toolbar-button[data-bos-common-action="refresh"]{order:60}
.bos-common-toolbar-button[data-bos-common-action="exit"]{order:100}
.bos-common-toolbar-button[data-bos-common-action="exit"]:not(:first-child){margin-left:20px}

/* The layout already skips the toolbar when HasActions is false. This is a defensive
   fallback so an accidentally empty toolbar never leaves a blank sticky strip. */
.bos-common-toolbar:not(:has(.bos-common-toolbar-button)){display:none}

.bos-common-toolbar-button{
  flex:0 0 auto;
  min-width:92px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 13px;
  border:1px solid var(--border);
  border-radius:7px;
  background:var(--surface);
  color:var(--text);
  font-size:12px;
  font-weight:700;
  transition:border-color .12s ease,background .12s ease,color .12s ease,transform .12s ease;
}

.bos-common-toolbar-button:hover{
  border-color:color-mix(in srgb,var(--bos-blue) 55%,var(--border));
  background:color-mix(in srgb,var(--bos-blue) 7%,var(--surface));
}

.bos-common-toolbar-button:active{transform:translateY(1px)}
.bos-common-toolbar-button svg{
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex:none;
}
.bos-common-toolbar-button.primary{
  color:#fff;
  background:var(--bos-blue);
  border-color:var(--bos-blue);
}
.bos-common-toolbar-button.primary:hover{background:var(--bos-blue-dark);border-color:var(--bos-blue-dark)}
.bos-common-toolbar-button.danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 55%,var(--border))}
.bos-common-toolbar-button.danger:hover{background:color-mix(in srgb,var(--danger) 9%,var(--surface));border-color:var(--danger)}

/* The active workspace tab is now the screen title. Keep page-level action/badge areas,
   but remove duplicated title text throughout authenticated BOS pages. */
.bos-app .page-header .eyebrow,
.bos-app .page-header h1,
.bos-app .page-header .page-subtitle{
  display:none !important;
}
.bos-app .page-header{
  min-height:0;
  margin-bottom:8px;
  align-items:center;
  justify-content:flex-end;
}
.bos-app .page-header > div:first-child:has(> .eyebrow, > h1, > .page-subtitle){
  display:none !important;
}

html[data-theme="dark"] .bos-common-toolbar{
  background:color-mix(in srgb,var(--surface) 92%,var(--bos-blue) 8%);
}

@media(max-width:800px){
  .bos-common-toolbar{
    top:calc(var(--topbar-height) + 41px);
    min-height:48px;
    padding:6px 10px;
    gap:6px;
  }
  .bos-common-toolbar-button{min-width:82px;height:34px;padding:0 10px;font-size:11.5px}
  .bos-common-toolbar-button[data-bos-common-action="exit"]:not(:first-child){margin-left:12px}
}

@media(max-width:520px){
  .bos-common-toolbar-button{min-width:auto}
  .bos-common-toolbar-button span{display:none}
  .bos-common-toolbar-button svg{width:18px;height:18px}
}
