/*
 * Analyst Studio shared application shell.
 *
 * This stylesheet is loaded after the legacy surface styles.  It owns the
 * application frame and responsive geometry while leaving workbook,
 * analytical, notes, and studio controls on their existing IDs.
 */

:root {
  --shell-header-height: 54px;
  --shell-global-height: 88px;
  --shell-navigation-height: 68px;
  --shell-context-height: 40px;
  --shell-chrome-height: calc(var(--shell-header-height) + var(--shell-global-height) + var(--shell-navigation-height) + var(--shell-context-height));
  --app-topbar-height: var(--shell-header-height);
  --global-ribbon-height: var(--shell-global-height);
  --workbench-context-height: var(--shell-context-height);
  --workspace-strip-height: var(--shell-navigation-height);
  --workbench-chrome-height: var(--shell-chrome-height);
  --shell-ink: #1f2b3d;
  --shell-muted: #66758a;
  --shell-line: #d7e0eb;
  --shell-blue: #2f6fba;
  --shell-blue-soft: #eaf3fc;
  --shell-navy: #10263f;
}

/* The workbook uses its local ribbon.  The contextual toolbar can also be
 * collapsed, in which case the global area should not reserve blank space. */
body[data-workspace="workbook"],
body[data-command-toolbar-collapsed="true"],
body:has(#shellContextToolbar[hidden]):not([data-workspace="workbook"]) {
  --shell-global-height: 0px;
  --global-ribbon-height: var(--shell-global-height);
  --shell-chrome-height: calc(var(--shell-header-height) + var(--shell-global-height) + var(--shell-navigation-height) + var(--shell-context-height));
  --workbench-chrome-height: var(--shell-chrome-height);
}

body:has(#shellContextToolbar:not([hidden])):not([data-workspace="workbook"]):not([data-command-toolbar-collapsed="true"]) {
  --shell-global-height: 58px;
  --global-ribbon-height: var(--shell-global-height);
  --shell-chrome-height: calc(var(--shell-header-height) + var(--shell-global-height) + var(--shell-navigation-height) + var(--shell-context-height));
  --workbench-chrome-height: var(--shell-chrome-height);
}

html,
body {
  min-height: 100%;
}

html {
  background: #eef3f8;
}

body {
  min-width: 320px;
  overflow: hidden;
  background: #eef3f8;
  color: var(--shell-ink);
}

/* Header ------------------------------------------------------------------ */

#appHeader.topbar {
  position: relative;
  z-index: 60;
  display: grid;
  width: 100%;
  height: var(--shell-header-height);
  min-height: var(--shell-header-height);
  grid-template-columns: max-content max-content minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  overflow: hidden;
  background: var(--shell-navy);
  color: #fff;
  border-bottom: 1px solid #0b1d32;
  box-shadow: 0 2px 8px rgba(15, 35, 58, .18);
}

#appHeader .brand {
  display: flex;
  flex: 0 0 auto;
  min-width: 148px;
  align-items: center;
  gap: 9px;
}

#appHeader .brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #5d9de0, #28629f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), 0 3px 8px rgba(4, 20, 38, .25);
}

#appHeader .brand-mark span {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

#appHeader .brand-mark i {
  position: absolute;
  width: 4px;
  height: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: #b8ddff;
}

#appHeader .brand strong {
  color: #f6f9fd;
  font-size: 14px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

#appHeader .brand > div:last-child {
  min-width: 0;
}

#appHeader .brand > div:last-child span {
  display: none;
}

#shellExperienceNav {
  display: flex;
  width: max-content;
  min-width: 304px;
  height: 100%;
  min-height: 0;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 2px;
  overflow: visible;
}

.shell-experience-nav-item {
  display: inline-flex;
  min-width: 76px;
  height: 100%;
  flex: 0 0 76px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #b8c9db;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.shell-experience-nav-item:hover,
.shell-experience-nav-item:focus-visible {
  outline: none;
  background: rgba(129, 183, 235, .12);
  color: #fff;
}

.shell-experience-nav-item.active,
.shell-experience-nav-item[aria-current="page"] {
  border-bottom-color: #8fc5f2;
  background: rgba(104, 166, 224, .16);
  color: #fff;
}

.shell-nav-icon {
  color: currentColor;
  font-size: 16px;
  line-height: 1;
}

#appHeader .shell-header-context {
  display: flex;
  width: auto;
  max-width: 360px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #bdd0e3;
  font-size: 11px;
}

.shell-header-context .context-kicker {
  display: none;
  flex: 0 0 auto;
  color: #86a5c4 !important;
  font-size: 10px;
  letter-spacing: .1em;
  white-space: nowrap;
}

.shell-header-context strong,
.shell-header-context #activeDatasetTop {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-header-context strong {
  flex: 0 0 auto;
  width: auto;
  min-width: 48px;
  max-width: min(42%, 220px);
  color: #f4f8fc;
  font-size: 11px;
  font-weight: 700;
}

.shell-header-context #activeDatasetTop {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  color: #afc1d4;
}

.shell-header-context .context-divider {
  width: 1px;
  height: 17px;
  flex: 0 0 1px;
  background: #38536f;
}

.active-object-save-status {
  min-width: max-content;
  max-width: none;
  flex: 0 0 auto;
  overflow: visible;
  color: #a8c9e5;
  font-size: 9px;
  white-space: nowrap;
}

#appHeader .app-menu {
  display: flex;
  min-width: 0;
  align-self: stretch;
  align-items: stretch;
  gap: 1px;
  overflow: hidden;
  white-space: nowrap;
}

#appHeader .app-menu-menu {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

#appHeader .app-menu-menu > summary {
  display: flex;
  height: 100%;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  color: #c4d3e2;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  list-style: none;
  white-space: nowrap;
}

#appHeader .app-menu-menu > summary::-webkit-details-marker {
  display: none;
}

#appHeader .app-menu-menu > summary:hover,
#appHeader .app-menu-menu[open] > summary {
  background: rgba(132, 185, 235, .16);
  color: #fff;
}

#appHeader .app-menu-popover {
  top: calc(100% + 4px);
  z-index: 80;
  border-color: #cbd8e6;
  box-shadow: 0 12px 28px rgba(10, 33, 57, .22);
}

#appHeader .app-menu-command {
  min-height: 30px;
  height: auto;
  padding: 6px 8px;
  color: #30455d;
  font-size: 11px;
}

#appHeader .app-menu-command:hover,
#appHeader .app-menu-command:focus-visible {
  outline: none;
  background: var(--shell-blue-soft);
  color: #1f5e9e;
}

#appHeader .app-menu-objects-popover {
  min-width: 235px;
  max-width: 270px;
  padding: 10px;
}

.app-menu-objects-note {
  display: block;
  color: var(--shell-muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

#appHeader .app-menu-object-launchers {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e7ef;
}

#appHeader .app-menu-object-launchers .workspace-tab {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #30485f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}

#appHeader .app-menu-object-launchers .workspace-tab:hover,
#appHeader .app-menu-object-launchers .workspace-tab:focus-visible {
  outline: none;
  background: var(--shell-blue-soft);
  color: #205d99;
}

