/* ═══════════════════════════════════════════════════════════════
   Made by Luvokx — assets/css/style.css
   Dark-mode first · Mobile-first · Instagram-style photo feed
   ═══════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ────────────────────────────────────────── */
:root {
    --c-bg:          #ffffff;
    --c-surface:     #f5f5f5;
    --c-surface-2:   #ebebeb;
    --c-border:      rgba(0,0,0,0.10);
    --c-text:        #111111;
    --c-text-muted:  rgba(0,0,0,0.50);
    --c-accent:      #ff6b00;
    --c-accent-2:    #ff9500;
    --c-like:        #ff4b6e;
    --c-white:       #ffffff;

    --glass-bg:      rgba(255,255,255,0.80);
    --glass-blur:    saturate(180%) blur(20px);
    --glass-border:  rgba(0,0,0,0.10);

    --nav-h:         68px;
    --safe-bottom:   env(safe-area-inset-bottom, 0px);

    --f-display:     'Montserrat', sans-serif;
    --f-body:        'Montserrat', sans-serif;

    --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast:      150ms;
    --dur-base:      250ms;
    --dur-slow:      400ms;
}

/* ─── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body.pg-body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-body);
    font-weight: 400;
    line-height: 1.5;
    overscroll-behavior: none;
    overflow: hidden;
    height: 100dvh;
    height: 100vh;
}

a { color: inherit; text-decoration: none; }

button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

svg { display: block; fill: none; }

/* ─── APP WRAPPER ────────────────────────────────────────────── */
.pg-app {
    position: relative;
    width: 100%;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   LOGO (feed only)
   ══════════════════════════════════════════════════════════════ */
.pg-logo {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 14px 16px 10px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0.75) 0%, transparent 100%);
}
.pg-logo__text {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.pg-logo__img {
    height: 36px;
    width: auto;
    display: block;
}

/* ══════════════════════════════════════════════════════════════
   FEED — scrollable photo card feed
   ══════════════════════════════════════════════════════════════ */
.pg-feed {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
    padding-top: 60px;
}
.pg-feed::-webkit-scrollbar { display: none; }

/* ══════════════════════════════════════════════════════════════
   PHOTO CARD — post card in the feed
   ══════════════════════════════════════════════════════════════ */
.pg-photo-card {
    position: relative;
    width: 100%;
    max-width: 540px;
    margin: 0 auto 24px;
    background: var(--c-surface);
    border-radius: 0;
    overflow: hidden;
}

/* ── Card Header ───────────────────────────────────────────── */
.pg-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.pg-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--c-accent);
    flex-shrink: 0;
}
.pg-card-avatar--initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid var(--c-accent);
}

.pg-card-meta { flex: 1; min-width: 0; }
.pg-card-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--c-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pg-card-handle {
    font-size: 12px;
    color: var(--c-text-muted);
}

.pg-card-more {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-muted);
}

/* ── Carousel ──────────────────────────────────────────────── */
.pg-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #000;
    touch-action: pan-y;
    user-select: none;
}

.pg-carousel__track {
    display: flex;
    height: 100%;
    transition: transform 0.3s var(--ease-out);
    will-change: transform;
}

.pg-carousel__slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

.pg-carousel__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
}

/* Dot indicators */
.pg-carousel__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 5;
}
.pg-carousel__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    transition: background var(--dur-fast), transform var(--dur-fast);
}
.pg-carousel__dot.is-active {
    background: #fff;
    transform: scale(1.25);
}

/* Counter badge (when > 1 image) */
.pg-carousel__counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    z-index: 5;
}

/* Swipe arrows (optional) */
.pg-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity var(--dur-fast);
    pointer-events: none;
}
.pg-carousel:hover .pg-carousel__arrow { opacity: 1; pointer-events: auto; }
.pg-carousel__arrow--prev { left: 10px; }
.pg-carousel__arrow--next { right: 10px; }
.pg-carousel__arrow svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; }
@media (pointer: coarse) { .pg-carousel__arrow { display: none; } }

