/* AUDITURA_DESKTOP_STABILITY_V6 — desktop native + desktop browser only.
   This stylesheet is deliberately last. It does not affect Android or mini-mobile. */
:is(html:not([data-layout]), html[data-layout="desktop"]) .top-chrome {
  z-index: 100;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.12));
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) minmax(180px, 420px) minmax(200px, 1fr);
  align-items: center;
  gap: clamp(10px, 1.3vw, 22px);
  padding: 12px clamp(14px, 1.6vw, 26px);
  min-width: 0;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .current-view-label {
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  position: relative;
  background: transparent !important;
  border: 0 !important;
  padding: 6px 0 10px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: clamp(15px,1.12vw,19px);
  font-weight: 700;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .current-view-label::after {
  content: '';
  position: absolute;
  left: 0; bottom: 3px;
  height: 2px;
  width: min(100%, 76px);
  border-radius: 1px;
  background: var(--accent-primary, #f5b83d);
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header #view-label {
  color: var(--text-primary, white);
  -webkit-text-fill-color: currentColor;
  background: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .search-bar {
  width: 100% !important;
  max-width: 420px;
  min-width: 0;
  justify-self: center;
  box-sizing: border-box;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .search-bar input { min-width: 0; }
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .user-area {
  justify-self: end;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(7px, .8vw, 14px);
  min-width: 0;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .user-avatar,
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header #profile-avatar { flex: 0 0 auto; }
/* Never show a sort pill in the universal header in desktop mode; the sort
   selector belongs to its own library subview toolbar. */
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header > .library-sort-pill { display: none !important; }
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .scope-pill {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  gap: 6px;
  flex: 0 0 auto;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .scope-pill-opt {
  position: relative;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 7px 8px;
  box-shadow: none !important;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) main .header .scope-pill-opt.active::after {
  content:''; position:absolute; bottom:0; left:8px; right:8px; height:2px;
  background: var(--accent-primary, #f5b83d);
}
/* On Home, the main pane is a single stable viewport. No scrollbar or
   beneath-the-fold cards to compositely animate while offscreen. */
:is(html:not([data-layout]), html[data-layout="desktop"]) body:has(> .app main > .view-section[data-view="home"].active) main.main {
  display:flex;
  flex-direction:column;
  overflow: hidden !important;
  padding-bottom: 0 !important;
  min-height: 0;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) body:has(> .app main > .view-section[data-view="home"].active) .top-chrome {
  flex: 0 0 auto;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) .view-section[data-view="home"].active.auditura-desktop-home-ready {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: 100%;
  padding: 0 !important;
  overflow: hidden !important;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) .view-section[data-view="home"] > .auditura-desktop-home {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  box-sizing: border-box;
  overflow: hidden;
}
:is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-wall { contain: layout paint; gap: 5px; padding: 0 5px; }
:is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-column { contain: layout paint; }
:is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-track { gap: 5px; }
:is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-cover { border-radius: 6px; }
:is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-cover:hover { filter: none; }
/* No opacity/filter animation on every tile. Keep compositing on the few
   column tracks only, and stop their animation when the view is hidden. */
:is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-cover img { backface-visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  :is(html:not([data-layout]), html[data-layout="desktop"]) .auditura-home-track {
    animation: none !important;
    will-change: auto !important;
  }
}
@media (max-width: 950px) {
  :is(html:not([data-layout]), html[data-layout="desktop"]) main .header {
    grid-template-columns: minmax(80px, auto) minmax(155px, 1fr) auto;
  }
  :is(html:not([data-layout]), html[data-layout="desktop"]) main .header .sync-pill-label { display: none; }
}