#appHeader .shell-header-actions {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid #38536f;
}

.shell-app-action,
.shell-utility-action {
  display: inline-flex;
  min-width: 31px;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #496783;
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  color: #d7e5f2;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.shell-app-action:hover,
.shell-app-action:focus-visible,
.shell-utility-action:hover,
.shell-utility-action:focus-visible {
  outline: none;
  border-color: #98c8ed;
  background: rgba(143, 197, 242, .18);
  color: #fff;
}

.shell-app-action.primary,
.shell-app-action.primary:hover,
.shell-app-action.primary:focus-visible {
  border-color: #c5e5ff;
  background: #e8f4ff;
  color: #1f5e9e;
}

.shell-app-action .app-menu-action-icon,
.shell-utility-action > span:first-child {
  font-size: 15px;
  line-height: 1;
}

#appHeader .top-actions {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

#appHeader .top-actions .badge {
  border-color: #496783;
  background: rgba(255, 255, 255, .08);
  color: #d7e5f2;
  font-size: 10px;
  white-space: nowrap;
}

#appHeader .top-actions .top-button {
  height: 30px;
  padding: 5px 9px;
  border-color: #496783;
  background: rgba(255, 255, 255, .06);
  color: #d7e5f2;
  font-size: 10px;
  white-space: nowrap;
}

#appHeader .top-actions .top-button:hover,
#appHeader .top-actions .top-button:focus-visible {
  border-color: #98c8ed;
  background: rgba(143, 197, 242, .18);
  color: #fff;
}

/* Global/context command area ------------------------------------------- */

#globalRibbon {
  position: relative;
  top: 0;
  z-index: 35;
  display: block;
  width: 100%;
  height: var(--shell-global-height);
  min-height: var(--shell-global-height);
  overflow: visible;
  border-bottom: 1px solid var(--shell-line);
  background: #fff;
  box-shadow: 0 1px 4px rgba(25, 51, 78, .08);
}

body[data-workspace="workbook"] #globalRibbon,
body[data-command-toolbar-collapsed="true"] #globalRibbon,
#globalRibbon:has(#shellContextToolbar[hidden]) {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
}

#globalRibbon .global-ribbon-tabs {
  display: flex !important;
  height: 30px;
  min-height: 30px;
  align-items: stretch;
  gap: 1px;
  padding: 0 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid #dce4ed;
  background: #f2f6fa;
  scrollbar-width: thin;
}

#globalRibbon .global-ribbon-tab {
  min-width: max-content;
  height: 30px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-bottom-width: 2px;
  color: #52667d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#globalRibbon .global-ribbon-tab:hover,
#globalRibbon .global-ribbon-tab:focus-visible {
  outline: none;
  background: #e7f0f8;
  color: #245d96;
}

#globalRibbon .global-ribbon-tab.active {
  border-bottom-color: var(--shell-blue);
  background: #fff;
  color: #245d96;
}

#globalRibbon .global-ribbon-hint {
  align-self: center;
  margin-left: auto;
  padding-right: 4px;
  color: #8291a2;
  font-size: 10px;
  white-space: nowrap;
}

#globalRibbon .global-ribbon-body {
  height: calc(var(--shell-global-height) - 30px);
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(#fff, #f6f9fc);
}

#globalRibbon .global-ribbon-panel.active {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-items: stretch;
  gap: 6px;
  padding: 4px 12px 0;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
}

#globalRibbon .global-ribbon-group {
  height: 100%;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0 9px 4px;
  border-right-color: #dce4ed;
}

#globalRibbon .global-ribbon-group:first-child {
  padding-left: 1px;
}

#globalRibbon .global-ribbon-tools {
  display: flex;
  min-height: 39px;
  height: 39px;
  align-items: stretch;
  gap: 3px;
  overflow: visible;
  flex-wrap: nowrap;
}

#globalRibbon .global-ribbon-command {
  width: auto;
  min-width: 67px;
  max-width: 116px;
  height: 37px;
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #d2dfeb;
  border-radius: 4px;
  background: #fff;
  color: #30485f;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

#globalRibbon .global-ribbon-command > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#globalRibbon .global-ribbon-command:hover,
#globalRibbon .global-ribbon-command:focus-visible,
#globalRibbon .global-ribbon-mini:hover,
#globalRibbon .global-ribbon-mini:focus-visible {
  outline: none;
  border-color: #9fc6e5;
  background: var(--shell-blue-soft);
  color: #205d99;
  box-shadow: none;
}

#globalRibbon .global-ribbon-icon {
  color: #3d82be;
  font-size: 16px;
  line-height: 1;
}

#globalRibbon .global-ribbon-label,
#globalRibbon .global-ribbon-menu-stack-label {
  color: #77899d;
  font-size: 10px;
}

#globalRibbon .global-ribbon-mini {
  height: 27px;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-color: #d2dfeb;
  border-radius: 4px;
  background: #f8fbfd;
  color: #4d647b;
  font-size: 10px;
  white-space: nowrap;
}

#globalRibbon .global-ribbon-group-wide {
  flex: 0 0 auto;
}

#globalRibbon .global-ribbon-menu-stack {
  width: 222px;
  min-width: 190px;
  height: 100%;
  flex: 0 0 222px;
  padding-left: 8px;
  border-left-color: #dce4ed;
}

#globalRibbon .global-ribbon-menu-stack-items {
  gap: 2px;
}

#globalRibbon .global-ribbon-menu-stack .global-ribbon-menu-trigger {
  height: 25px;
  min-height: 25px;
  border-color: #d2dfeb;
  background: #f8fbfd;
  color: #405a72;
  font-size: 10px;
}

/* New shell contextual toolbar.  Legacy ribbon tabs/body remain in the DOM
 * so existing command wiring and keyboard helpers keep their IDs. */
#globalRibbon:has(#shellContextToolbar) > .global-ribbon-tabs,
#globalRibbon:has(#shellContextToolbar) > .global-ribbon-body,
body[data-shell-ready="true"] #globalRibbon > .global-ribbon-tabs,
body[data-shell-ready="true"] #globalRibbon > .global-ribbon-body {
  display: none !important;
}

#globalRibbon:has(#shellContextToolbar),
body[data-shell-ready="true"] #globalRibbon {
  height: var(--shell-global-height);
  min-height: var(--shell-global-height);
}

#globalRibbon #shellContextToolbar {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  gap: 7px;
  padding: 5px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--shell-line);
  background: linear-gradient(#fff, #f4f8fb);
  scrollbar-width: thin;
}

#globalRibbon #shellContextToolbar[hidden],
body[data-workspace="workbook"] #globalRibbon #shellContextToolbar {
  display: none !important;
}