/* ── Card Actions (sidebar-style below image) ──────────────── */
.pg-card-actions {
    display: flex;
    align-items: center;
    padding: 10px 14px 6px;
    gap: 14px;
}

.pg-card-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--c-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
    -webkit-tap-highlight-color: transparent;
}
.pg-card-action-btn:active { transform: scale(0.85); }
.pg-card-action-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}
.pg-card-action-btn.is-liked { color: var(--c-like); }
.pg-card-action-btn.is-liked svg { stroke: var(--c-like); fill: var(--c-like); }
.pg-card-action-btn.ng-download-btn { color: var(--c-accent-2); }
.pg-card-action-btn.ng-download-btn svg { stroke: var(--c-accent-2); }

.pg-card-actions-spacer { flex: 1; }

/* ── Card Caption ──────────────────────────────────────────── */
.pg-card-caption {
    padding: 4px 14px 14px;
}
.pg-card-caption__name {
    font-weight: 700;
    font-size: 13px;
    margin-right: 5px;
}
.pg-card-caption__text {
    font-size: 13px;
    color: var(--c-text-muted);
    line-height: 1.5;
}

.pg-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.pg-tag {
    font-size: 11px;
    color: var(--c-accent-2);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════════════════
   FULLSCREEN CAROUSEL OVERLAY (click on attachment image)
   ══════════════════════════════════════════════════════════════ */
.pg-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 200;
    opacity: 0;
    transition: opacity var(--dur-base);
    pointer-events: none;
}
.pg-overlay-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.pg-overlay {
    position: fixed;
    inset: 0;
    z-index: 201;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
    pointer-events: none;
}
.pg-overlay.is-open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.pg-overlay__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
}

.pg-overlay__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.pg-overlay__close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; }
.pg-overlay__title {
    flex: 1;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pg-overlay__counter {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.pg-overlay__carousel {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.pg-overlay__track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.3s var(--ease-out);
}

.pg-overlay__slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0 80px;
}

.pg-overlay__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    cursor: zoom-in;
}
.pg-overlay__img.is-zoomed {
    cursor: zoom-out;
    transform: scale(1.8);
    transition: transform 0.3s var(--ease-out);
}

.pg-overlay__footer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 10px);
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    z-index: 5;
}

.pg-overlay__sidebar {
    position: absolute;
    right: 12px;
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 80px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Overlay action buttons match video theme */
.ng-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 56px;
    padding: 0;
    background: none;
    border: none;
    color: var(--c-white);
    font-family: var(--f-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: transform var(--dur-base) var(--ease-spring);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.ng-action-btn .ng-btn-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(12,12,22,0.72);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.ng-action-btn:active { transform: scale(0.88); }
.ng-action-btn:active .ng-btn-icon { background: rgba(255,255,255,0.08); }
.ng-icon {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ng-action-label {
    font-size: 10px;
    color: rgba(240,240,245,0.80);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}
.ng-creator-circle {
    position: relative;
    display: block;
    width: 52px;
    height: 52px;
}
.ng-creator-circle__img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
.ng-creator-circle__initial {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}
.ng-creator-circle__ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--c-accent);
    pointer-events: none;
}
.ng-download-btn .ng-btn-icon { border-color: rgba(0,229,255,0.25); }
.ng-download-btn .ng-icon { stroke: var(--c-accent-2); }

/* ══════════════════════════════════════════════════════════════
   MEGA FILE CTA banner (attachment.php)
   ══════════════════════════════════════════════════════════════ */
.pg-mega-cta {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, rgba(224,64,251,0.18), rgba(0,229,255,0.12));
    border: 1px solid rgba(224,64,251,0.35);
    border-radius: 12px;
    padding: 13px 18px;
    margin: 12px 14px;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--c-accent);
    letter-spacing: 0.02em;
    animation: pg-cta-pulse 2.8s ease-in-out infinite;
}
.pg-mega-cta:hover { color: var(--c-accent-2); border-color: rgba(0,229,255,0.45); }

