/* ════════════════════════════════════════════════════════════
   PGH TRADE STREAM — Clean Card Style (image-left, light)
   Font: Outfit + DM Sans
════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

#pgh-stream-wrap {
    --red:        #c0392b;
    --red-dark:   #96281b;
    --red-soft:   #fdf2f1;
    --charcoal:   #1a1a1a;
    --charcoal2:  #2d2d2d;
    --text:       #1a1a1a;
    --text-muted: #888888;
    --text-light: #9ca3af;
    --green:      #16a34a;
    --green-soft: #f0fdf4;
    --sold:       #7c3aed;
    --sold-soft:  #f5f3ff;
    --teal:       #0d9488;
    --teal-soft:  #f0fdfa;
    --divider:    #eeeeee;
    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  10px;
    --bg:         #ffffff;

    font-family: 'DM Sans', sans-serif;
    color:       var(--text);
    width:       100%;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    overflow: hidden;
    margin:      0 0 32px 0;
}

#pgh-stream-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── HEADER ────────────────────────────────────────────────── */
.pgh-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    background:      var(--charcoal);
    padding:         10px 14px;
    border-radius:   var(--radius) var(--radius) 0 0;
    border-bottom:   3px solid var(--red);
}
.pgh-header-left { display: flex; align-items: center; gap: 12px; }
.pgh-header-right { display: flex; align-items: center; gap: 10px; }

.pgh-live-dot {
    width: 10px; height: 10px;
    background: #22c55e; border-radius: 50%;
    animation: pgh-pulse 2s infinite; flex-shrink: 0;
}
@keyframes pgh-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.pgh-header-title {
    font-family: 'Outfit', sans-serif;
    font-size:   14px;
    font-weight: 700;
    color:       #fff;
    letter-spacing: -.2px;
}
.pgh-header-sub {
    font-size:    10px;
    color:        #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top:   1px;
}

/* ── POST LISTING BUTTON ───────────────────────────────────── */
.pgh-post-listing-btn {
    font-family:  'Outfit', sans-serif;
    font-weight:  700;
    font-size:    14px;
    background:   transparent;
    color:        #fff;
    border:       2px solid rgba(255,255,255,.6);
    border-radius: var(--radius-sm);
    padding:      9px 20px;
    cursor:       pointer;
    transition:   all .15s;
    letter-spacing: .2px;
}
.pgh-post-listing-btn:hover {
    background:   rgba(255,255,255,.1);
    border-color: #fff;
}

.pgh-login-link {
    font-size: 13px; color: rgba(255,255,255,.65);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.2);
    padding: 8px 16px; border-radius: var(--radius-sm);
    transition: all .15s;
}
.pgh-login-link:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* ── FEED ──────────────────────────────────────────────────── */
#pgh-feed { background: var(--bg); }

.pgh-loading, .pgh-empty {
    text-align: center; padding: 40px 20px;
    color: var(--text-muted); font-size: 15px;
}

/* ══════════════════════════════════════════════════════════════
   POST CARD — image left, content right
══════════════════════════════════════════════════════════════ */
.pgh-post {
    display:       flex;
    gap:           20px;
    padding:       14px 16px;
    border-bottom: 1px solid var(--divider);
    background:    var(--bg);
    transition:    background .12s;
    animation:     pgh-slide-in .22s ease;
    align-items:   flex-start;
}
.pgh-post:last-child { border-bottom: none; }
.pgh-post:hover      { background: #fafafa; }

@keyframes pgh-slide-in {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:none; }
}

/* Left: thumbnail */
.pgh-post-thumb {
    flex-shrink:     0;
    width:           60px;
    height:          60px;
    border-radius:   8px;
    background:      #f5f5f5;
    overflow:        hidden;
    display:         flex;
    align-items:     center;
    justify-content: center;
    border:          1px solid var(--divider);
}
.pgh-post-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.pgh-thumb-initials {
    font-family: 'Outfit', sans-serif;
    font-size:   22px; font-weight: 800;
    color:       var(--red); line-height: 1;
}

/* Right: content */
.pgh-post-content { flex: 1; min-width: 0; }

/* Top row: title + price badge */
.pgh-post-top {
    display:         flex;
    align-items:     flex-start;
    justify-content: space-between;
    gap:             12px;
    margin-bottom:   8px;
}
.pgh-post-item {
    font-family:  'Outfit', sans-serif;
    font-size:    15px; font-weight: 700;
    color:        var(--text);
    line-height:  1.25; flex: 1; min-width: 0;
}
.pgh-price-pill {
    font-family:   'Outfit', sans-serif;
    font-weight:   800;
    font-size:     14px;
    color:         var(--teal);
    white-space:   nowrap;
    flex-shrink:   0;
    letter-spacing: -.3px;
}
.pgh-price-pill.sold-pill { color: var(--sold); }

/* Meta row */
.pgh-post-meta-row {
    display:     flex; align-items: center;
    gap:         12px; flex-wrap: wrap; margin-bottom: 6px;
}
.pgh-meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 12.5px; color: var(--text-muted); font-weight: 500;
}
.pgh-meta-item .pgh-meta-icon { font-size: 14px; }
.pgh-meta-item strong { color: var(--text); font-weight: 600; }