#globalRibbon .shell-context-toolbar-label {
  display: inline-flex;
  min-width: 118px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 8px 0 2px;
  border-right: 1px solid #dbe4ed;
  color: #728397;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

#globalRibbon .shell-context-command {
  display: inline-flex;
  min-width: 86px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #cedce9;
  border-radius: 5px;
  background: #fff;
  color: #304a62;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#globalRibbon .shell-context-command:hover,
#globalRibbon .shell-context-command:focus-visible {
  outline: none;
  border-color: #9fc6e5;
  background: var(--shell-blue-soft);
  color: #205d99;
}

#globalRibbon .shell-context-command:disabled,
#globalRibbon .shell-context-command[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .48;
}

#globalRibbon .shell-context-command-icon {
  color: #3c82bc;
  font-size: 17px;
  line-height: 1;
}

#globalRibbon .shell-context-command-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Workspace navigation --------------------------------------------------- */

#shellNavigationStrip {
  position: relative;
  top: 0;
  z-index: 30;
  display: grid;
  width: 100%;
  height: var(--shell-navigation-height);
  min-height: var(--shell-navigation-height);
  grid-template-columns: 1fr;
  grid-template-rows: 32px 36px;
  overflow: hidden;
  border-bottom: 1px solid var(--shell-line);
  background: #fff;
}

#shellNavigationStrip > nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

#workspaceTabs.shell-object-tabs {
  min-width: 0;
  padding: 0 10px;
  border-bottom: 1px solid #e1e8f0;
}

#workspaceTabs.shell-object-tabs > .shell-strip-label,
#shellWorkspaceTools > .shell-strip-label {
  display: inline-flex;
  min-height: 26px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 7px;
  color: #7b8c9e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

#workbenchObjectTabs {
  display: flex !important;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
}

#shellNavigationStrip .workspace-tab {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #66788d;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

#shellNavigationStrip .workspace-tab:hover,
#shellNavigationStrip .workspace-tab:focus-visible {
  outline: none;
  border-color: #d3e2ef;
  background: #f2f7fb;
  color: #245d96;
}

#shellNavigationStrip .workspace-tab.active {
  border-color: #c9dff1;
  background: #eaf3fc;
  color: #245d96;
}

#shellNavigationStrip .workspace-tab.active::after {
  display: none;
}

#shellNavigationStrip .workspace-tab .tab-icon {
  font-size: 15px;
}

#shellNavigationStrip .object-tab {
  max-width: 190px;
}

#shellNavigationStrip .object-tab .object-tab-label {
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shellNavigationStrip .object-tab .object-tab-close {
  margin-left: 2px;
  color: #8294a7;
  font-size: 15px;
}

#shellNavigationStrip .object-tab .object-tab-close:hover {
  color: #bd4652;
}

#shellWorkspaceTools {
  position: relative;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  overflow: hidden;
}

#shellWorkspaceTools > .shell-tools-scroll {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #a5bcd0 transparent;
  scrollbar-width: thin;
}

#shellWorkspaceTools > .shell-tools-scroll:focus-visible {
  outline: 2px solid #8fbfe2;
  outline-offset: -2px;
}

.shell-workspace-tool {
  display: inline-flex;
  min-width: max-content;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #536b83;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.shell-workspace-tool > span:first-child {
  color: #6d91b0;
  font-size: 15px;
  line-height: 1;
}

.shell-workspace-tool:hover,
.shell-workspace-tool:focus-visible,
.shell-workspace-tool.active {
  outline: none;
  border-color: #c9dff1;
  background: #edf5fc;
  color: #245d96;
}

.shell-workspace-tool.active > span:first-child {
  color: #2e78b9;
}

.shell-more-tools {
  position: relative;
  min-width: max-content;
  flex: 0 0 auto;
}

.shell-more-tools > summary {
  display: inline-flex;
  height: 32px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #d3e0eb;
  border-radius: 5px;
  background: #f6f9fc;
  color: #536b83;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.shell-more-tools > summary::-webkit-details-marker {
  display: none;
}

.shell-more-tools > summary:hover,
.shell-more-tools[open] > summary {
  border-color: #b5d2e8;
  background: #eaf3fc;
  color: #245d96;
}

.shell-more-tools-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  display: none;
  min-width: 190px;
  gap: 2px;
  padding: 6px;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 48, 77, .2);
}

.shell-more-tools[open] .shell-more-tools-popover {
  display: grid;
}

.shell-more-tool {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #30485f;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.shell-more-tool:hover,
.shell-more-tool:focus-visible {
  outline: none;
  background: var(--shell-blue-soft);
  color: #205d99;
}

.shell-tools-overflow-hint {
  display: inline-flex;
  min-width: max-content;
  height: 24px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 4px;
  color: #788da2;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.shell-nav-divider {
  width: 1px;
  height: 25px;
  flex: 0 0 1px;
  margin: 0 3px;
  background: #dbe4ed;
}

#shellWorkspaceTools > #shellDockControls {
  display: inline-flex;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding-left: 6px;
  background: #fff;
  box-shadow: -5px 0 9px rgba(24, 52, 78, .08);
}

.shell-dock-label {
  padding: 0 4px;
  color: #8291a2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}

.shell-dock-button {
  height: 30px;
  padding: 0 8px;
  border: 1px solid #d3e0eb;
  border-radius: 4px;
  background: #fff;
  color: #536b83;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.shell-dock-button:hover,
.shell-dock-button:focus-visible,
.shell-dock-button[aria-pressed="true"] {
  outline: none;
  border-color: #a8cce7;
  background: #eaf3fc;
  color: #245d96;
}

/* Dataset/project context toolbar --------------------------------------- */

#analyticalToolbar {
  position: relative;
  top: 0;
  z-index: 25;
  display: flex !important;
  width: 100%;
  height: var(--shell-context-height);
  min-height: var(--shell-context-height);
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--shell-line);
  background: #f7fafc;
  box-shadow: none;
}

#analyticalToolbar .toolbar-context-group,
#analyticalToolbar .toolbar-command-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

#analyticalToolbar .toolbar-context-group {
  flex: 1 1 auto;
}

#analyticalToolbar .toolbar-command-group {
  flex: 0 1 auto;
}

#analyticalToolbar label {
  gap: 5px;
  color: #718398;
  font-size: 10px;
  letter-spacing: .03em;
}

#analyticalToolbar select,
#analyticalToolbar input {
  min-width: 130px;
  height: 30px;
  margin: 0;
  padding: 5px 25px 5px 8px;
  border-color: #cdd9e5;
  border-radius: 5px;
  background: #fff;
  color: #2c435b;
  font-size: 11px;
}

#analyticalToolbar .sample-field input {
  width: 90px;
  min-width: 90px;
  padding-right: 8px;
}

#analyticalToolbar .toolbar-advanced-context summary {
  padding: 7px 9px;
  border-color: #cdd9e5;
  border-radius: 5px;
  background: #fff;
  color: #5f7388;
  font-size: 10px;
}

