/* ──────────────────────────────────────────────────────────────────────
   Public user profile (Mika-Tanaka mockup spec).

   Layout, dark-mode first:
   - Wide centred page (max ~1280px), two columns: left main, right rail.
   - Main column = banner-hero header card → 4-up stats grid → bio card →
     tab strip → activity panes.
   - Right rail = Trophies card, Active-in card, Places-mentioned card.

   Tokens come from the global theme when available (--gp-*) and fall back
   to dark-mode sensible defaults so this page renders standalone in a
   storybook / preview shell. The Tailwind `hidden` class is used by tabs
   via the `hidden` HTML attribute, so the `.pp-pane[hidden]` rule below
   keeps it absolute even when `.is-active` would otherwise show the pane.
   ───────────────────────────────────────────────────────────────────── */

.pp-page {
    --pp-bg:        #0d111a;
    --pp-card:      #131826;
    --pp-card-2:    #1a2030;
    --pp-border:    #232a3c;
    --pp-text:      #e6e8ec;
    --pp-text-2:    #b8c0cf;
    --pp-text-3:    #8b93a3;
    --pp-pill-bg:       #1a2030;
    --pp-pill-bg-hover: #232a3c;
    --pp-accent:    #E05A2B;
    --pp-accent-h:  #c84f24;
    --pp-blue:      #3b82f6;
    --pp-amber:     #F2B544;
    --pp-emerald:   #22c55e;
    --pp-pink:      #ec4899;

    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 96px;
    color: var(--pp-text);
}

.pp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}
@media (max-width: 960px) {
    .pp-grid { grid-template-columns: minmax(0, 1fr); }
    .pp-aside { order: 2; }
}

/* ════════════════════════ HEADER CARD ════════════════════════════════ */
.pp-header-card {
    /* No `overflow: hidden` here — the kebab menu pops out of this card
       and would get clipped. The banner has its own border-radius mask
       so the gradient still clips correctly inside the rounded card. */
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 16px;
    margin-bottom: 16px;
    position: relative;
}
.pp-banner {
    height: 200px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(60% 90% at 12% 20%, rgba(224,90,43,0.32), transparent 70%),
        radial-gradient(70% 110% at 88% 100%, rgba(34,197,94,0.18), transparent 70%),
        linear-gradient(135deg, #1d2233 0%, #0f1320 100%);
}
/* When a user-uploaded image is set the inline style provides
   background-image + background-position. cover fills the banner;
   the Y position (set via reposition drag) picks the crop. */
.pp-banner--has-image {
    background-size: cover;
    background-repeat: no-repeat;
}
.pp-banner--clickable {
    cursor: pointer;
    transition: filter 0.18s ease;
}
.pp-banner--clickable:hover { filter: brightness(0.85); }
.pp-header-body {
    position: relative;
    padding: 0 24px 22px;
}
.pp-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    margin-top: -64px;
    border-radius: 9999px;
    background: var(--pp-accent);
    border: 4px solid var(--pp-card);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.pp-avatar--clickable {
    cursor: pointer;
    transition: transform 0.18s ease;
}
.pp-avatar--clickable:hover { transform: scale(1.05); }
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pp-identity { margin-top: 14px; }
.pp-identity-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.pp-name {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--pp-text);
    line-height: 1.1;
}
.pp-meta {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--pp-text-3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.pp-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 9999px;
    background: var(--pp-text-3);
    opacity: 0.7;
}

.pp-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

