body.shell-density-compact .page-shell {
  gap: 12px;
}

body.shell-density-compact .topbar,
body.shell-density-compact .command-bar,
body.shell-density-compact .utility-bar {
  transition: all 0.18s ease;
}

body.shell-density-compact .shell-density-toolbar {
  display: none;
}

body.shell-density-compact .shell-density-toolbar button {
  min-height: 38px;
  border-radius: 12px;
  white-space: nowrap;
}

body.shell-density-compact .shell-density-collapsible-target {
  transition: all 0.18s ease;
}

@media (max-width: 820px) {
  body.shell-density-compact .page-shell {
    gap: 10px;
  }

  body.shell-density-compact .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 14px;
    gap: 12px;
    backdrop-filter: blur(12px);
  }

  body.shell-density-compact .brand-block {
    gap: 10px;
    min-width: 0;
  }

  body.shell-density-compact .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    flex: 0 0 38px;
  }

  body.shell-density-compact .brand-block h1 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.1;
  }

  body.shell-density-compact .brand-block .subline {
    display: none;
  }

  body.shell-density-compact .topbar-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  body.shell-density-compact .topbar-meta .pill,
  body.shell-density-compact .topbar-meta button {
    width: 100%;
    min-height: 34px;
    justify-content: center;
    font-size: 0.78rem;
  }

  body.shell-density-compact .shell-density-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 2px;
  }

  body.shell-density-compact .command-bar {
    padding: 10px 12px;
    gap: 10px;
  }

  body.shell-density-compact .command-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  body.shell-density-compact .command-actions::-webkit-scrollbar {
    display: none;
  }

  body.shell-density-compact .command-actions .command-section-title {
    white-space: nowrap;
    margin-right: 6px;
  }

  body.shell-density-compact .command-actions button {
    min-height: 36px;
    white-space: nowrap;
  }

  body.shell-density-compact .command-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 8px;
  }

  body.shell-density-compact .command-chip {
    min-height: 0;
    padding: 10px;
  }

  body.shell-density-compact .utility-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  body.shell-density-compact .utility-left,
  body.shell-density-compact .utility-right {
    gap: 8px;
  }

  body.shell-density-compact .utility-right {
    display: flex;
    flex-wrap: wrap;
  }

  body.shell-density-compact .utility-inline {
    font-size: 0.82rem;
  }

  body.shell-density-compact .shell-density-collapsible-target.is-collapsed > * {
    display: none !important;
  }

  body.shell-density-compact .shell-density-collapsible-target.is-collapsed {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.shell-density-compact #workspaceContent {
    padding-bottom: 84px;
  }
}

@media (max-width: 560px) {
  body.shell-density-compact .topbar-meta {
    grid-template-columns: 1fr 1fr;
  }

  body.shell-density-compact .command-kpis {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  body.shell-density-compact .command-bar,
  body.shell-density-compact .utility-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.shell-density-compact .shell-density-toolbar button {
    min-height: 36px;
    font-size: 0.84rem;
  }
}