#analyticalToolbar .toolbar-context-fields {
  top: 36px;
  z-index: 50;
  border-color: #cbd8e6;
  box-shadow: 0 10px 24px rgba(20, 48, 77, .16);
}

#analyticalToolbar .compact-action,
#analyticalToolbar .icon-action,
#analyticalToolbar .command-palette-trigger {
  height: 30px;
  min-height: 30px;
}

#analyticalToolbar .compact-action {
  padding: 5px 10px;
  font-size: 11px;
}

#analyticalToolbar .command-palette-trigger {
  width: 225px;
  border-color: #cdd9e5;
  display: inline-flex !important;
}

#analyticalToolbar .command-palette-trigger strong {
  font-size: 11px;
}

#analyticalToolbar .icon-action {
  width: 30px;
  border-color: #cdd9e5;
  color: #60758b;
}

#analyticalToolbar .icon-action:hover,
#analyticalToolbar .icon-action.active,
#analyticalToolbar .icon-action:focus-visible {
  outline: none;
  border-color: #a8cce7;
  background: #eaf3fc;
  color: #245d96;
}

body.context-bar-closed #toolbarCommandRegion,
body[data-command-toolbar-collapsed="true"] #toolbarCommandRegion {
  display: none !important;
}

/* The workbook ribbon owns sheet editing.  Keep the shared command trigger
 * and layout controls available when workspace controls are expanded, while
 * removing the duplicate run controls from the sheet context. */
body[data-workspace="workbook"] #workbenchRun,
body[data-workspace="workbook"] #workbenchStop {
  display: none !important;
}

body.context-bar-closed #analyticalToolbar {
  display: flex !important;
}

/* Main shell and central canvas ----------------------------------------- */

.shell {
  display: grid;
  width: 100%;
  height: calc(100vh - var(--shell-chrome-height));
  min-height: 0;
  grid-template-columns: var(--workbench-explorer-width, 260px) minmax(0, 1fr) var(--workbench-inspector-width, 320px);
  grid-template-rows: minmax(0, 1fr) var(--workbench-console-height, 0px);
  grid-template-areas:
    "explorer main inspector"
    "explorer console inspector";
  overflow: hidden;
}

.shell .sidebar {
  position: relative;
  top: auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.shell .main {
  min-width: 0;
  min-height: 0;
  padding: 18px 22px 30px;
  overflow: auto;
  background: #eef3f8;
}

.shell .tab,
.shell .tab.active {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.shell.inspector-closed {
  grid-template-columns: var(--workbench-explorer-width, 260px) minmax(0, 1fr) 0;
}

.shell.explorer-closed {
  grid-template-columns: 0 minmax(0, 1fr) var(--workbench-inspector-width, 320px);
}

.shell.explorer-closed.inspector-closed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.shell.console-closed {
  grid-template-rows: minmax(0, 1fr) 0;
}

.shell .analytical-inspector {
  min-width: 0;
}

/* Workbook command surface ---------------------------------------------- */

#tab-workbook .workbook-panel {
  display: flex;
  height: clamp(460px, calc(100vh - var(--shell-chrome-height) - 12px), 760px);
  min-height: 0;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 7px;
  box-shadow: 0 4px 18px rgba(29, 42, 71, .1);
}

#tab-workbook .workbook-toolbar,
#tab-workbook .workbook-find-bar,
#tab-workbook .workbook-filter-menu,
#tab-workbook .sheet-bar,
#tab-workbook .workbook-statusbar {
  flex: 0 0 auto;
}

#tab-workbook .workbook-toolbar {
  border-bottom: 1px solid #d2dce7;
  background: #f6f9fc;
}

#tab-workbook .workbook-ribbon-tabs {
  display: flex !important;
  height: 29px;
  min-height: 29px;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom-color: #dbe4ed;
  background: #edf3f8;
}

#tab-workbook .workbook-ribbon-tab {
  height: 29px;
  min-height: 29px;
  flex: 0 0 auto;
  padding: 0 11px;
  color: #5c7288;
  font-size: 11px;
  white-space: nowrap;
}

#tab-workbook .workbook-ribbon-tab:hover,
#tab-workbook .workbook-ribbon-tab:focus-visible {
  outline: none;
  background: #e4eff8;
  color: #245d96;
}

#tab-workbook .workbook-ribbon-tab.active {
  border-bottom-color: var(--shell-blue);
  background: #f7fbfe;
  color: #245d96;
}

#tab-workbook .workbook-ribbon-hint {
  margin-left: auto;
  color: #7c8ea0;
  font-size: 10px;
}

#tab-workbook .workbook-ribbon-body {
  display: flex !important;
  height: 55px;
  min-height: 55px;
  min-width: 0;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 8px 0;
  flex-wrap: nowrap !important;
  background: linear-gradient(#fbfdff, #f2f6fa);
}

#tab-workbook .ribbon-group {
  height: 100%;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0 8px 3px;
}

#tab-workbook .ribbon-group[hidden] {
  display: none !important;
}

#tab-workbook .ribbon-group-tools {
  display: flex;
  height: 37px;
  min-height: 37px;
  align-items: stretch;
  gap: 3px;
  overflow: visible;
  flex-wrap: nowrap;
}

#tab-workbook .ribbon-command,
#tab-workbook .ribbon-select-wrap,
#tab-workbook .ribbon-check-wrap {
  flex: 0 0 auto;
}

#tab-workbook .ribbon-command {
  min-width: 58px;
  height: 36px;
  padding: 3px 6px;
  border-color: #d0deea;
  border-radius: 4px;
  background: #fff;
  color: #3f5870;
  font-size: 10px;
  white-space: nowrap;
}

#tab-workbook .ribbon-command > span:last-child,
#tab-workbook .ribbon-select-wrap > span:first-child,
#tab-workbook .ribbon-check-wrap > span:last-child {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

#tab-workbook .ribbon-command > span:last-child {
  font-size: 10px;
}

#tab-workbook .ribbon-command:hover,
#tab-workbook .ribbon-command:focus-visible {
  outline: none;
  border-color: #9fc6e5;
  background: var(--shell-blue-soft);
  color: #205d99;
}

#tab-workbook .ribbon-icon {
  color: #3d82be;
  font-size: 16px;
  line-height: 1;
}

#tab-workbook .ribbon-group-label {
  color: #77899d;
  font-size: 10px;
}

#tab-workbook .ribbon-mini-command {
  height: 25px;
  padding: 3px 8px;
  border-color: #d0deea;
  color: #4c657c;
  font-size: 10px;
  white-space: nowrap;
}

#tab-workbook .workbook-formula-row {
  min-height: 36px;
  height: 36px;
  padding: 4px 8px;
  border-top-color: #dbe4ed;
}

#tab-workbook #workbookGrid {
  display: block !important;
  width: 100%;
  height: auto !important;
  min-height: 320px;
  flex: 1 1 auto;
  visibility: visible !important;
  max-height: none !important;
  overflow: auto;
}

