    /* =================== PHOTO LIGHTBOX =================== */
    .lightbox {
      position: fixed;
      inset: 0;
      z-index: 1000;
      background: rgba(var(--ink-rgb), 0.28);
      -webkit-backdrop-filter: blur(0px);
      backdrop-filter: blur(0px);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.36s ease, backdrop-filter 0.36s ease, -webkit-backdrop-filter 0.36s ease, visibility 0s linear 0.36s;
      touch-action: none;
    }

    .lightbox.open {
      opacity: 1;
      visibility: visible;
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
      transition: opacity 0.36s ease, backdrop-filter 0.36s ease, -webkit-backdrop-filter 0.36s ease;
    }

    .lb-photo {
      position: fixed;
      z-index: 1001;
      display: none;
      object-fit: cover;
      pointer-events: none;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
      will-change: top, left, width, height, border-radius, opacity;
    }

    .lb-photo.on {
      display: block;
    }

    .lb-controls {
      position: fixed;
      inset: 0;
      z-index: 1002;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.36s ease, visibility 0s linear 0.36s;
    }

    .lightbox.open ~ .lb-controls {
      opacity: 1;
      visibility: visible;
      transition: opacity 0.36s ease;
    }

    .lightbox.open ~ .lb-controls .lb-btn {
      pointer-events: auto;
    }

    .lb-btn {
      position: absolute;
      z-index: 2;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      background: rgba(0, 0, 0, 0.32);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      cursor: pointer;
      transition: opacity 0.2s ease, transform 0.15s ease;
    }

    .lb-btn:active {
      transform: scale(0.92);
    }

    .lb-btn[disabled] {
      opacity: 0;
      pointer-events: none;
    }

    .lb-close {
      top: max(16px, env(safe-area-inset-top));
      right: 16px;
      width: 36px;
      height: 36px;
    }

    .lb-prev,
    .lb-next {
      top: 50%;
      margin-top: -21px;
    }

    .lb-prev { left: 12px; }
    .lb-next { right: 12px; }

    .lb-caption {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 2;
      padding: 16px 22px max(20px, env(safe-area-inset-bottom));
      text-align: center;
      color: #fff;
      text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
    }

    .lb-title {
      font-size: 17px;
      font-weight: 700;
    }

    .lb-meta {
      font-size: 12.5px;
      font-weight: 600;
      opacity: 0.85;
      margin-top: 4px;
    }

    /* =================== SCREEN 9: GALLERY =================== */
    /* Sits above the detail screen's hero illustration (z 58), below the photo. */
    #gallery-view {
      background: var(--gallery-bg);
      z-index: 59;
    }

    .gallery-stage {
      margin: calc(max(16px, env(safe-area-inset-top)) + 54px) 18px 0;
      height: var(--gallery-stage-h, 46%);
      border-radius: var(--gallery-radius, 28px);
      overflow: hidden;
      flex-shrink: 0;
      background: var(--gallery-stage);
    }

    .gallery-info {
      padding: 18px 22px 0;
      opacity: 0;
      transform: translateY(14px);
      transition: transform 0.46s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.4s ease;
    }

    #gallery-view.gallery-revealed .gallery-info {
      opacity: 1;
      transform: translateY(0);
      transition-delay: 0.12s;
    }

    .gallery-title {
      color: var(--gallery-ink);
    }

    .gallery-count {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--gallery-meta);
      margin-top: 5px;
    }

    .gallery-strip {
      display: flex;
      gap: 10px;
      padding: 18px 22px max(20px, env(safe-area-inset-bottom));
      margin-top: auto;
      opacity: 0;
      transform: translateY(18px);
      transition: transform 0.48s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.42s ease;
    }

    #gallery-view.gallery-revealed .gallery-strip {
      opacity: 1;
      transform: translateY(0);
      transition-delay: 0.18s;
    }

    .gallery-thumb {
      flex: 1;
      height: var(--gallery-thumb-h, 56px);
      border-radius: 14px;
      overflow: hidden;
      cursor: pointer;
      position: relative;
      border: 2px solid transparent;
      transition: border-color 0.22s ease, transform 0.15s ease;
    }

    .gallery-thumb.active {
      border-color: var(--accent);
    }

    .gallery-thumb:active {
      transform: scale(0.94);
    }

    .gallery-thumb svg {
      width: 100%;
      height: 100%;
      display: block;
    }

    /* The persistent photo object that travels thumbnail → gallery stage */
    #shotArt {
      position: fixed;
      display: none;
      overflow: hidden;
      pointer-events: none;
      z-index: 62;
      background: var(--gallery-stage);
      will-change: top, left, width, height, border-radius;
    }

    #shotArt.shot-on {
      display: block;
    }

    #shotPlate {
      position: absolute;
      inset: 0;
      transition: opacity 0.16s ease;
    }

    #shotPlate > svg {
      width: 100%;
      height: 100%;
      display: block;
    }

    .marker-avatar-bubble.has-hero {
      border-color: transparent;
      box-shadow: none;
      background: transparent;
    }

