/* NX Desktop v0.2 | readable dynamic taskbar & contrast-safe labels.
   Loaded after the former fixed-width stylesheet; compatible with Aurora,
   Aurora Dark, Filigree and customized NX backgrounds.
 */
@media(min-width:701px){
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar .task-button{
    flex:0 0 auto;
    box-sizing:border-box;
    width:max-content;
    min-width:126px;
    max-width:232px;
    padding-inline:10px;
  }
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar .task-button.pinned-shortcut{
    width:max-content;
    min-width:124px;
    max-width:214px;
  }
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar .pinned-task-buttons{
    flex:0 1 auto;
    width:max-content;
    max-width:min(38%,560px);
  }
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar .running-task-buttons{
    flex:1 1 0;
    min-width:0;
  }
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar:has(.running-task-buttons:empty) .pinned-task-buttons{
    flex:1 1 auto;
    width:auto;
    max-width:none;
  }
  body[data-taskbar-width="fill"]:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar .running-task-buttons .task-button{
    flex:1 0 132px;
    width:auto;
    min-width:132px;
    max-width:none;
  }
}
@media(min-width:701px) and (max-width:1100px){
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar .pinned-task-buttons{
    max-width:34%;
  }
  body:not(.shell-ubuntu):not([data-nx-layout="compact"]) .taskbar:has(.running-task-buttons:empty) .pinned-task-buttons{
    max-width:none;
  }
}
/* An icon caption is always legible over bright, dark and photographic wallpapers.
   Do not rely on Aurora's --text (dark in the light theme) or sample image pixels. */
body .desktop-icons .desktop-icon .desktop-label{
  box-sizing:border-box;
  max-width:calc(100% - 4px);
  padding:3px 6px;
  border-radius:7px;
  background:rgba(10,19,33,.68);
  color:#fff;
  text-shadow:0 1px 2px rgba(0,0,0,.94),0 0 5px rgba(0,0,0,.82);
  -webkit-text-stroke:.14px rgba(0,0,0,.7);
  border:1px solid rgba(255,255,255,.13);
  font-weight:650;
  overflow-wrap:anywhere;
  line-height:1.18;
  box-shadow:0 2px 5px rgba(0,0,0,.12);
}
body .desktop-icons .desktop-icon:hover .desktop-label,
body .desktop-icons .desktop-icon:focus-visible .desktop-label{
  background:rgba(10,19,33,.86);
  border-color:rgba(255,255,255,.42);
}
body .desktop-icons .desktop-icon:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:1px;
}

/* Mac desktop on phones: reflow shortcuts when the available workspace shrinks. */
@media (pointer: coarse) and (max-width: 1000px) {
  body.shell-mac #desktopIcons.nx-free-desktop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-rows: max-content;
    align-content: start;
    justify-items: center;
    gap: 12px 6px;
    overflow: auto;
    pointer-events: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    padding: 4px;
  }
  body.shell-mac #desktopIcons.nx-free-desktop > .desktop-icon {
    position: static;
    width: 100%;
    height: auto;
    min-height: 80px;
    justify-content: flex-start;
    touch-action: pan-y;
  }
  body.shell-mac .taskbar {
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    transform: none;
    margin-inline: auto;
    max-width: none;
    width: auto;
  }
}