#tab-workbook .workbook-audit-panel[hidden],
#tab-workbook .workbook-find-bar[hidden],
#tab-workbook .workbook-filter-menu[hidden] {
  display: none !important;
}

#tab-workbook .sheet-bar {
  height: 32px;
  min-height: 32px;
  padding: 3px 7px;
  overflow: hidden;
}

body:not(.analyst-rail-open) #tab-workbook .sheet-bar,
body:not(.analyst-rail-open) #tab-workbook .workbook-statusbar {
  padding-right: 54px;
}

#tab-workbook .sheet-strip-navigation {
  flex: 1 1 auto;
  min-width: 0;
}

#tab-workbook .sheet-tabs {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

#tab-workbook .sheet-strip-actions { flex: 0 0 auto; }

@container workbook-sheet-strip (max-width: 700px) {
  #tab-workbook .sheet-strip-actions { gap: 2px; }
  #tab-workbook .sheet-action { width: 25px; min-width: 25px; padding: 0; }
  #tab-workbook .sheet-action-label { display: none; }
  #tab-workbook .sheet-action-icon { display: inline; }
  #tab-workbook .add-sheet { width: 25px; min-width: 25px; padding: 0; }
  #tab-workbook .sheet-nav-buttons { padding-right: 3px; }
  #tab-workbook .sheet-nav { width: 20px; }
}

#tab-workbook .sheet-action,
#tab-workbook .add-sheet,
#tab-workbook .sheet-nav {
  height: 25px;
}

#tab-workbook .workbook-statusbar {
  height: 21px;
  min-height: 21px;
  padding: 2px 8px;
}

/* The full Statistics & Regression workspace owns this duplicate analysis
 * surface.  Keep its IDs and handlers for compatibility without letting it
 * push the active sheet below the fold. */
#tab-workbook > .sheet-regression-panel {
  display: none !important;
}

/* Keep content surfaces from establishing a second fixed width. */
.main .page-heading,
.main .panel,
.main .two-column,
.main .model-grid,
.main .studio-shell,
.main .notes-shell,
.main .notebook-shell {
  min-width: 0;
}

/* Responsive frame ------------------------------------------------------- */

/* Compact document chrome ------------------------------------------------
 * The workbook owns the visible tab row and command ribbon. Workspace,
 * object, project, dataset, run, and dock controls stay live, but are mounted
 * into the header workspace menu instead of reserving three permanent rows. */

:root {
  --shell-header-height: 36px;
  --shell-global-height: 0px;
  --shell-navigation-height: 0px;
  --shell-context-height: 0px;
  --shell-chrome-height: calc(var(--shell-header-height) + var(--shell-global-height));
  --app-topbar-height: var(--shell-header-height);
  --global-ribbon-height: var(--shell-global-height);
  --workbench-context-height: 0px;
  --workspace-strip-height: 0px;
  --workbench-chrome-height: var(--shell-chrome-height);
}

body[data-workspace="workbook"],
body[data-command-toolbar-collapsed="true"],
body:has(#shellContextToolbar[hidden]):not([data-workspace="workbook"]) {
  --shell-global-height: 0px;
  --global-ribbon-height: var(--shell-global-height);
  --shell-chrome-height: calc(var(--shell-header-height) + var(--shell-global-height));
  --workbench-chrome-height: var(--shell-chrome-height);
}

body:has(#shellContextToolbar:not([hidden])):not([data-workspace="workbook"]):not([data-command-toolbar-collapsed="true"]) {
  --shell-global-height: 44px;
  --global-ribbon-height: var(--shell-global-height);
  --shell-chrome-height: calc(var(--shell-header-height) + var(--shell-global-height));
  --workbench-chrome-height: var(--shell-chrome-height);
}

body:not([data-shell-compact-ready="true"]) > #shellNavigationStrip,
body:not([data-shell-compact-ready="true"]) > #analyticalToolbar {
  display: none !important;
}

/* The visible utility nodes are reparented into the menu during shell init.
 * The remaining wrapper contains only hidden file inputs and must not create
 * an implicit second header grid row. */
body[data-shell-compact-ready="true"] #appHeader > .top-actions {
  display: none;
}

#appHeader.topbar {
  height: var(--shell-header-height);
  min-height: var(--shell-header-height);
  z-index: 80;
  align-items: center;
  grid-template-columns: max-content minmax(110px, 1fr) minmax(240px, 360px) max-content max-content max-content;
  gap: 4px;
  padding: 0 7px;
  overflow: visible;
  border-bottom: 1px solid #d8e0e9;
  background: #f8fafc;
  color: #26384c;
  box-shadow: 0 1px 4px rgba(24, 44, 68, .08);
}

#appHeader .brand {
  min-width: 27px;
  gap: 4px;
}

#appHeader .brand-mark {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border-radius: 5px;
  box-shadow: none;
}

#appHeader .brand > div:last-child {
  display: none;
}

#appHeader .shell-header-context {
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, max-content) max-content;
  gap: 6px;
  justify-content: start;
  color: #6a7a8d;
}

#appHeader .shell-header-context .context-kicker,
#appHeader .shell-header-context .context-divider {
  display: none;
}

#appHeader .shell-header-context strong {
  width: auto;
  min-width: 0;
  max-width: 260px;
  color: #26384c;
  font-size: 12px;
}

#appHeader .shell-header-context #activeDatasetTop {
  display: none;
}

#appHeader .active-object-save-status {
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf3fc;
  color: #316a9f;
  font-size: 9px;
}

#appHeader .app-menu {
  height: 100%;
  align-items: stretch;
  overflow: visible;
}

#appHeader .app-menu-menu > summary {
  padding-inline: 5px;
  color: #53657a;
  font-size: 10px;
}

#appHeader .app-menu-menu > summary:hover,
#appHeader .app-menu-menu[open] > summary {
  background: #eaf1f8;
  color: #245d96;
}

#appHeader .app-menu-popover {
  top: calc(100% + 1px);
}

#appHeader .shell-header-actions {
  height: 100%;
  gap: 1px;
  margin-left: 1px;
  padding-left: 4px;
  border-left-color: #d8e0e9;
}

#appHeader .shell-app-action,
#appHeader .shell-utility-action {
  min-width: 26px;
  height: 26px;
  gap: 3px;
  padding: 3px 5px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: #4f6379;
  font-size: 10px;
}

#appHeader .shell-app-action:hover,
#appHeader .shell-app-action:focus-visible,
#appHeader .shell-utility-action:hover,
#appHeader .shell-utility-action:focus-visible {
  border-color: #9fc4e3;
  background: #edf5fc;
  color: #245d96;
}

#appHeader .shell-app-action.primary,
#appHeader .shell-app-action.primary:hover,
#appHeader .shell-app-action.primary:focus-visible {
  border-color: #2f75b5;
  background: #2f75b5;
  color: #fff;
}