.pp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--pp-border);
    color: var(--pp-text-2);
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}
.pp-chip--accent {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.35);
    color: #6ee7a4;
}
.pp-chip-dot {
    width: 6px; height: 6px;
    border-radius: 9999px;
    background: var(--pp-text-3);
    display: inline-block;
}
.pp-chip-dot--green { background: var(--pp-emerald); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.pp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9999px;
    background: transparent;
    color: var(--pp-text);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pp-btn--ghost {
    background: transparent;
    border: 1px solid var(--pp-border);
    color: var(--pp-text-2);
}
.pp-btn--ghost:hover {
    background: rgba(255,255,255,0.05);
    color: var(--pp-text);
}
.pp-btn--primary {
    background: var(--pp-accent);
    color: #fff;
    font-weight: 700;
}
.pp-btn--primary:hover { background: var(--pp-accent-h); }
.pp-btn--primary:disabled { opacity: 0.65; cursor: default; }
.pp-btn--primary.is-following {
    background: transparent;
    color: var(--pp-text);
    border: 1px solid var(--pp-border);
}
.pp-btn--primary.is-following:hover {
    background: rgba(239,68,68,0.10);
    color: #f87171;
    border-color: #f87171;
}
.pp-btn--primary.is-following .pp-follow-glyph { display: none; }
.pp-follow-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    background: rgba(255,255,255,0.18);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

/* ── Kebab + menu ────────────────────────────────────────────────────── */
.pp-kebab-wrap { position: relative; }
.pp-kebab {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: transparent;
    border: 1px solid var(--pp-border);
    color: var(--pp-text-2);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.pp-kebab:hover { background: rgba(255,255,255,0.05); color: var(--pp-text); }
.pp-menu {
    position: absolute;
    right: 0;
    top: 44px;
    min-width: 200px;
    background: var(--pp-card-2);
    border: 1px solid var(--pp-border);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.45);
    padding: 6px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pp-menu[hidden] { display: none; }
.pp-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 0;
    color: var(--pp-text);
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
}
.pp-menu-item:hover { background: rgba(255,255,255,0.06); }
.pp-menu-item--danger { color: #f87171; }
.pp-menu-item--danger:hover { background: rgba(239,68,68,0.10); }

/* ════════════════════════ STATS GRID ═════════════════════════════════ */
.pp-stats-grid {
    /* Auto-fit keeps tiles ~160px wide minimum and equally distributes the
       remaining space. When the view hides zero-count tiles (Razor skips
       them), the surviving ones grow to fill the row instead of leaving
       a dead gap — no media-query branching needed for the count. */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 560px) {
    .pp-stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
.pp-stat {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    padding: 16px 18px;
}
.pp-stat-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--pp-text);
    line-height: 1.1;
}
.pp-stat-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--pp-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.pp-stat-label--with-tip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Tooltip (used by the Stamps stat) ────────────────────────────────
   Native `title` attributes are ugly and don't support multi-line copy,
   so we hand-roll a hover/focus bubble. The trigger is keyboard-focusable
   (tabindex=0 + role=button on the parent), and the bubble itself is
   pointer-events:none on a fresh page so it doesn't trap clicks until
   the user actually hovers. */
.pp-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: var(--pp-text-3);
    cursor: help;
    outline: none;
}
.pp-tip:hover,
.pp-tip:focus-visible { color: var(--pp-text); }
.pp-tip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: var(--pp-card-2);
    border: 1px solid var(--pp-border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--pp-text);
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
    box-shadow: 0 12px 28px rgba(0,0,0,0.40);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
    z-index: 25;
}
.pp-tip:hover .pp-tip-bubble,
.pp-tip:focus-visible .pp-tip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.pp-tip-bubble strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--pp-text);
    margin-bottom: 4px;
}
.pp-tip-tips {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--pp-border);
    color: var(--pp-text-2);
}
/* Caret pointing down at the trigger. */
.pp-tip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--pp-card-2);
}

/* On narrow screens the bubble would overflow the right edge of the
   first stat tile; pin it to the left of the trigger instead. */
@media (max-width: 560px) {
    .pp-tip-bubble {
        left: 0;
        transform: translateX(0) translateY(4px);
        width: 220px;
    }
    .pp-tip:hover .pp-tip-bubble,
    .pp-tip:focus-visible .pp-tip-bubble {
        transform: translateX(0) translateY(0);
    }
    .pp-tip-bubble::after { left: 12px; transform: none; }
}