@keyframes pg-cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224,64,251,0); }
    50%       { box-shadow: 0 0 0 6px rgba(224,64,251,0.12); }
}

/* ══════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.pg-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
}

.pg-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 8px 0;
    color: var(--c-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color var(--dur-fast);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.pg-nav-item.is-active { color: var(--c-text); }
.pg-nav-item.is-active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-accent);
}

.pg-nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-nav-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    transition: stroke var(--dur-fast);
}
.pg-nav-item.is-active .pg-nav-icon svg { stroke: var(--c-text); }
.pg-nav-label { font-size: 9px; }

/* ══════════════════════════════════════════════════════════════
   DISCOVER PAGE — Instagram-style search
   ══════════════════════════════════════════════════════════════ */
.pg-discover {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
    background: var(--c-bg);
}
.pg-discover::-webkit-scrollbar { display: none; }

.pg-search-bar-wrap {
    padding: 12px 14px 8px;
    position: sticky;
    top: 0;
    background: var(--c-bg);
    z-index: 50;
}

.pg-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 0 14px;
    height: 44px;
}
.pg-search-bar svg {
    width: 18px;
    height: 18px;
    stroke: var(--c-text-muted);
    stroke-width: 1.8;
    fill: none;
    flex-shrink: 0;
}
.pg-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 15px;
    font-weight: 400;
    caret-color: var(--c-accent);
}
.pg-search-input::placeholder { color: var(--c-text-muted); }
.pg-search-clear {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--c-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-bg);
    flex-shrink: 0;
    display: none;
}
.pg-search-clear.is-visible { display: flex; }
.pg-search-clear svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; }

/* Grid for discover results */
.pg-discover-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 4px 0;
}

.pg-discover-tile {
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: var(--c-surface);
    display: block;
}
.pg-discover-tile__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s var(--ease-out);
}
.pg-discover-tile:active .pg-discover-tile__img { transform: scale(0.95); }

.pg-discover-tile__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-discover-tile__badge svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 2;
}

/* ══════════════════════════════════════════════════════════════
   CREATOR PROFILE PAGE
   ══════════════════════════════════════════════════════════════ */
.pg-cp-root {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--c-bg);
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}
.pg-cp-root::-webkit-scrollbar { display: none; }

/* Cover */
.pg-cp-cover {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--c-surface);
}
.pg-cp-cover__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pg-cp-cover__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--c-bg) 100%);
}
.pg-cp-back {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 5;
}
.pg-cp-back svg { stroke: currentColor; }

/* Profile section */
.pg-cp-profile {
    margin-top: -52px;
    position: relative;
    z-index: 2;
    padding: 0 16px 20px;
    text-align: center;
}

.pg-cp-avatar-wrap { display: inline-block; margin-bottom: 10px; }
.pg-cp-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--c-bg);
    display: block;
}
.pg-cp-avatar--img { object-fit: cover; }
.pg-cp-avatar--initials {
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 32px;
    color: #fff;
}

/* Fapello-style: username above, handle below */
.pg-cp-name {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 20px;
    color: var(--c-text);
    margin-bottom: 2px;
}
.pg-cp-handle {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 14px;
}

