.workspace-shell.app-shell {
  --workspace-sidebar-width: 224px;
}

.workspace-shell.app-shell.is-sidebar-open:not(.workspace-drawer-layout) {
  grid-template-columns: var(--workspace-sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto;
  grid-template-areas: "sidebar content";
}

.workspace-shell.app-shell:is(.is-sidebar-closed, .workspace-drawer-layout) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  grid-template-areas: "content";
}

.workspace-shell > .workspace-content {
  display: block;
  grid-area: content;
  min-inline-size: 0;
}

.workspace-shell > .workspace-sidebar {
  grid-area: sidebar;
}

.workspace-shell.is-sidebar-open > .workspace-sidebar { display: block; }
.workspace-shell.is-sidebar-closed > .workspace-sidebar { display: none; }

.workspace-shell .topbar {
  position: sticky;
  top: 0;
  grid-area: auto;
}

.workspace-shell .app-view { grid-area: auto; }

.workspace-shell .workspace-tenant {
  display: flex;
  align-items: center;
  gap: clamp(.35rem, .85vw, .65rem);
}

.workspace-shell .workspace-tenant-button {
  flex: 1 1 auto;
  inline-size: auto;
}

.workspace-shell .workspace-profile-button {
  flex: 0 1 auto;
  min-block-size: 2.5rem;
  padding: .13rem .3rem;
  border: 1px solid transparent;
  border-radius: var(--workspace-small-radius);
  background: transparent;
  color: var(--workspace-dark);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.workspace-shell .workspace-profile-button:hover {
  border-color: var(--workspace-border);
  background: var(--surface-soft);
  color: var(--workspace-red);
}

.profile-name-modal { width: min(100%, 38rem); }
.profile-name-request .section-title { margin-block-end: 0; }
.profile-name-comparison { display: grid; gap: 1px; }
.profile-name-comparison dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem .95rem;
  margin: 0;
  padding: .7rem 0;
  border-block-end: 1px solid var(--workspace-border, var(--line));
}
.profile-name-comparison dt { color: var(--muted); font-size: .8rem; }
.profile-name-comparison dd { margin: .15rem 0 0; overflow-wrap: anywhere; font-weight: 650; }
.profile-name-reject { justify-self: start; color: var(--accent); }
.profile-name-approvals { display: grid; gap: .65rem; }
.profile-name-approvals .section-title { margin-block-end: 0; }

.workspace-shell .workspace-menu-toggle,
.workspace-shell .workspace-sidebar-close {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  inline-size: 2.5rem;
  min-block-size: 2.5rem;
  padding: 0;
  border: 1px solid var(--workspace-border);
  border-radius: var(--workspace-small-radius);
  color: var(--workspace-dark);
  background: var(--workspace-surface);
  cursor: pointer;
}

.workspace-shell .workspace-menu-toggle:is(:hover, [aria-expanded="true"]) {
  border-color: var(--accent-border);
  color: var(--workspace-red);
  background: var(--accent-soft);
}

.workspace-shell .workspace-menu-toggle :is(svg, .workspace-icon),
.workspace-shell .workspace-sidebar-close :is(svg, .workspace-icon) {
  inline-size: 1.115rem;
  block-size: 1.115rem;
}

.workspace-shell > .workspace-sidebar .workspace-brand {
  grid-area: auto;
  justify-items: center;
  min-block-size: 62px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--terpix-white) 14%, transparent);
  border-radius: 10px;
}

.workspace-shell > .workspace-sidebar .workspace-brand-wordmark { width: min(100%, 166px); }

.workspace-shell > .workspace-sidebar .nav-row {
  grid-area: auto;
  display: grid;
  gap: 22px;
  margin: 23px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.workspace-shell > .workspace-sidebar .workspace-nav-group { display: grid; }
.workspace-shell > .workspace-sidebar .workspace-nav-title { display: block; }

.workspace-shell > .workspace-sidebar .nav-chip {
  gap: 10px;
  min-block-size: 42px;
  padding: 8px 10px;
  color: var(--terpix-light);
  font-size: .875rem;
}

.workspace-shell > .workspace-sidebar .nav-chip:hover:not(.is-active) {
  border-color: transparent;
  color: var(--terpix-white);
  background: color-mix(in srgb, var(--terpix-white) 9%, var(--workspace-dark));
}

.workspace-shell > .workspace-sidebar .nav-chip.is-active { color: var(--terpix-white); }
.workspace-shell > .workspace-sidebar .nav-chip .workspace-icon { inline-size: 19px; block-size: 19px; }
.workspace-shell > .workspace-sidebar :focus-visible { outline-color: var(--terpix-white); }

.workspace-shell .workspace-sidebar-close,
.workspace-shell > .workspace-sidebar-backdrop { display: none; }

.workspace-shell.workspace-drawer-layout > .workspace-sidebar {
  position: fixed;
  z-index: 36;
  inset: 0 auto 0 0;
  inline-size: min(85vw, 272px);
  min-block-size: 0;
  max-block-size: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 10px 0 30px #18181b45;
}

.workspace-shell.workspace-drawer-layout > .workspace-sidebar .workspace-brand {
  inline-size: calc(100% - 47px);
  min-block-size: 46px;
}

.workspace-shell.workspace-drawer-layout > .workspace-sidebar .workspace-brand-wordmark { width: min(100%, 132px); }

.workspace-shell.workspace-drawer-layout > .workspace-sidebar .workspace-sidebar-close {
  position: absolute;
  inset-block-start: 21px;
  inset-inline-end: 14px;
  display: inline-grid;
  color: var(--terpix-white);
  border-color: color-mix(in srgb, var(--terpix-white) 22%, transparent);
  background: color-mix(in srgb, var(--terpix-white) 8%, var(--workspace-dark));
}

.workspace-shell.workspace-drawer-layout > .workspace-sidebar .workspace-sidebar-close:hover {
  background: color-mix(in srgb, var(--terpix-white) 17%, var(--workspace-dark));
}

.workspace-shell.workspace-drawer-layout.is-sidebar-open > .workspace-sidebar-backdrop {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #18181b88;
  cursor: pointer;
}

body:has(#app > .workspace-drawer-layout.is-sidebar-open) { overflow: hidden; }

.device-preview-frame > .workspace-drawer-layout { position: relative; }
.device-preview-frame > .workspace-drawer-layout > :is(.workspace-sidebar, .workspace-sidebar-backdrop) { position: absolute; }
.device-preview-frame > .workspace-drawer-layout > .workspace-sidebar { max-block-size: 100%; }

@container workspace (max-width: 550px) {
  .workspace-shell .workspace-menu-toggle {
    inline-size: 2.45rem;
    min-block-size: 2.75rem;
  }

  .workspace-shell .workspace-tenant-button .workspace-icon-tile { display: none; }
  .workspace-shell .topbar-actions { gap: 5px; }

  .workspace-shell .workspace-user.workspace-profile-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    inline-size: 2.75rem;
    min-block-size: 2.75rem;
    margin: 0;
    padding: .18rem;
    border-color: var(--workspace-border);
  }

  .workspace-shell .workspace-profile-button .workspace-user-copy { display: none; }
}