/* ════════════════════════ BIO ═══════════════════════════════════════ */
.pp-bio-card {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.pp-card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pp-text-3);
    font-weight: 700;
}
.pp-bio-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pp-text);
}

/* ════════════════════════ TABS ═══════════════════════════════════════ */
.pp-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--pp-border);
    margin-bottom: 18px;
    /* Keep horizontal scroll capability for narrow viewports where the six
       tabs don't all fit, but hide the scrollbar chrome — Edge/Chrome on
       Windows otherwise paints a reserved scroll gutter at desktop widths
       even when nothing actually needs scrolling. */
    overflow-x: auto;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* legacy Edge / IE */
}
.pp-tabs::-webkit-scrollbar { display: none; }
.pp-tab {
    background: transparent;
    border: 0;
    color: var(--pp-text-3);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 14px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.pp-tab:hover { color: var(--pp-text); }
.pp-tab.is-active {
    color: var(--pp-text);
    border-bottom-color: var(--pp-accent);
}

/* ── Panes ───────────────────────────────────────────────────────────── */
.pp-pane { display: none; }
.pp-pane.is-active { display: block; }
.pp-pane[hidden] { display: none; }

.pp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.pp-section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.pp-section-link {
    font-size: 13px;
    color: var(--pp-text-3);
    text-decoration: none;
}
.pp-section-link:hover { color: var(--pp-accent); }

.pp-empty,
.pp-feed-empty {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    color: var(--pp-text-3);
    font-size: 13px;
    text-align: center;
    padding: 36px 16px;
}

/* ════════════════════════ ACTIVITY CARDS ═════════════════════════════ */
.profile-feed-card {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.profile-feed-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--pp-text-3);
    margin-bottom: 6px;
}
.profile-feed-kind {
    /* Indigo by default — matches the COMMENT pill on the comment card so
       a generic POST and a COMMENT share the same visual rhythm. Typed
       posts (poll / itinerary / photo / tripreport) override the colour
       below so the feed scans at a glance. */
    background: rgba(99,102,241,0.18);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.profile-feed-kind--poll       { background: rgba(168, 85,247,0.20); color: #c4b5fd; }
.profile-feed-kind--itinerary  { background: rgba(224, 90, 43,0.20); color: #fdba74; }
.profile-feed-kind--photo      { background: rgba( 14,165,233,0.20); color: #7dd3fc; }
.profile-feed-kind--tripreport { background: rgba( 34,197, 94,0.20); color: #86efac; }
.profile-feed-community {
    color: var(--pp-text);
    font-weight: 600;
    text-decoration: none;
}
.profile-feed-community:hover { text-decoration: underline; }
.dot-sep::before { content: '·'; opacity: 0.6; }
.profile-feed-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--pp-text);
    text-decoration: none;
    margin: 0 0 6px;
    line-height: 1.3;
}
.profile-feed-title:hover { color: var(--pp-accent); }
.profile-feed-title--sm { font-size: 14px; font-weight: 600; }
.profile-feed-body {
    margin: 0;
    font-size: 14px;
    color: var(--pp-text-2);
    line-height: 1.55;
}
.profile-feed-body--redacted { color: var(--pp-text-3); font-style: italic; }
.profile-feed-body .pp-inline-img,
.pp-inline-img {
    /* Inline image embedded in a post / comment body. Cap the height so a
       data: URI screenshot doesn't push the card a thousand pixels tall;
       width caps to the card so wide images shrink instead of overflowing. */
    display: block;
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    margin: 8px 0;
    border-radius: 10px;
    border: 1px solid var(--pp-border);
    background: rgba(0,0,0,0.20);
    object-fit: contain;
}
.profile-feed-card-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--pp-text-3);
}
.profile-feed-stat {
    color: var(--pp-text-3);
    text-decoration: none;
}
.profile-feed-stat:hover { color: var(--pp-text); }
.profile-feed-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--pp-pill-bg);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pp-text-3);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.profile-feed-pill:hover {
    background: var(--pp-pill-bg-hover);
    color: var(--pp-text);
}

