.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 20.4vw, 216px), 1fr));
  align-content: start;
  gap: 3px;
}
.album-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--cp-surface-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.album-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-tile:focus-visible { outline-offset: -4px; }
.album-tile:hover { filter: brightness(1.06); }
.d9-browser {
  grid-row: 3;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px clamp(8px, 2vw, 24px) 24px;
  background: var(--cp-bg);
  -webkit-overflow-scrolling: touch;
}
.d9-browser .album-grid { max-width: 1500px; margin: 0 auto; }
.d9-browser-note { max-width: 1500px; margin: 2px auto 12px; color: var(--cp-text-muted); font-size: 12px; }
.d9-dialog { border: 0; border-radius: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.d9-head { min-height: 60px; padding-top: max(10px, env(safe-area-inset-top)); }
.d9-title { font-size: clamp(14px, 2vw, 18px); }
.d9-tabs { justify-content: center; gap: 0; padding: 8px; }
.d9-tab { min-width: 100px; border: 0; border-radius: 8px; padding: 8px 18px; }
.d9-stage { grid-row: 3; }
.d9-foot { grid-row: 4; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.d9-back { border: 0; padding: 8px 4px; background: transparent; color: var(--cp-link); font: inherit; white-space: nowrap; cursor: pointer; }
.d9-image-wrap, .image-window { touch-action: none; cursor: grab; }
.d9-image-wrap:active, .image-window.is-zoomed:active { cursor: grabbing; }
.d9-image-wrap img, .image-window img { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.d9-stage[hidden], .d9-browser[hidden], .d9-back[hidden], .d9-tool[hidden] { display: none; }
@media (max-width: 760px) {
  .d9-head { flex-wrap: nowrap; gap: 8px; }
  .d9-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .d9-tools { gap: 2px; }
  .d9-tool { width: 30px; height: 34px; }
  .d9-stage, .stage { grid-template-columns: minmax(0, 1fr); }
  .d9-image-wrap, .image-window { grid-column: 1; grid-row: 1; }
  .d9-nav, .nav-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); background: var(--cp-panel-strong); opacity: .75; }
  #d9Prev, #previous { left: 6px; }
  #d9Next, #next { right: 6px; }
}
@media (prefers-reduced-motion: reduce) { .album-tile { transition: none; } }