.pg-cp-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 16px;
}
.pg-cp-stat {
    flex: 1;
    max-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.pg-cp-stat__num {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 18px;
    color: var(--c-text);
}
.pg-cp-stat__label {
    font-size: 11px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pg-cp-stat-divider {
    width: 1px;
    height: 32px;
    background: var(--c-border);
    flex-shrink: 0;
}

.pg-cp-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    color: #fff;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 50px;
    margin-bottom: 12px;
    transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.pg-cp-download-btn:active { opacity: 0.85; transform: scale(0.96); }
.pg-cp-download-btn svg { stroke: currentColor; }

.pg-cp-bio {
    font-size: 13px;
    color: var(--c-text-muted);
    line-height: 1.6;
    max-width: 360px;
    margin: 0 auto;
}

/* Grid section */
.pg-cp-grid-wrap { padding-top: 4px; }
.pg-cp-grid-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.pg-cp-grid-header svg { stroke: currentColor; }
.pg-cp-grid-count {
    margin-left: auto;
    background: var(--c-surface-2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
}

.pg-cp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.pg-cp-tile {
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background: var(--c-surface);
    display: block;
}
.pg-cp-tile__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.pg-cp-tile:active .pg-cp-tile__thumb { transform: scale(0.94); }
.pg-cp-tile__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface-2);
    color: var(--c-text-muted);
}
.pg-cp-tile__multi {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-cp-tile__multi svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2; }

.pg-cp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
}
.pg-cp-empty__icon { font-size: 48px; margin-bottom: 12px; }

/* ══════════════════════════════════════════════════════════════
   ATTACHMENT PAGE — single image
   ══════════════════════════════════════════════════════════════ */
.pg-attachment-root {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    background: var(--c-bg);
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}
.pg-attachment-root::-webkit-scrollbar { display: none; }

.pg-attachment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(to bottom, var(--c-bg) 80%, transparent);
    position: sticky;
    top: 0;
    z-index: 10;
}
.pg-attachment-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text);
}
.pg-attachment-back svg { stroke: currentColor; width: 18px; height: 18px; stroke-width: 2; }

.pg-attachment-creator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.pg-attachment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--c-accent);
}
.pg-attachment-avatar--initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
}
.pg-attachment-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main image */
.pg-attachment-img-wrap {
    position: relative;
    width: 100%;
    background: #000;
    max-height: 75vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-attachment-img {
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    cursor: pointer;
}

/* Mega CTA */
.pg-mega-cta-wrap {
    padding: 0;
}

/* Post info */
.pg-attachment-info {
    padding: 8px 14px 16px;
}
.pg-attachment-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}
.pg-attachment-desc {
    font-size: 13px;
    color: var(--c-text-muted);
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   SHARE SHEET
   ══════════════════════════════════════════════════════════════ */
.pg-share-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 300;
    background: var(--c-surface);
    border-radius: 24px 24px 0 0;
    padding: 20px 16px calc(var(--safe-bottom) + 20px);
    transform: translateY(100%);
    transition: transform var(--dur-base) var(--ease-out);
    border-top: 1px solid var(--c-border);
}
.pg-share-sheet.is-open { transform: translateY(0); }
.pg-share-sheet__title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    margin-bottom: 16px;
}
.pg-share-sheet__actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.pg-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 14px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-size: 12px;
    font-weight: 600;
    transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.pg-share-option:active { transform: scale(0.93); background: rgba(255,255,255,0.08); }
.pg-share-icon { font-size: 22px; }
.pg-share-sheet__close {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    background: var(--c-surface-2);
    color: var(--c-text-muted);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}
.pg-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 299;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base);
}
.pg-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATES & MISC
   ══════════════════════════════════════════════════════════════ */
.pg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 12px;
    color: var(--c-text-muted);
}
.pg-empty-icon { font-size: 48px; }

.pg-spinner {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 24px;
}
.pg-spinner span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-accent);
    animation: pg-bounce 1.2s ease-in-out infinite;
}
.pg-spinner span:nth-child(2) { animation-delay: 0.2s; }
.pg-spinner span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pg-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1); opacity: 1; }
}

.pg-sentinel {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

/* ══════════════════════════════════════════════════════════════
   AD SLOT
   ══════════════════════════════════════════════════════════════ */
.pg-ad-slot {
    width: 100%;
    max-width: 540px;
    margin: 0 auto 24px;
    padding: 0 14px;
    text-align: center;
}
.pg-ad-label {
    font-size: 9px;
    color: var(--c-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
