/* Utility layout and icon relief only. Glass optics remain the library's job. */
main { isolation: isolate; }
.site-header { z-index: auto; }
.album-topbar {
  position: sticky;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  margin-bottom: 8px;
  /* The sticky toolbar contains inert layout proxies. Its visible buttons
     live in the dialog portal and receive pointer input there. */
  pointer-events: none;
}
.album-topbar #album-close,
.album-topbar #album-next {
  min-height: 44px;
  padding: 12px 19px;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
.album-topbar #album-close { justify-self: start; }
.album-topbar #album-next { justify-self: end; }
.album-topbar .album-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
}
/* Model reset is portaled as well. The plain return button stays interactive. */
.model-topbar { pointer-events: none; }
.model-topbar > :not(.liquid-layout-proxy) { pointer-events: auto; }

.utility-dock {
  position: fixed;
  inset: 0;
  z-index: 75;
  pointer-events: none;
}
.utility-dock #settings-open,
.utility-dock #back-to-top {
  position: fixed;
  z-index: 1;
  width: 46px;
  height: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  pointer-events: auto;
  border-radius: 50%;
}
.utility-dock[data-context="page"] #settings-open { top: 29px; right: 4.5%; bottom: auto; }
.utility-dock[data-context="page"] #back-to-top { right: 4.5%; bottom: calc(28px + env(safe-area-inset-bottom)); }
body.works-active:has(#works[data-view="shelf"]) .utility-dock[data-context="page"] #back-to-top { bottom: calc(150px + env(safe-area-inset-bottom)); }
.utility-dock[data-context="modal"] #settings-open { top: auto; right: calc(24px + var(--utility-dialog-right, 0px)); bottom: calc(24px + var(--utility-dialog-bottom, 0px) + env(safe-area-inset-bottom)); }
.utility-dock[data-context="modal"] #back-to-top { top: auto; right: calc(24px + var(--utility-dialog-right, 0px)); bottom: calc(84px + var(--utility-dialog-bottom, 0px) + env(safe-area-inset-bottom)); }
.relief-icon { width: 22px; height: 22px; overflow: visible; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.relief-icon-highlight { stroke: #fff; opacity: .86; }
.relief-icon-shadow { stroke: #4e6974; }

/* Hide tracks, keeping native wheel/touch/key scrolling in every scrollport.
   Important is required because earlier class rules explicitly request thin. */
html, body, body * { scrollbar-width: none !important; -ms-overflow-style: none !important; }
html::-webkit-scrollbar, body::-webkit-scrollbar, body *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

@media (max-width: 720px), (max-width: 900px) and (orientation: portrait) {
  .album-topbar { top: calc(8px + env(safe-area-inset-top)); gap: 8px; padding: 10px 0; }
  .album-topbar #album-close, .album-topbar #album-next { padding: 11px 12px; font-size: 11px; }
  .album-topbar .album-counter { padding: 11px 12px; font-size: 9px; letter-spacing: .07em; }
  .utility-dock #settings-open, .utility-dock #back-to-top { width: 44px; height: 44px; min-height: 44px; }
  .utility-dock[data-context="page"] #settings-open { top: calc(18px + env(safe-area-inset-top)); right: 6%; }
  .utility-dock[data-context="page"] #back-to-top { right: 16px; bottom: calc(102px + env(safe-area-inset-bottom)); }
  body.works-active:has(#works[data-view="shelf"]) .utility-dock[data-context="page"] #back-to-top { bottom: calc(250px + env(safe-area-inset-bottom)); }
  .utility-dock[data-context="modal"] #settings-open { right: calc(16px + var(--utility-dialog-right, 0px)); bottom: calc(24px + var(--utility-dialog-bottom, 0px) + env(safe-area-inset-bottom)); }
  .utility-dock[data-context="modal"] #back-to-top { right: calc(16px + var(--utility-dialog-right, 0px)); bottom: calc(82px + var(--utility-dialog-bottom, 0px) + env(safe-area-inset-bottom)); }
}