/* ── Trips grid (Trips tab + guide cards in Overview) ────────────────── */
.pp-trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.profile-guide-card {
    display: block;
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: var(--pp-text);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.profile-guide-card:hover { transform: translateY(-2px); border-color: var(--pp-accent); }
.profile-guide-cover {
    aspect-ratio: 16 / 9;
    background: #2a2f3a center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.profile-guide-cover-placeholder {
    color: var(--pp-text-3);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.profile-guide-body { padding: 12px 14px 14px; }
.profile-guide-dest {
    margin: 0;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--pp-text-3);
}
.profile-guide-title {
    margin: 4px 0 6px;
    font-size: 15px; font-weight: 700; line-height: 1.3;
}
.profile-guide-meta {
    margin: 0;
    font-size: 12px;
    color: var(--pp-text-3);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}

/* ════════════════════════ RIGHT RAIL ═════════════════════════════════ */
.pp-aside { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 960px) { .pp-aside { position: static; } }

.pp-side-card {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    padding: 16px 18px;
}
.pp-side-title {
    margin: 0 0 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pp-text-3);
    font-weight: 700;
}
.pp-side-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.pp-side-eyebrow {
    font-size: 11px;
    color: var(--pp-text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Trophies */
.pp-trophy-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.pp-trophy {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--pp-border);
    border-radius: 9999px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--pp-text-2);
}
.pp-trophy-dot {
    width: 8px; height: 8px;
    border-radius: 9999px;
    flex-shrink: 0;
}
.pp-trophy-dot--amber   { background: var(--pp-amber); }
.pp-trophy-dot--emerald { background: var(--pp-emerald); }
.pp-trophy-dot--orange  { background: var(--pp-accent); }
.pp-trophy-dot--blue    { background: var(--pp-blue); }

/* Active in */
.pp-active-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-active-row {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--pp-text);
    font-size: 14px;
    font-weight: 500;
}
.pp-active-row:hover .pp-active-monogram { transform: scale(1.04); }
.pp-active-monogram {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    transition: transform 0.15s ease;
    background: var(--pp-accent);
}
.pp-active-monogram--orange { background: var(--pp-accent); }
.pp-active-monogram--amber  { background: var(--pp-amber); color: #1a1a1a; }
.pp-active-monogram--pink   { background: var(--pp-pink); }
.pp-active-monogram--green  { background: var(--pp-emerald); color: #1a1a1a; }
.pp-active-monogram--blue   { background: var(--pp-blue); }

/* Places mentioned */
.pp-map-placeholder {
    /* Clean grid texture — no fake position dots. Once geo-coords for posts
       and guides land we can wire a real Leaflet/MapLibre canvas here and
       drop pins at actual destinations. */
    height: 140px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.0)),
        repeating-linear-gradient(0deg,  transparent 0 18px, rgba(255,255,255,0.04) 18px 19px),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.04) 18px 19px),
        var(--pp-card-2);
    margin-bottom: 12px;
    border: 1px solid var(--pp-border);
    position: relative;
}
.pp-map-placeholder::after {
    content: 'Map view coming soon';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pp-text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    opacity: 0.65;
}
.pp-places-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-places-list li {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}
.pp-place-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pp-text);
}
.pp-place-name svg { color: var(--pp-accent); }
.pp-place-count { color: var(--pp-text-3); font-size: 12px; }

/* ════════════════════════ DIALOG + TOAST ═════════════════════════════ */
.pp-dialog {
    position: fixed; inset: 0;
    z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pp-dialog[hidden] { display: none; }
.pp-dialog-backdrop { position: absolute; inset: 0; background: rgba(8,12,20,0.62); }
.pp-dialog-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.50);
}
.pp-dialog-panel h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.pp-dialog-help { margin: 0 0 12px; font-size: 13px; color: var(--pp-text-3); }
.pp-dialog-panel textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--pp-border);
    border-radius: 10px;
    color: var(--pp-text);
    padding: 10px 12px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}
