
  .page {
    max-width: 480px;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 16px) + 10px) 18px 40px;
  }
  .gallery-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 400;
    margin: 0;
    color: #f2ede6;
  }
  .header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
  }
  .avatar-thumb {
    width: 52px; height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #2a2320;
  }
  .stats-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
  }
  .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(242,237,230,0.65);
  }
  .stat-item i {
    width: 16px;
    display: inline-flex;
    justify-content: center;
    font-style: normal;
  }
  .action-row {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
  }
  .action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 0;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .action-btn.ghost { background: rgba(255,255,255,0.08); color: #f2ede6; }
  .action-btn.primary { background: #f2ede6; color: #14100f; }

  
  .photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .photo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #241d1a;
    cursor: pointer;
  }
  .photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .photo-tag {
    position: absolute;
    top: 8px; left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  }
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(242,237,230,0.45);
    font-size: 13px;
    grid-column: 1 / -1;
  }
  .gallery-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #f2ede6;
    color: #14100f;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 40;
  }
  .gallery-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,8,7,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 20px;
    padding-top: calc(env(safe-area-inset-top, 20px) + 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
  }
  .lightbox.open { display: flex; }
  .lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
  .lightbox-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 16px) + 14px);
    right: 18px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #f2ede6;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 31;
  }
  .lightbox-tag {
    position: absolute;
    left: 18px;
    bottom: calc(env(safe-area-inset-bottom, 16px) + 14px);
    color: #f2ede6;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  }
/* Camera Engine v3: portrait presentation + non-destructive film overlay. */
.photo-card.has-film::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(circle at center, transparent 54%, rgba(0,0,0,.10) 100%),
    repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.025) 0 1px, rgba(0,0,0,.018) 1px 2px, transparent 2px 4px);
  mix-blend-mode: soft-light; opacity: .42;
}
.photo-card .photo-tag { z-index: 2; }

.gallery-load-sentinel {
  width: 100%;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 10px 0 18px;
  color: rgba(255,255,255,.48);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gallery-load-sentinel[hidden] { display: none; }

/* Explicit photo-library upload action */
.gallery-action-row{flex-wrap:wrap}
.gallery-action-row .compact-action{flex:0 0 42px}
.gallery-action-row .upload-action,.gallery-action-row .capture-action{flex:1 1 150px}
@media(max-width:430px){
  .gallery-action-row .upload-action,.gallery-action-row .capture-action{flex-basis:calc(50% - 50px);font-size:12px}
}