/* The document bar keeps the four most frequent file/history commands visible
 * without turning their text labels into a second navigation strip. Their
 * live titles and aria-labels remain authoritative. */
#appHeader #appUndo > span:last-child,
#appHeader #appRedo > span:last-child,
#appHeader #appSave > span:last-child,
#appHeader #appExport > span:last-child {
  display: none;
}

.shell-command-palette-slot {
  min-width: 0;
}

#shellCommandPaletteSlot #commandPaletteButton {
  display: inline-flex !important;
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #d1dbe6;
  border-radius: 6px;
  background: #fff;
  color: #66768a;
  box-shadow: inset 0 1px 1px rgba(21, 45, 72, .03);
}

#shellCommandPaletteSlot #commandPaletteButton:hover,
#shellCommandPaletteSlot #commandPaletteButton:focus-visible {
  outline: none;
  border-color: #8fb9dc;
  background: #f5f9fd;
  color: #245d96;
}

#shellCommandPaletteSlot #commandPaletteButton strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shellCommandPaletteSlot #commandPaletteButton kbd {
  margin-left: auto;
  font-size: 9px;
}

.shell-compact-menu {
  position: relative;
  min-width: max-content;
  margin: 0;
}

.shell-compact-menu > summary {
  display: inline-flex;
  height: 26px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #4f6379;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.shell-compact-menu > summary::-webkit-details-marker {
  display: none;
}

.shell-compact-menu > summary:hover,
.shell-compact-menu > summary:focus-visible,
.shell-compact-menu[open] > summary {
  outline: none;
  border-color: #91b9da;
  background: #edf5fc;
  color: #245d96;
}

.shell-compact-menu[open] .shell-compact-chevron {
  transform: rotate(180deg);
}

.shell-compact-menu-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 100;
  display: grid;
  width: min(820px, calc(100vw - 16px));
  max-height: calc(100vh - var(--shell-header-height) - 12px);
  gap: 8px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #cbd7e4;
  border-radius: 8px;
  background: #fff;
  color: #26384c;
  box-shadow: 0 16px 38px rgba(20, 43, 68, .2);
}

.shell-compact-menu:not([open]) > .shell-compact-menu-panel {
  display: none;
}

.shell-utility-menu .shell-compact-menu-panel {
  width: min(250px, calc(100vw - 16px));
}

#shellUtilityMenuPanel .shell-app-action,
#shellUtilityMenuPanel .shell-utility-action,
#shellUtilityMenuPanel .badge,
#shellUtilityMenuPanel .top-button {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: flex-start;
  color: #40566d;
}

#shellUtilityMenuPanel .badge {
  height: auto;
  border-color: #d7e1eb;
  background: #f4f7fa;
}

#shellUtilityMenuPanel .shell-app-action,
#shellUtilityMenuPanel .shell-utility-action {
  box-sizing: border-box;
  height: auto;
  min-height: 40px;
  gap: 8px;
  padding: 8px 10px;
}

#shellWorkspaceMenuPanel #shellExperienceNav {
  display: grid;
  width: 100%;
  min-width: 0;
  height: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e7ef;
}

#shellWorkspaceMenuPanel .shell-experience-nav-item {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d7e1eb;
  border-radius: 5px;
  background: #f8fafc;
  color: #50657b;
}

#shellWorkspaceMenuPanel .shell-experience-nav-item:hover,
#shellWorkspaceMenuPanel .shell-experience-nav-item:focus-visible,
#shellWorkspaceMenuPanel .shell-experience-nav-item.active {
  border-color: #9fc5e4;
  background: #eaf3fc;
  color: #245d96;
}

#shellWorkspaceMenuPanel #shellNavigationStrip {
  position: static;
  display: grid;
  width: 100%;
  height: auto;
  min-height: 0;
  grid-template-rows: auto auto;
  gap: 7px;
  overflow: visible;
  border: 0;
  background: transparent;
}

#shellWorkspaceMenuPanel #workspaceTabs,
#shellWorkspaceMenuPanel #shellWorkspaceTools {
  min-height: 34px;
  padding: 0;
  overflow: visible;
  border: 0;
}

#shellWorkspaceMenuPanel #workbenchObjectTabs,
#shellWorkspaceMenuPanel .shell-tools-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

#shellWorkspaceMenuPanel #analyticalToolbar {
  position: static;
  display: flex !important;
  width: 100%;
  height: auto;
  min-height: 0;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 0;
  overflow: visible;
  border-top: 1px solid #e0e7ef;
  border-bottom: 0;
  background: transparent;
}

#shellWorkspaceMenuPanel #analyticalToolbar .toolbar-context-group,
body.context-bar-open:not([data-command-toolbar-collapsed="true"]) #shellWorkspaceMenuPanel #analyticalToolbar .toolbar-command-group {
  display: flex !important;
  flex-wrap: wrap;
}

#shellWorkspaceMenuPanel #analyticalToolbar .toolbar-context-group label {
  display: flex !important;
}

body[data-command-toolbar-collapsed="true"] #shellWorkspaceMenuPanel #toolbarCommandRegion {
  display: none !important;
}

#shellWorkspaceMenuPanel #analyticalToolbar .toolbar-command-group {
  margin-left: auto;
}

#shellWorkspaceMenuPanel #analyticalToolbar .command-palette-trigger {
  display: none !important;
}

body[data-workspace="workbook"] .shell .main {
  padding: 0 !important;
  background: #fff;
}

body[data-workspace="workbook"] #tab-workbook .workbook-panel {
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

body[data-workspace="workbook"] .main[data-layout="tabbed"] > #tab-workbook.active {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 761px) {
  body[data-workspace="workbook"] .main[data-layout="tabbed"] > #tab-workbook.active #workbookGrid {
    height: 0 !important;
    min-height: 0;
    flex: 1 1 0;
  }
}

body[data-workspace="workbook"] #tab-workbook .workbook-toolbar {
  border-top: 0;
}

/* The density command shares the existing tab row; only commands collapse. */
#tab-workbook #workbookRibbonBody[hidden] {
  display: none !important;
}

#tab-workbook .workbook-ribbon-toggle {
  flex: 0 0 auto;
  height: 24px;
  min-height: 24px;
  padding: 0 6px;
  margin-left: auto;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 10px;
  white-space: nowrap;
}

#tab-workbook .workbook-ribbon-toggle:focus-visible {
  outline: 2px solid var(--shell-blue, Highlight);
  outline-offset: -2px;
}

body[data-workspace="workbook"] #tab-workbook .workbook-ribbon-tabs {
  height: 26px;
  min-height: 26px;
  padding-inline: 8px;
}

body[data-workspace="workbook"] #tab-workbook .workbook-ribbon-tab {
  height: 26px;
  min-height: 26px;
  padding-inline: 10px;
  font-size: 10px;
}

body[data-workspace="workbook"] #tab-workbook .workbook-formula-row:not(.formula-bar-expanded) {
  height: 30px;
  min-height: 30px;
  padding-block: 2px;
}