.pgh-cat-chip {
    font-family:   'Outfit', sans-serif;
    font-weight:   700; font-size: 10.5px;
    letter-spacing: .8px; padding: 3px 10px;
    border-radius: 20px; text-transform: uppercase;
}
.pgh-cat-WTS { background: var(--red-soft);  color: var(--red);   }
.pgh-cat-WTB { background: #eff6ff;          color: #2563eb;      }
.pgh-cat-WTT { background: var(--green-soft);color: var(--green); }

.pgh-sold-badge {
    font-family:   'Outfit', sans-serif; font-weight: 700;
    font-size:     11px; letter-spacing: .8px; padding: 3px 10px;
    border-radius: 20px; text-transform: uppercase;
    background:    var(--sold-soft); color: var(--sold);
}

/* Description */
.pgh-post-body {
    font-size:   14px; color: var(--text-muted);
    line-height: 1.55; margin-bottom: 10px; word-break: break-word;
}

/* Action bar */
.pgh-post-actions {
    display:     flex; align-items: center;
    gap:         4px; flex-wrap: wrap; margin-top: 4px;
}
.pgh-action-btn {
    font-family:  'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600;
    color:        var(--text-muted); background: none; border: none;
    border-radius: var(--radius-sm); padding: 4px 10px;
    cursor:       pointer; transition: all .13s;
    display:      inline-flex; align-items: center; gap: 4px;
}
.pgh-action-btn:hover  { background: #f3f4f6; color: var(--text); }
.pgh-like-btn.liked    { color: var(--red); }
.pgh-reply-btn.open    { color: #2563eb; background: #eff6ff; }
.pgh-action-sep        { color: #e0e0e0; padding: 0 2px; font-size: 13px; }
.pgh-approve-btn       { color: var(--green) !important; }
.pgh-approve-btn:hover { background: var(--green-soft) !important; }
.pgh-reject-btn        { color: #dc2626 !important; }
.pgh-reject-btn:hover  { background: #fef2f2 !important; }

/* ── REPLIES ───────────────────────────────────────────────── */
.pgh-replies-wrap      { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.pgh-replies-wrap.open { display: block; }

.pgh-reply { display: flex; gap: 9px; margin-bottom: 10px; animation: pgh-slide-in .18s ease; }
.pgh-reply-avatar  { width:28px;height:28px;border-radius:50%;object-fit:cover;flex-shrink:0; }
.pgh-reply-body    { flex:1; }
.pgh-reply-name    { font-weight:700;font-size:13px;color:var(--text); }
.pgh-reply-time    { font-size:10.5px;color:var(--text-light);margin-left:5px; }
.pgh-reply-text    { font-size:13.5px;color:var(--text);line-height:1.5;margin-top:2px;word-break:break-word; }
.pgh-reply-del     { font-size:11px;color:var(--text-light);background:none;border:none;cursor:pointer;padding:0 4px;margin-left:4px; }
.pgh-reply-del:hover { color:#dc2626; }

.pgh-reply-input-wrap { display:flex;gap:7px;align-items:flex-end;margin-top:8px; }
.pgh-reply-input {
    flex:1;background:#f9f9f9;border:1.5px solid #e8e8e8;
    border-radius:var(--radius-sm);color:var(--text);
    font-family:'DM Sans',sans-serif;font-size:13.5px;
    padding:7px 11px;resize:none;outline:none;
    min-height:36px;max-height:80px;transition:border-color .14s;
}
.pgh-reply-input:focus { border-color:var(--red); }
.pgh-reply-send {
    background:var(--red);border:none;border-radius:var(--radius-sm);
    color:#fff;cursor:pointer;font-size:15px;
    width:36px;height:36px;display:flex;align-items:center;
    justify-content:center;flex-shrink:0;transition:background .14s;
}
.pgh-reply-send:hover { background:var(--red-dark); }
.pgh-login-to-reply   { font-size:12.5px;color:var(--text-muted);margin-top:6px; }
.pgh-login-to-reply a { color:var(--red);text-decoration:none;font-weight:600; }

/* ── PAGINATION ────────────────────────────────────────────── */
.pgh-pagination {
    display:flex;align-items:center;justify-content:center;
    gap:4px;padding:16px 0;background:var(--bg);
    border-top:1px solid var(--divider);
    border-radius:0 0 var(--radius) var(--radius);
}
.pgh-page-btn {
    font-family:'Outfit',sans-serif;font-weight:600;font-size:13px;
    min-width:36px;height:36px;padding:0 10px;
    display:flex;align-items:center;justify-content:center;
    border:none;border-radius:var(--radius-sm);
    background:transparent;color:var(--text-muted);
    cursor:pointer;transition:all .13s;
}
.pgh-page-btn:hover  { background:#f3f4f6;color:var(--text); }
.pgh-page-btn.active { background:var(--red);color:#fff; }
.pgh-page-btn:disabled { opacity:.35;cursor:default; }

/* ── MODALS ────────────────────────────────────────────────── */
.pgh-modal {
    position:fixed;inset:0;background:rgba(10,10,10,.5);
    z-index:99999;display:flex;align-items:center;
    justify-content:center;backdrop-filter:blur(3px);
    animation:pgh-fade-in .18s ease;
}
@keyframes pgh-fade-in { from{opacity:0;}to{opacity:1;} }

.pgh-modal-inner {
    background:#fff;border-radius:var(--radius-lg);
    padding:28px;width:min(500px,95vw);
    box-shadow:0 24px 64px rgba(0,0,0,.16);
    animation:pgh-modal-in .2s ease;
    max-height:90vh;overflow-y:auto;
}
.pgh-modal-sm { width:min(380px,95vw); }
@keyframes pgh-modal-in { from{transform:translateY(16px);opacity:0;}to{transform:none;opacity:1;} }

.pgh-modal-head {
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid #f0f0f0;
    position: relative;
    z-index: 1;
}
.pgh-modal-head h3 {
    font-family:'Outfit',sans-serif;font-size:20px;
    font-weight:800;color:var(--text);
}
.pgh-modal-close {
    background:none;border:none;font-size:18px;color:var(--text-muted);
    cursor:pointer;padding:4px 7px;border-radius:5px;transition:background .12s;
}
.pgh-modal-close:hover { background:#f5f5f5; }

.pgh-field-row { margin-bottom:16px; }
.pgh-field-row label {
    display:block;font-size:11.5px;font-weight:700;
    color:var(--text-muted);margin-bottom:6px;
    text-transform:uppercase;letter-spacing:.5px;
}
.pgh-field-row input[type="text"],
.pgh-field-row input[type="number"],
.pgh-field-row textarea {
    width:100%;background:#f8f8f8;border:1.5px solid #ebebeb;
    border-radius:var(--radius-sm);color:var(--text);
    font-family:'DM Sans',sans-serif;font-size:14px;
    padding:10px 13px;outline:none;transition:border-color .14s;
}
.pgh-field-row input:focus,
.pgh-field-row textarea:focus { border-color:var(--red);background:#fff; }
.pgh-field-row textarea { resize:vertical;min-height:72px; }

.pgh-cat-toggle { display:flex;gap:8px;flex-wrap:wrap; }
.pgh-cat-btn {
    font-family:'DM Sans',sans-serif;font-weight:600;font-size:13px;
    padding:8px 16px;border:1.5px solid #ebebeb;border-radius:var(--radius-sm);
    background:#f8f8f8;color:var(--text-muted);cursor:pointer;transition:all .14s;
    display:flex;flex-direction:column;align-items:center;line-height:1.2;
}
.pgh-cat-btn small     { font-size:10px;color:var(--text-light);font-weight:400; }
.pgh-cat-btn.active    { border-color:var(--red);color:var(--red);background:var(--red-soft); }
.pgh-cat-btn.active small { color:var(--red);opacity:.7; }

.pgh-price-wrap {
    display:flex;align-items:center;
    border:1.5px solid #ebebeb;border-radius:var(--radius-sm);
    overflow:hidden;background:#f8f8f8;transition:border-color .14s;
}
.pgh-price-wrap:focus-within { border-color:var(--red);background:#fff; }
.pgh-currency {
    background:var(--charcoal);color:#fff;padding:10px 13px;
    font-family:'Outfit',sans-serif;font-weight:700;font-size:13px;flex-shrink:0;
}
.pgh-price-wrap input {
    flex:1;border:none !important;box-shadow:none !important;
    background:transparent !important;padding:10px 13px !important;
}

.pgh-char-count      { float:right;font-size:11px;font-weight:500;color:var(--text-light);text-transform:none;letter-spacing:0; }
.pgh-char-count.warn { color:#d97706; }
.pgh-char-count.over { color:#dc2626; }

.pgh-upload-area        { border:2px dashed #e0e0e0;border-radius:var(--radius-sm);cursor:pointer;overflow:hidden;transition:border-color .14s; }
.pgh-upload-area:hover  { border-color:var(--red); }
.pgh-upload-placeholder { text-align:center;padding:22px;color:var(--text-muted);font-size:13.5px; }
#pgh-upload-preview     { width:100%;max-height:200px;object-fit:cover;display:block; }

.pgh-modal-foot {
    display:flex;justify-content:flex-end;gap:8px;
    margin-top:20px;padding-top:16px;border-top:1px solid #f0f0f0;
}
.pgh-btn {
    font-family:'Outfit',sans-serif;font-weight:700;font-size:14px;
    border:none;cursor:pointer;border-radius:var(--radius-sm);
    padding:10px 20px;transition:all .15s;line-height:1;
}
.pgh-btn-primary { background:var(--red);color:#fff;box-shadow:0 2px 6px rgba(192,57,43,.3); }
.pgh-btn-primary:hover { background:var(--red-dark); }
.pgh-btn-ghost   { background:#f3f4f6;color:var(--text-muted); }
.pgh-btn-ghost:hover   { background:#e9eaec;color:var(--text); }
.pgh-btn-danger  { background:#fef2f2;color:#dc2626;border:1px solid #fecaca; }
.pgh-btn-danger:hover  { background:#fee2e2; }

/* ── TOAST ─────────────────────────────────────────────────── */
#pgh-toast {
    position:fixed;bottom:24px;right:24px;
    background:var(--charcoal);color:#fff;
    border-radius:var(--radius-sm);padding:13px 20px;
    font-size:14px;font-weight:600;z-index:999999;
    box-shadow:0 8px 30px rgba(0,0,0,.2);animation:pgh-fade-in .18s ease;
    max-width:320px;border-left:4px solid var(--red);
}
#pgh-toast.pgh-toast-ok  { border-color:var(--green); }
#pgh-toast.pgh-toast-err { border-color:#dc2626; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width:600px) {
    .pgh-header       { flex-wrap:wrap;gap:10px;padding:14px 16px; }
    .pgh-header-sub   { display:none; }
    .pgh-post         { padding:16px;gap:14px; }
    .pgh-modal-inner  { padding:18px; }
    .pgh-post-top     { flex-direction:column;gap:6px; }
}

/* ── ITEM CATEGORY SELECT ──────────────────────────────────── */
.pgh-select-field {
    width:       100%;
    background:  #f8f8f8;
    border:      1.5px solid #ebebeb;
    border-radius: var(--radius-sm);
    color:       var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size:   14px;
    padding:     10px 13px;
    outline:     none;
    transition:  border-color .14s;
    cursor:      pointer;
    appearance:  none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
}
.pgh-select-field:focus { border-color: var(--red); background-color: #fff; }

/* Item category chip on post card */
.pgh-item-cat-chip {
    display:       inline-block;
    font-size:     11px;
    font-weight:   600;
    color:         var(--text-muted);
    background:    #f3f4f6;
    border-radius: 4px;
    padding:       2px 7px;
    margin-left:   4px;
}

/* ── MULTI IMAGE THUMBS ────────────────────────────────────── */
.pgh-image-thumbs {
    display:   flex;
    gap:       8px;
    flex-wrap: wrap;
    padding:   8px;
    min-height: 0;
}
.pgh-image-thumbs:empty { display: none; }

.pgh-thumb-item {
    position:      relative;
    width:         72px;
    height:        72px;
    border-radius: var(--radius-sm);
    overflow:      hidden;
    border:        1.5px solid #ebebeb;
    flex-shrink:   0;
}
.pgh-thumb-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.pgh-thumb-remove {
    position:   absolute;
    top:        3px; right: 3px;
    width:      18px; height: 18px;
    background: rgba(0,0,0,.65);
    color:      #fff;
    border:     none;
    border-radius: 50%;
    font-size:  10px;
    cursor:     pointer;
    display:    flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding:    0;
    transition: background .12s;
}
.pgh-thumb-remove:hover { background: var(--red); }
.pgh-thumb-uploading {
    position:   absolute;
    inset:      0;
    background: rgba(255,255,255,.8);
    display:    flex;
    align-items: center;
    justify-content: center;
    font-size:  10px;
    color:      var(--text-muted);
}

/* Post card images strip */
.pgh-post-images {
    display:   flex;
    gap:       6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pgh-post-img-thumb {
    width:         80px;
    height:        80px;
    border-radius: var(--radius-sm);
    object-fit:    cover;
    cursor:        zoom-in;
    border:        1px solid var(--divider);
    transition:    opacity .14s, transform .14s;
    flex-shrink:   0;
}
.pgh-post-img-thumb:hover { opacity: .88; transform: scale(1.03); }
.pgh-post-img-more {
    width:           80px;
    height:          80px;
    border-radius:   var(--radius-sm);
    background:      #f0f0f0;
    border:          1px solid var(--divider);
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       16px;
    font-weight:     700;
    color:           var(--text-muted);
    cursor:          zoom-in;
    transition:      background .14s;
}
.pgh-post-img-more:hover { background: #e8e8e8; }

/* ── LIGHTBOX ──────────────────────────────────────────────── */
#pgh-lightbox {
    position:        fixed;
    inset:           0;
    background:      rgba(0,0,0,.92);
    z-index:         999999;
    display:         flex;
    align-items:     center;
    justify-content: center;
    animation:       pgh-fade-in .18s ease;
}
#pgh-lb-img-wrap {
    max-width:  90vw;
    max-height: 88vh;
    display:    flex;
    align-items: center;
    justify-content: center;
}
#pgh-lb-img {
    max-width:     90vw;
    max-height:    88vh;
    object-fit:    contain;
    border-radius: var(--radius);
    box-shadow:    0 20px 60px rgba(0,0,0,.6);
    user-select:   none;
}
#pgh-lb-close {
    position:      fixed;
    top:           18px; right: 20px;
    background:    rgba(255,255,255,.12);
    border:        none;
    color:         #fff;
    font-size:     22px;
    width:         42px; height: 42px;
    border-radius: 50%;
    cursor:        pointer;
    display:       flex;
    align-items:   center;
    justify-content: center;
    transition:    background .14s;
    z-index:       1;
}
#pgh-lb-close:hover { background: rgba(255,255,255,.25); }

#pgh-lb-prev, #pgh-lb-next {
    position:      fixed;
    top:           50%;
    transform:     translateY(-50%);
    background:    rgba(255,255,255,.1);
    border:        none;
    color:         #fff;
    font-size:     22px;
    width:         48px; height: 48px;
    border-radius: 50%;
    cursor:        pointer;
    display:       flex;
    align-items:   center;
    justify-content: center;
    transition:    background .14s;
    z-index:       1;
}
#pgh-lb-prev { left: 18px; }
#pgh-lb-next { right: 18px; }
#pgh-lb-prev:hover, #pgh-lb-next:hover { background: rgba(255,255,255,.25); }
#pgh-lb-prev.hidden, #pgh-lb-next.hidden { display: none; }

#pgh-lb-counter {
    position:  fixed;
    bottom:    20px;
    left:      50%;
    transform: translateX(-50%);
    color:     rgba(255,255,255,.7);
    font-size: 13px;
    font-weight: 600;
    background: rgba(0,0,0,.4);
    padding:   4px 14px;
    border-radius: 20px;
}

/* ── AUTH MODAL ────────────────────────────────────────────── */
.pgh-auth-modal-inner {
    width:     min(420px, 95vw) !important;
    padding:   28px !important;
}

/* Tabs */
.pgh-auth-tabs {
    display:  flex;
    gap:      4px;
    background: #f3f4f6;
    border-radius: var(--radius-sm);
    padding:  4px;
}
.pgh-auth-tab {
    flex:          1;
    font-family:   'Outfit', sans-serif;
    font-weight:   700;
    font-size:     14px;
    border:        none;
    border-radius: 5px;
    padding:       8px 0;
    cursor:        pointer;
    background:    transparent;
    color:         var(--text-muted);
    transition:    all .15s;
}
.pgh-auth-tab.active {
    background:  #fff;
    color:       var(--text);
    box-shadow:  0 1px 4px rgba(0,0,0,.1);
}

/* Social buttons */
.pgh-social-btns {
    display:  flex;
    flex-direction: column;
    gap:      10px;
    margin:   18px 0 14px;
    position: relative;
    z-index:  10;
}
.pgh-social-btn {
    display:         flex;
    align-items:     center;
    justify-content: center;
    gap:             10px;
    width:           100%;
    padding:         11px 16px;
    border-radius:   var(--radius-sm);
    font-family:     'DM Sans', sans-serif;
    font-size:       14px;
    font-weight:     600;
    cursor:          pointer;
    transition:      all .15s;
    text-decoration: none;
    border:          none;
    position:        relative;
    z-index:         10;
}
.pgh-google-btn {
    background:  #fff;
    color:       #3c4043;
    border:      1.5px solid #dadce0;
    box-shadow:  0 1px 3px rgba(0,0,0,.08);
}
.pgh-google-btn:hover { background: #f8f9fa; box-shadow: 0 2px 6px rgba(0,0,0,.12); }

.pgh-facebook-btn {
    background:  #1877f2;
    color:       #fff;
}
.pgh-facebook-btn:hover { background: #166fe5; }

.pgh-nextend-notice {
    font-size:   12px;
    color:       var(--text-muted);
    text-align:  center;
    margin-top:  6px;
}
.pgh-nextend-notice a { color: var(--red); }

/* Divider */
.pgh-auth-divider {
    display:     flex;
    align-items: center;
    gap:         10px;
    margin:      14px 0;
    color:       var(--text-light);
    font-size:   12px;
    font-weight: 600;
}
.pgh-auth-divider::before,
.pgh-auth-divider::after {
    content:    '';
    flex:       1;
    height:     1px;
    background: #e5e7eb;
}

/* Password field */
.pgh-pass-wrap {
    position: relative;
}
.pgh-pass-wrap input { padding-right: 42px !important; }
.pgh-toggle-pass {
    position:    absolute;
    right:       10px;
    top:         50%;
    transform:   translateY(-50%);
    background:  none;
    border:      none;
    cursor:      pointer;
    font-size:   16px;
    color:       var(--text-muted);
    padding:     4px;
    line-height: 1;
}

/* Remember + forgot row */
.pgh-auth-row {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    margin-bottom:   14px;
    font-size:       13px;
}
.pgh-remember-wrap {
    display:     flex;
    align-items: center;
    gap:         6px;
    color:       var(--text-muted);
    cursor:      pointer;
}
.pgh-forgot-link {
    color:           var(--red);
    text-decoration: none;
    font-size:       13px;
    font-weight:     500;
}
.pgh-forgot-link:hover { text-decoration: underline; }

/* Full width button */
.pgh-btn-full { width: 100%; justify-content: center; padding: 12px !important; font-size: 15px !important; margin-top: 4px; }

/* Error / success messages */
.pgh-auth-error {
    background:    #fef2f2;
    border:        1px solid #fecaca;
    color:         #dc2626;
    border-radius: var(--radius-sm);
    padding:       10px 13px;
    font-size:     13px;
    margin-bottom: 12px;
}
.pgh-auth-success {
    background:    #f0fdf4;
    border:        1px solid #bbf7d0;
    color:         #16a34a;
    border-radius: var(--radius-sm);
    padding:       10px 13px;
    font-size:     13px;
    margin-bottom: 12px;
}

/* Switch link */
.pgh-auth-switch {
    text-align:  center;
    font-size:   13px;
    color:       var(--text-muted);
    margin-top:  14px;
}
.pgh-tab-switch {
    background:  none;
    border:      none;
    color:       var(--red);
    font-weight: 600;
    cursor:      pointer;
    font-size:   13px;
    padding:     0;
}
.pgh-tab-switch:hover { text-decoration: underline; }

/* Password strength */
.pgh-pass-strength {
    margin-top:  6px;
    height:      4px;
    border-radius: 4px;
    background:  #e5e7eb;
    overflow:    hidden;
    transition:  all .2s;
}
.pgh-pass-strength-bar {
    height:      100%;
    border-radius: 4px;
    transition:  width .2s, background .2s;
}

/* ── Nextend Social Login button override inside modal ─────── */
.pgh-nextend-wrap { width: 100%; }
.pgh-nextend-wrap .nsl-container { margin: 0 !important; }
.pgh-nextend-wrap .nsl-container-block .nsl-button {
    border-radius:  var(--radius-sm) !important;
    font-family:    'DM Sans', sans-serif !important;
    font-weight:    600 !important;
    font-size:      14px !important;
    height:         44px !important;
    box-shadow:     0 1px 3px rgba(0,0,0,.1) !important;
    margin-bottom:  0 !important;
}

/* Profile link in marketplace */
.pgh-author-link {
    text-decoration: none;
    color: inherit;
}
.pgh-author-link:hover strong,
.pgh-author-link:hover .pgh-reply-name {
    color: var(--red);
    text-decoration: underline;
}

/* ── Seller trade badge on listing cards ───────────────── */
.pgh-seller-trade-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .3px;
    cursor: default;
}
.pgh-seller-trade-badge.pgh-trade-elite    { background: #fdf2f1; color: #c0392b; }
.pgh-seller-trade-badge.pgh-trade-verified { background: #f0fdf4; color: #16a34a; }
.pgh-seller-trade-badge.pgh-trade-trusted  { background: #eff6ff; color: #2563eb; }
.pgh-seller-trade-badge.pgh-trade-new      { background: #f3f4f6; color: #6b7280; }

/* ═══════════════════════════════════════════════════════════
   INLINE POST FORM
═══════════════════════════════════════════════════════════ */

/* ── Post button active state ─────────────────────────── */
.pgh-post-listing-btn {
    transition: background .15s, opacity .15s;
}
.pgh-post-btn-active {
    background: rgba(255,255,255,.15) !important;
    border-color: #fff !important;
}

/* ── Inline form wrapper ──────────────────────────────── */
.pgh-inline-form {
    margin: 0;
    padding: 16px 16px 4px 16px;
    background: #f3f4f6;
    border-bottom: 1px solid var(--divider);
}

.pgh-inline-form-inner {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.08), 0 0 0 1.5px var(--red);
    background: #fff;
}

/* ── Form header ──────────────────────────────────────── */
.pgh-inline-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1a1a1a;
    border-bottom: 2px solid var(--pa);
}
.pgh-inline-form-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .2px;
}
.pgh-inline-form-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .12s, background .12s;
}
.pgh-inline-form-close:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Form body ────────────────────────────────────────── */
.pgh-inline-form-body {
    padding: 20px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Generic row ──────────────────────────────────────── */
.pgh-if-row { display: flex; flex-direction: column; gap: 6px; }

.pgh-if-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pgh-if-input {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    color: #111;
    transition: border-color .15s, background .15s, box-shadow .15s;
    box-sizing: border-box;
}
.pgh-if-input:focus {
    outline: none;
    border-color: var(--pa);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}
.pgh-if-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* ── Two column layout ────────────────────────────────── */
.pgh-if-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Trade type buttons ───────────────────────────────── */
.pgh-if-trade-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pgh-if-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.pgh-if-type:hover {
    border-color: #c0c0c0;
    background: #f3f4f6;
}
.pgh-if-type.active {
    border-color: var(--pa);
    background: #fdf2f1;
}
.pgh-if-type-code {
    font-size: 15px;
    font-weight: 800;
    color: #555;
    font-family: 'Outfit', sans-serif;
    letter-spacing: .5px;
}
.pgh-if-type.active .pgh-if-type-code { color: var(--pa); }
.pgh-if-type-desc {
    font-size: 10px;
    color: #999;
    font-weight: 500;
}
.pgh-if-type.active .pgh-if-type-desc { color: #c0392b99; }

/* ── Price row ────────────────────────────────────────── */
.pgh-if-row-price .pgh-price-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
}
.pgh-if-row-price .pgh-price-wrap:focus-within {
    border-color: var(--pa);
    box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}
.pgh-if-row-price .pgh-currency {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 800;
    background: #f3f4f6;
    border-right: 1.5px solid #e5e7eb;
    color: #555;
    letter-spacing: .5px;
}
.pgh-if-row-price input {
    border: none;
    background: transparent;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    flex: 1;
    outline: none;
    color: #111;
}

/* ── Image upload zone ────────────────────────────────── */
.pgh-if-upload {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #fafafa;
    min-height: 80px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    overflow: hidden;
}
.pgh-if-upload:hover {
    border-color: var(--pa);
    background: #fdf9f9;
}
.pgh-if-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
}
.pgh-if-upload-icon { font-size: 22px; }
.pgh-if-upload-placeholder small { font-size: 11px; color: #c0c0c0; }

/* ── Form footer ──────────────────────────────────────── */
.pgh-inline-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    gap: 12px;
    flex-wrap: wrap;
}
.pgh-if-footer-hint { font-size: 12px; }
.pgh-if-pending-note { color: #d97706; font-weight: 600; }
.pgh-if-live-note    { color: #16a34a; font-weight: 600; }

.pgh-if-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.pgh-if-submit-btn {
    padding: 10px 22px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .3px;
}

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .pgh-if-two-col       { grid-template-columns: 1fr; }
    .pgh-if-trade-types   { gap: 8px; }
    .pgh-if-type          { padding: 10px 6px; }
    .pgh-if-type-code     { font-size: 13px; }
    .pgh-inline-form      { padding: 10px 10px 4px 10px; }
    .pgh-inline-form-body { padding: 14px 14px 4px; }
    .pgh-inline-form-footer { padding: 12px 14px; }
    .pgh-if-footer-hint   { width: 100%; }
    .pgh-if-footer-actions { width: 100%; justify-content: flex-end; }
}

/* ═══════════════════════════════════════════════════════════════
   MARKETPLACE V3 — refined design matching reference
   ═══════════════════════════════════════════════════════════════ */

#pgh-stream-wrap.pgh-stream-v3 {
    --mk-red: #d42333;
    --mk-red-hover: #b81e2b;
    --mk-dark: #111115;
    --mk-dark2: #1c1c22;
    --mk-bg: #f2f1ef;
    --mk-surface: #ffffff;
    --mk-border: #e4e3e0;
    --mk-text: #18181a;
    --mk-text-soft: #3d3c42;
    --mk-text-muted: #7a7880;
    --mk-radius: 12px;
    --mk-radius-sm: 8px;

    background: var(--mk-bg);
    border-radius: 14px;
    overflow: hidden;
    color: var(--mk-text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── HEADER ─── */
.pgh-stream-v3 .pgh-header {
    background: var(--mk-dark) !important;
    border-bottom: 2px solid var(--mk-red) !important;
    color: #fff;
    padding: 0 24px !important;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    border-radius: 0 !important;
}
.pgh-stream-v3 .pgh-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pgh-stream-v3 .pgh-live-dot {
    width: 8px;
    height: 8px;
    background: var(--mk-red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--mk-red);
    animation: pgh-pulse 2s ease-in-out infinite;
}
@keyframes pgh-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.pgh-stream-v3 .pgh-header-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
}
.pgh-stream-v3 .pgh-header-sub {
    display: none;
}
.pgh-stream-v3 .pgh-post-listing-btn {
    background: var(--mk-red) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0 16px !important;
    height: 34px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.pgh-stream-v3 .pgh-post-listing-btn:hover {
    background: var(--mk-red-hover) !important;
}

/* ── INLINE SEARCH BAR (in dark header) ─── */
.pgh-stream-v3 .pgh-search-bar {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 24px !important;
    flex: 1;
    max-width: 600px;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.pgh-stream-v3 .pgh-search-bar::before { display: none; }
.pgh-stream-v3 .pgh-search-bar-inner {
    display: flex;
    align-items: stretch;
    gap: 6px;
    background: transparent !important;
    border-radius: 0;
    overflow: visible;
    height: 34px;
}
.pgh-stream-v3 .pgh-sb-field {
    flex: 1;
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px;
    padding: 0 10px !important;
    align-items: center;
    transition: background 0.15s, border-color 0.15s;
}
.pgh-stream-v3 .pgh-sb-field:hover {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.2);
}
.pgh-stream-v3 .pgh-sb-icon {
    margin-right: 6px;
    font-size: 13px;
    color: #ccc;
    opacity: 0.8;
}
.pgh-stream-v3 .pgh-sb-select {
    flex: 1;
    background: transparent !important;
    color: #ddd !important;
    font-size: 12px !important;
    font-weight: 500;
    padding: 0 16px 0 0 !important;
    border: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23bbbbbb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 0 center !important;
}
.pgh-stream-v3 .pgh-sb-select option {
    background: var(--mk-dark2);
    color: #fff;
}
.pgh-stream-v3 .pgh-sb-divider { display: none; }
.pgh-stream-v3 .pgh-sb-search-btn {
    background: var(--mk-red) !important;
    border-radius: 7px !important;
    padding: 0 12px !important;
    width: 36px;
    flex-shrink: 0;
}
.pgh-stream-v3 .pgh-sb-search-btn:hover {
    background: var(--mk-red-hover) !important;
}

/* ── MAIN LAYOUT (sidebar + results) ─── */
.pgh-stream-v3 .pgh-marketplace-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    margin: 24px 24px;
    align-items: start;
}

/* ── SIDEBAR ─── */
.pgh-stream-v3 .pgh-sidebar {
    background: var(--mk-surface);
    border: 1px solid var(--mk-border);
    border-radius: var(--mk-radius);
    padding: 18px 16px;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.pgh-stream-v3 .pgh-sidebar::-webkit-scrollbar { width: 6px; }
.pgh-stream-v3 .pgh-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.pgh-stream-v3 .pgh-sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}
.pgh-stream-v3 .pgh-sidebar-head h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--mk-text);
    letter-spacing: -0.005em;
}
.pgh-stream-v3 .pgh-clear-filters {
    background: none;
    border: none;
    color: var(--mk-red);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.12s;
}
.pgh-stream-v3 .pgh-clear-filters:hover { color: var(--mk-red-hover); }

/* Filter sections */
.pgh-stream-v3 .pgh-filter-group {
    border-top: 1px solid var(--mk-border);
    padding: 12px 0;
    margin: 0;
}
.pgh-stream-v3 .pgh-filter-group:first-of-type {
    border-top: none;
    padding-top: 0;
}
.pgh-stream-v3 .pgh-filter-toggle,
.pgh-stream-v3 .pgh-filter-group h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--mk-text-muted);
    text-transform: uppercase;
    text-align: left;
    margin: 0 0 8px;
}
.pgh-stream-v3 .pgh-filter-toggle:hover,
.pgh-stream-v3 .pgh-filter-group h4:hover {
    color: var(--mk-text-soft);
}
.pgh-stream-v3 .pgh-collapse-icon {
    font-size: 11px;
    color: var(--mk-text-muted);
    transition: transform 0.15s;
}
.pgh-stream-v3 .pgh-collapse[data-collapsed="true"] .pgh-collapse-icon {
    transform: rotate(-90deg);
}
.pgh-stream-v3 .pgh-collapse[data-collapsed="true"] .pgh-filter-body {
    display: none;
}

.pgh-stream-v3 .pgh-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 220px;
    overflow-y: auto;
}
.pgh-stream-v3 .pgh-filter-list::-webkit-scrollbar { width: 4px; }
.pgh-stream-v3 .pgh-filter-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
}
.pgh-stream-v3 .pgh-filter-item {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pgh-stream-v3 .pgh-filter-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--mk-text-soft);
    transition: background 0.1s, color 0.1s;
    line-height: 1.3;
}
.pgh-stream-v3 .pgh-filter-item label:hover {
    background: rgba(212, 35, 51, 0.04);
    color: var(--mk-text);
}
.pgh-stream-v3 .pgh-filter-check,
.pgh-stream-v3 .pgh-filter-radio {
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--mk-red);
    cursor: pointer;
}
.pgh-stream-v3 .pgh-filter-name {
    flex: 1;
}
.pgh-stream-v3 .pgh-filter-count {
    font-size: 10px;
    color: var(--mk-text-muted);
    background: var(--mk-bg);
    padding: 1px 7px;
    border-radius: 9px;
    min-width: 20px;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

/* Keyword input */
.pgh-stream-v3 .pgh-keyword-row {
    display: flex;
    gap: 6px;
}
.pgh-stream-v3 .pgh-keyword-input {
    flex: 1;
    width: 0;
    padding: 7px 10px;
    border: 1.5px solid var(--mk-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--mk-text);
    background: #fff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.12s;
}
.pgh-stream-v3 .pgh-keyword-input:focus { border-color: var(--mk-red); }
.pgh-stream-v3 .pgh-keyword-go {
    background: var(--mk-red);
    color: #fff;
    border: none;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.pgh-stream-v3 .pgh-keyword-go:hover { background: var(--mk-red-hover); }

/* Price range */
.pgh-stream-v3 .pgh-price-range {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.pgh-stream-v3 .pgh-price-input {
    flex: 1;
    width: 0;
    padding: 6px 8px;
    border: 1.5px solid var(--mk-border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--mk-text);
    outline: none;
}
.pgh-stream-v3 .pgh-price-input:focus { border-color: var(--mk-red); }
.pgh-stream-v3 .pgh-price-dash { color: var(--mk-text-muted); font-size: 12px; }
.pgh-stream-v3 .pgh-price-apply {
    width: 100%;
    background: var(--mk-text);
    color: #fff;
    border: none;
    padding: 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.15s;
}
.pgh-stream-v3 .pgh-price-apply:hover { background: var(--mk-red); }

/* ── RESULTS AREA ─── */
.pgh-stream-v3 .pgh-results-area {
    min-width: 0;
}

/* Results top: search + sort */
.pgh-stream-v3 .pgh-results-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    flex-wrap: wrap;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
.pgh-stream-v3 .pgh-mobile-filters-btn {
    display: none;
    background: var(--mk-text);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.pgh-stream-v3 .pgh-results-count {
    font-size: 13px;
    color: var(--mk-text-muted);
    font-weight: 500;
    flex: none;
    margin-right: auto;
}
.pgh-stream-v3 .pgh-results-count strong {
    color: var(--mk-text);
    font-weight: 700;
}
.pgh-stream-v3 .pgh-active-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: none;
}
.pgh-stream-v3 .pgh-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fde8e8;
    color: var(--mk-red);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}
.pgh-stream-v3 .pgh-active-chip:hover {
    background: var(--mk-red);
    color: #fff;
}
.pgh-stream-v3 .pgh-chip-x { font-size: 9px; opacity: 0.8; }

.pgh-stream-v3 .pgh-sort-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.pgh-stream-v3 .pgh-sort-label {
    font-size: 12px;
    color: var(--mk-text-muted);
    font-weight: 500;
}
.pgh-stream-v3 .pgh-sort-select {
    padding: 7px 10px;
    border: 1.5px solid var(--mk-border);
    border-radius: 9px;
    font-size: 12px;
    font-family: inherit;
    background: var(--mk-surface);
    outline: none;
    cursor: pointer;
    color: var(--mk-text-soft);
    font-weight: 500;
    transition: border-color 0.12s;
}
.pgh-stream-v3 .pgh-sort-select:focus { border-color: var(--mk-red); }

/* Inline keyword search bar above results — added new */
.pgh-stream-v3 .pgh-result-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.pgh-stream-v3 .pgh-result-search-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1.5px solid var(--mk-border);
    border-radius: 9px;
    font-size: 13px;
    font-family: inherit;
    background: var(--mk-surface);
    outline: none;
    transition: border-color 0.12s;
}
.pgh-stream-v3 .pgh-result-search-input:focus { border-color: var(--mk-red); }
.pgh-stream-v3 .pgh-result-search::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--mk-text-muted);
    pointer-events: none;
}

/* ── FEED — Listing cards ─── */
.pgh-stream-v3 #pgh-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
}

.pgh-stream-v3 .pgh-post {
    background: var(--mk-surface);
    border-radius: var(--mk-radius);
    border: 1px solid var(--mk-border);
    padding: 18px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: box-shadow 0.15s;
    box-shadow: none;
}
.pgh-stream-v3 .pgh-post:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

/* Avatar / thumb on the left */
.pgh-stream-v3 .pgh-post-thumb {
    width: 52px !important;
    height: 52px !important;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: oklch(88% 0.06 30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: oklch(40% 0.08 30);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.pgh-stream-v3 .pgh-post-thumb img,
.pgh-stream-v3 .pgh-post-thumb .pgh-post-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Post content */
.pgh-stream-v3 .pgh-post-content {
    flex: 1;
    min-width: 0;
}

/* Header row: title + badge + cat + price */
.pgh-stream-v3 .pgh-post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.pgh-stream-v3 .pgh-post-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.pgh-stream-v3 .pgh-post-item-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--mk-text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.pgh-stream-v3 .pgh-cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
    flex-shrink: 0;
}
.pgh-stream-v3 .pgh-cat-WTS {
    background: oklch(96% 0.04 185);
    color: oklch(45% 0.13 185);
}
.pgh-stream-v3 .pgh-cat-WTB {
    background: oklch(97% 0.04 60);
    color: oklch(50% 0.14 60);
}
.pgh-stream-v3 .pgh-cat-WTT {
    background: oklch(96% 0.04 290);
    color: oklch(50% 0.13 290);
}
.pgh-stream-v3 .pgh-item-cat-chip {
    background: transparent !important;
    color: var(--mk-text-muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    letter-spacing: 0;
    text-transform: none;
}
.pgh-stream-v3 .pgh-post-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--mk-red);
    letter-spacing: -0.02em;
    flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap;
}

/* Meta row: seller, badge, time, condition, city */
.pgh-stream-v3 .pgh-post-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--mk-text-muted);
}
.pgh-stream-v3 .pgh-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--mk-text-muted);
}
.pgh-stream-v3 .pgh-meta-icon { font-size: 12px; opacity: 0.7; }
.pgh-stream-v3 .pgh-meta-item .pgh-author-link {
    color: var(--mk-text-soft);
    font-weight: 600;
    text-decoration: none;
}
.pgh-stream-v3 .pgh-meta-item .pgh-author-link:hover { color: var(--mk-red); }
.pgh-stream-v3 .pgh-meta-item strong {
    color: var(--mk-text-soft);
    font-weight: 600;
}
.pgh-stream-v3 .pgh-meta-row-divider {
    color: var(--mk-border);
    font-size: 11px;
}

/* Trust badges */
.pgh-stream-v3 .pgh-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    background: oklch(96% 0.025 240);
    color: oklch(45% 0.1 240);
    line-height: 1.3;
}

/* Description */
.pgh-stream-v3 .pgh-post-body {
    font-size: 13px;
    color: var(--mk-text-soft);
    margin: 8px 0 0;
    line-height: 1.6;
    max-width: 580px;
}

/* Actions row */
.pgh-stream-v3 .pgh-post-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.pgh-stream-v3 .pgh-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: var(--mk-text-muted);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
}
.pgh-stream-v3 .pgh-action-btn:hover {
    background: rgba(212, 35, 51, 0.06);
    color: var(--mk-red);
}
.pgh-stream-v3 .pgh-like-btn.liked {
    color: var(--mk-red);
}
.pgh-stream-v3 .pgh-action-sep {
    color: var(--mk-border);
    font-size: 11px;
    margin: 0 -2px;
}

/* Empty state */
.pgh-stream-v3 .pgh-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--mk-text-muted);
    background: var(--mk-surface);
    border-radius: var(--mk-radius);
    border: 1px solid var(--mk-border);
    font-size: 14px;
    font-weight: 500;
}