.pp-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pp-dialog-error { margin: 10px 0 0; font-size: 12px; color: #f87171; }

.pp-toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%);
    background: var(--pp-card-2);
    color: var(--pp-text);
    border: 1px solid var(--pp-border);
    border-radius: 9999px;
    padding: 10px 18px;
    font-size: 13px;
    z-index: 60;
    box-shadow: 0 6px 16px rgba(0,0,0,0.40);
}

/* ════════════════════════ LIGHT MODE ═════════════════════════════════ */
/* Trigger when html does NOT have .dark (matches the app's convention). */
html:not(.dark) .pp-page {
    --pp-bg:        #f6f7f9;
    --pp-card:      #ffffff;
    --pp-card-2:    #ffffff;
    --pp-border:    #e5e7eb;
    --pp-pill-bg:       #eff1f3;
    --pp-pill-bg-hover: #e5e7eb;
    --pp-text:      #0f172a;
    --pp-text-2:    #334155;
    --pp-text-3:    #64748b;
}
html:not(.dark) .pp-banner:not(.pp-banner--has-image) {
    background:
        radial-gradient(60% 90% at 12% 20%, rgba(224,90,43,0.20), transparent 70%),
        radial-gradient(70% 110% at 88% 100%, rgba(34,197,94,0.14), transparent 70%),
        linear-gradient(135deg, #eef2f7 0%, #dde3ee 100%);
}
html:not(.dark) .pp-avatar { border-color: #ffffff; }
html:not(.dark) .pp-chip   { background: #f1f5f9; }
html:not(.dark) .pp-chip--accent { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
html:not(.dark) .pp-btn--ghost:hover { background: #f1f5f9; }
html:not(.dark) .pp-menu   { background: #ffffff; }
html:not(.dark) .pp-menu-item:hover { background: #f1f5f9; }
html:not(.dark) .pp-trophy { background: #f8fafc; }
html:not(.dark) .pp-map-placeholder {
    background:
        linear-gradient(180deg, rgba(0,0,0,0.01), rgba(0,0,0,0.0)),
        repeating-linear-gradient(0deg,  transparent 0 18px, rgba(15,23,42,0.05) 18px 19px),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(15,23,42,0.05) 18px 19px),
        #f8fafc;
}
html:not(.dark) .pp-dialog-panel textarea { background: #f9fafb; }

/* ═══════════════════ Image lightbox ════════════════════════════════════ */
.pp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    cursor: zoom-out;
    animation: ppLbFade 0.18s ease;
}
.pp-lightbox.hidden { display: none; }
@keyframes ppLbFade { from { opacity: 0; } to { opacity: 1; } }
.pp-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    cursor: default;
}
.pp-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.pp-lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ════════════════════════ MOBILE TWEAKS ══════════════════════════════ */
@media (max-width: 560px) {
    .pp-page { padding: 16px 14px 96px; }
    .pp-header-body { padding: 0 16px 18px; }
    .pp-banner { height: 140px; }
    .pp-avatar { width: 96px; height: 96px; margin-top: -50px; font-size: 34px; }
    .pp-name { font-size: 22px; }
    .pp-header-actions { width: 100%; justify-content: flex-end; }
    .pp-stat-value { font-size: 20px; }
    .pp-tabs { gap: 0; }
    .pp-tab { padding: 10px 10px; font-size: 13px; }
}

/* Inline destination link inside list-item post cards. Hover styling was moved
   here from inline onmouseover/onmouseout handlers to satisfy the strict CSP
   (no inline event handlers). */
.pp-dest-link {
    color: var(--gpc-text-3);
    text-decoration: none;
}
.pp-dest-link:hover {
    color: var(--gpc-accent);
    text-decoration: underline;
}