body[data-workspace="workbook"] #tab-workbook .workbook-formula-row.formula-bar-expanded {
  height: auto;
  min-height: 86px;
}

/* Keep the command surface visually grouped without drawing a separate box
 * around every action. Hover, focus, disabled, and pressed state rules remain
 * authoritative over this quiet default. */
body[data-workspace="workbook"] #tab-workbook .ribbon-command {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1450px) and (min-width: 761px) {
  #appHeader .top-actions .badge:first-child {
    display: none;
  }

  /* Keep the context track useful at normal laptop widths. The labels still
   * remain keyboard/tool-tip accessible when the dataset has to ellipsize. */
  #shellExperienceNav {
    min-width: 272px;
  }

  #shellExperienceNav .shell-experience-nav-item {
    min-width: 68px;
    flex-basis: 68px;
    padding-inline: 7px;
  }
}

@media (max-width: 1340px) and (min-width: 761px) {
  #appHeader .shell-header-context {
    display: grid;
  }

  #appHeader .app-menu-menu:nth-child(5) {
    display: none;
  }

  #appHeader .shell-header-actions .shell-app-action,
  #appHeader .shell-header-actions .shell-utility-action {
    min-width: 30px;
    padding-inline: 5px;
  }

  #appHeader .shell-header-actions .shell-app-action > span:last-child,
  #appHeader .shell-header-actions .shell-utility-action > span:last-child {
    display: none;
  }

  #appHeader .top-actions #loginButton,
  #appHeader .top-actions #logoutButton,
  #appHeader .top-actions #healthBadge {
    display: none;
  }
}

@media (max-width: 1250px) and (min-width: 901px) {
  #shellExperienceNav {
    min-width: 272px;
  }

  #shellExperienceNav .shell-experience-nav-item {
    min-width: 68px;
    flex-basis: 68px;
    padding-inline: 7px;
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  /* At compact desktop widths the legacy sheet defined a two-column area
   * map. The shell still has explicit explorer/main/inspector tracks, so
   * keep the three-column map even when either rail is closed. */
  .shell,
  .shell.explorer-closed,
  .shell.inspector-closed,
  .shell.explorer-closed.inspector-closed {
    grid-template-areas:
      "explorer main inspector"
      "explorer console inspector" !important;
  }

  #appHeader .app-menu-menu:nth-child(2) {
    display: none;
  }

  #appHeader.topbar {
    grid-template-columns: max-content minmax(110px, 1fr) minmax(220px, 240px) max-content max-content max-content;
  }
}

@media (max-width: 900px) and (min-width: 761px) {
  #appHeader.topbar {
    grid-template-columns: max-content minmax(120px, 1fr) minmax(140px, 180px) max-content 28px 28px;
    gap: 3px;
    padding-inline: 5px;
  }

  /* Keep File, View, and the live quick actions in the document bar. Object
   * navigation remains available through the adjacent Workspace menu, whose
   * icon retains its accessible name. */
  #appHeader .app-menu-menu:nth-child(4) {
    display: none;
  }

  #shellWorkspaceMenuSummary {
    width: 28px;
    justify-content: center;
    padding-inline: 0;
  }

  #shellWorkspaceMenuSummary > span:nth-child(2),
  #shellWorkspaceMenuSummary .shell-compact-chevron {
    display: none;
  }

  #shellExperienceNav {
    min-width: 272px;
  }

  #shellNavigationStrip {
    grid-template-rows: 32px 36px;
  }

  #shellWorkspaceTools {
    padding-inline: 8px;
  }

  .shell-dock-label {
    display: none;
  }

  .shell-tools-overflow-hint {
    padding-inline: 2px;
  }
}