/* Loading */
.pgh-stream-v3 .pgh-loading {
    text-align: center;
    padding: 40px;
    color: var(--mk-text-muted);
    font-size: 13px;
}

/* Pagination */
.pgh-stream-v3 .pgh-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pgh-stream-v3 .pgh-page-btn {
    background: var(--mk-surface);
    border: 1.5px solid var(--mk-border);
    color: var(--mk-text-soft);
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.pgh-stream-v3 .pgh-page-btn:hover {
    border-color: var(--mk-red);
    color: var(--mk-red);
}
.pgh-stream-v3 .pgh-page-btn.active {
    background: var(--mk-red);
    border-color: var(--mk-red);
    color: #fff;
}
.pgh-stream-v3 .pgh-page-gap { color: var(--mk-text-muted); padding: 7px 4px; font-size: 12px; }

/* Sidebar backdrop (mobile) */
.pgh-stream-v3 .pgh-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.pgh-stream-v3 .pgh-sidebar-backdrop.active { display: block; }
body.pgh-sidebar-open { overflow: hidden; }

.pgh-stream-v3 .pgh-sidebar-close {
    display: none;
    position: absolute;
    top: 12px; right: 12px;
    background: transparent;
    border: 1px solid var(--mk-border);
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: var(--mk-text-soft);
    align-items: center;
    justify-content: center;
}

/* ── Reply UI when expanded ─── */
.pgh-stream-v3 .pgh-replies {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--mk-border);
}

/* ── Inline post form theming ─── */
.pgh-stream-v3 .pgh-inline-form {
    background: var(--mk-surface);
    border-radius: var(--mk-radius);
    border: 1px solid var(--mk-border);
    margin: 0 24px 16px;
}

/* ── RESPONSIVE ─── */
@media (max-width: 900px) {
    .pgh-stream-v3 .pgh-marketplace-layout {
        grid-template-columns: 1fr;
        margin: 16px;
    }
    .pgh-stream-v3 .pgh-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        bottom: 0;
        width: 300px;
        max-width: 86vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        z-index: 999;
        transition: left 0.25s;
        box-shadow: 0 0 30px rgba(0,0,0,0.15);
    }
    .pgh-stream-v3 .pgh-sidebar.open { left: 0; }
    .pgh-stream-v3 .pgh-sidebar-close { display: flex; }
    .pgh-stream-v3 .pgh-mobile-filters-btn { display: inline-flex; }

    /* Header search bar collapses on mobile */
    .pgh-stream-v3 .pgh-search-bar { display: none !important; }
    .pgh-stream-v3 .pgh-header { padding: 0 16px !important; }
}
@media (max-width: 600px) {
    .pgh-stream-v3 .pgh-post {
        padding: 14px 16px;
        gap: 12px;
    }
    .pgh-stream-v3 .pgh-post-thumb { width: 44px !important; height: 44px !important; }
    .pgh-stream-v3 .pgh-post-header { flex-direction: column; align-items: flex-start; }
    .pgh-stream-v3 .pgh-post-price { font-size: 14px; }
    .pgh-stream-v3 .pgh-post-item-name { font-size: 15px; }
    .pgh-stream-v3 .pgh-results-top { flex-direction: column; align-items: stretch; }
    .pgh-stream-v3 .pgh-result-search { width: 100%; }
    .pgh-stream-v3 .pgh-sort-wrap { width: 100%; justify-content: space-between; }
}