@media (max-width: 760px) {
  :root {
    --shell-header-height: 36px;
    --shell-global-height: 82px;
    --shell-navigation-height: 0px;
    --shell-context-height: 0px;
  }

  html,
  body {
    overflow: hidden;
  }

  #appHeader.topbar {
    display: grid;
    height: var(--shell-header-height);
    min-height: var(--shell-header-height);
    grid-template-columns: 24px minmax(66px, 1fr) 28px max-content 28px 28px;
    gap: 4px;
    padding: 0 5px;
    overflow: visible;
  }

  #appHeader .brand {
    min-width: 0;
    height: 36px;
  }

  #appHeader .brand strong {
    font-size: 13px;
  }

  #shellWorkspaceMenuPanel #shellExperienceNav {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 0;
  }

  #shellWorkspaceMenuPanel .shell-experience-nav-item {
    min-width: 0;
    height: 34px;
    font-size: 11px;
  }

  #appHeader .shell-header-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 4px;
  }

  #appHeader .shell-header-context #activeDatasetTop {
    display: none;
  }

  #appHeader .app-menu {
    height: 36px;
    min-width: 0;
  }

  #appHeader .app-menu-menu:nth-child(n+2) {
    display: none;
  }

  #appHeader .app-menu-menu > summary {
    padding-inline: 5px;
    font-size: 10px;
  }

  #appHeader .app-menu-menu:first-child .app-menu-popover {
    position: fixed;
    top: calc(var(--shell-header-height) + 1px);
    right: 4px;
    left: auto;
    width: min(220px, calc(100vw - 8px));
    min-width: min(178px, calc(100vw - 8px));
    max-height: calc(100dvh - var(--shell-header-height) - 8px);
    overflow: auto;
  }

  #appHeader .shell-header-actions {
    height: 36px;
    margin-left: 0;
    padding-left: 2px;
  }

  #appHeader .shell-header-actions .shell-app-action,
  #appHeader .shell-header-actions .shell-utility-action {
    width: 28px;
    min-width: 28px;
    padding: 3px;
  }

  #appHeader .shell-header-actions .shell-app-action > span:last-child,
  #appHeader .shell-header-actions .shell-utility-action > span:last-child {
    display: none;
  }

  #appHeader #appUndo,
  #appHeader #appRedo,
  #appHeader #appExport {
    display: none;
  }

  #shellCommandPaletteSlot #commandPaletteButton {
    width: 28px;
    padding-inline: 5px;
  }

  #shellCommandPaletteSlot #commandPaletteButton strong,
  #shellCommandPaletteSlot #commandPaletteButton kbd,
  #shellWorkspaceMenuSummary > span:nth-child(2),
  #shellWorkspaceMenuSummary .shell-compact-chevron {
    display: none;
  }

  .shell-compact-menu > summary {
    width: 28px;
    justify-content: center;
    padding: 0;
  }

  .shell-compact-menu-panel {
    position: fixed;
    top: calc(var(--shell-header-height) + 4px);
    right: 4px;
    left: 4px;
    width: auto;
    max-height: calc(100dvh - var(--shell-header-height) - 8px);
  }

  .shell-utility-menu .shell-compact-menu-panel {
    right: 4px;
    left: auto;
    width: min(250px, calc(100vw - 8px));
  }

  #globalRibbon .global-ribbon-tabs {
    padding-inline: 7px;
  }

  #globalRibbon .global-ribbon-tab {
    padding-inline: 9px;
    font-size: 10px;
  }

  #globalRibbon .global-ribbon-hint {
    display: none;
  }

  #globalRibbon .global-ribbon-panel.active {
    padding-inline: 7px;
  }

  #globalRibbon .global-ribbon-command {
    min-width: 62px;
    height: 36px;
    padding-inline: 5px;
    font-size: 10px;
  }

  #globalRibbon #shellContextToolbar {
    padding-inline: 8px;
  }

  #globalRibbon .shell-context-toolbar-label {
    min-width: 88px;
    padding-inline: 2px 5px;
    font-size: 9px;
  }

  #globalRibbon .shell-context-command {
    min-width: 78px;
    height: 42px;
    padding-inline: 7px;
    font-size: 10px;
  }

  #globalRibbon .shell-context-command-label {
    max-width: 100px;
  }

  #shellNavigationStrip {
    grid-template-rows: 34px 40px;
    overflow: visible;
  }

  #workspaceTabs.shell-object-tabs {
    padding-inline: 7px;
  }

  #shellWorkspaceTools {
    padding-inline: 6px;
  }

  .shell-tools-overflow-hint {
    padding-inline: 2px;
  }

  #shellWorkspaceTools > #shellDockControls {
    gap: 2px;
    padding-left: 3px;
  }

  .shell-dock-label {
    display: none;
  }

  .shell-dock-button {
    width: 30px;
    overflow: hidden;
    padding-inline: 4px;
    text-overflow: ellipsis;
  }

  #analyticalToolbar {
    gap: 7px;
    padding-inline: 8px;
  }

  #analyticalToolbar .toolbar-context-group {
    overflow-x: auto;
  }

  #analyticalToolbar .toolbar-command-group {
    gap: 3px;
  }

  #analyticalToolbar .command-palette-trigger {
    width: 30px;
    padding-inline: 6px;
  }

  #analyticalToolbar .command-palette-trigger strong,
  #analyticalToolbar .command-palette-trigger kbd {
    display: none;
  }

  #tab-workbook .workbook-formula-row {
    gap: 4px;
    padding: 3px 6px;
  }

  #tab-workbook .workbook-name-box {
    width: 64px;
    min-width: 64px;
    flex: 0 0 64px;
    padding-inline: 6px;
  }

  #tab-workbook .formula-fx {
    width: 18px;
    min-width: 18px;
    flex: 0 0 18px;
  }

  #tab-workbook .workbook-formula-input-wrap {
    min-width: 80px;
  }

  #tab-workbook .formula-bar-toggle {
    width: 30px;
    min-width: 30px;
    flex: 0 0 30px;
    padding-inline: 4px;
  }

  #tab-workbook .formula-bar-toggle-label {
    display: none;
  }

  #tab-workbook .workbook-status,
  #tab-workbook .workbook-protection-status,
  #tab-workbook .workbook-save-status {
    display: none !important;
  }

  .shell {
    height: auto;
    min-height: calc(100vh - var(--shell-chrome-height));
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) var(--workbench-console-height, 0px);
    grid-template-areas: "main" "console";
    overflow: visible;
  }

  .shell.explorer-closed,
  .shell.inspector-closed,
  .shell.explorer-closed.inspector-closed {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "main" "console";
  }

  .shell .main {
    min-height: 0;
    padding: 14px 10px 24px;
    overflow: visible;
  }

  body[data-workspace="workbook"] {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body[data-workspace="workbook"] #appHeader,
  body[data-workspace="workbook"] #globalRibbon,
  body[data-workspace="workbook"] #shellNavigationStrip,
  body[data-workspace="workbook"] #analyticalToolbar {
    flex: 0 0 auto;
  }

  body[data-workspace="workbook"] .shell {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }

  body[data-workspace="workbook"] .shell .main {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body[data-workspace="workbook"] .shell .main > #tab-workbook {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.context-bar-open #analyticalToolbar .command-palette-trigger,
  body.context-bar-open #analyticalToolbar #toggleCommandToolbar {
    display: inline-flex !important;
  }

  .shell .sidebar {
    position: fixed;
    top: var(--shell-chrome-height);
    left: 0;
    bottom: 0;
    z-index: 70;
    width: min(310px, 88vw);
    height: auto;
    box-shadow: 12px 0 30px rgba(12, 33, 56, .2);
  }

  .shell.explorer-closed .sidebar {
    display: none;
  }

  .shell .analytical-inspector {
    position: fixed;
    top: var(--shell-chrome-height);
    right: 0;
    bottom: 0;
    z-index: 70;
    width: min(340px, 92vw);
    box-shadow: -12px 0 30px rgba(12, 33, 56, .2);
  }

  .shell.inspector-closed .analytical-inspector {
    display: none;
  }

  #tab-workbook .workbook-panel {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  body[data-workspace="workbook"] #tab-workbook .workbook-ribbon-tabs {
    height: 28px;
    min-height: 28px;
    align-items: center;
    overflow: hidden;
  }

  body[data-workspace="workbook"] #tab-workbook .workbook-ribbon-tab {
    display: none;
  }

  #tab-workbook .workbook-ribbon-tab-select-wrap {
    display: flex !important;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    padding: 1px 0;
  }

  #tab-workbook .workbook-ribbon-tab-select {
    height: 25px;
    min-height: 25px;
  }

  #tab-workbook .workbook-ribbon-body {
    height: 54px;
    min-height: 54px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
  }

  #tab-workbook .workbook-ribbon-body .ribbon-group {
    display: flex;
    width: max-content;
    max-width: none;
    flex: 0 0 auto;
  }

  #tab-workbook .workbook-ribbon-body .ribbon-group[hidden] {
    display: none !important;
  }

  #tab-workbook .ribbon-command {
    min-width: 58px;
    height: 36px;
  }

  #tab-workbook #workbookGrid {
    min-height: 240px;
  }
}

@media (max-width: 480px) {
  #appHeader .app-menu-menu:first-child > summary {
    font-size: 10px;
  }

  #tab-workbook .workbook-ribbon-hint {
    display: none;
  }

  #tab-workbook .workbook-grid {
    min-height: 240px;
  }

  #tab-workbook .workbook-selection-metrics {
    max-width: 56vw;
  }

  #tab-workbook .workbook-zoom input {
    width: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #appHeader *,
  #globalRibbon *,
  #shellNavigationStrip * {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}

@media (forced-colors: active) {
  #appHeader.topbar,
  #globalRibbon,
  #shellNavigationStrip,
  #analyticalToolbar {
    border-color: CanvasText;
  }

  .shell-experience-nav-item.active,
  .shell-workspace-tool.active,
  .shell-dock-button[aria-pressed="true"] {
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }

  #globalRibbon .shell-context-command,
  #tab-workbook .ribbon-command {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }
}
