:root{--brand:#0d6efd;--radius:16px}
body{background:#f6f7fb;font-size:1rem}
.hero{background:linear-gradient(135deg,#0d6efd,#6f42c1);color:#fff;border-radius:var(--radius)}
.auth-card{max-width:420px;background:#fff;border-radius:var(--radius);padding:1.5rem;box-shadow:0 2px 12px rgba(0,0,0,.06)}
.pb-nav{padding-bottom:5rem}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:space-around;background:#fff;border-top:1px solid #e5e7eb;padding:.4rem 0 calc(.4rem + env(safe-area-inset-bottom));z-index:1030}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;font-size:1.2rem;text-decoration:none;color:#333}
.bottom-nav span{font-size:.7rem}
@media(min-width:768px){.pb-nav{padding-bottom:1rem}}
.city-select{max-width:150px}
.chips-row{display:flex;gap:.5rem;overflow-x:auto;padding-bottom:.25rem;scrollbar-width:none}
.chips-row a{flex:none}
.avatar{width:64px;height:64px;border-radius:50%;object-fit:cover;display:block;margin:0 auto .25rem}
.avatar-lg{width:96px;height:96px}
.avatar-ph{background:#0d6efd;color:#fff;display:grid;place-items:center;font-weight:700;font-size:1.4rem}
.post-mini{border-radius:14px}
.post-mini:hover{box-shadow:0 2px 10px rgba(0,0,0,.08)}
.card-thumb{width:64px;height:64px;object-fit:cover;border-radius:10px;flex:none}
.cover-img{width:100%;max-height:220px;object-fit:cover}
.logo-img{width:48px;height:48px;border-radius:12px;object-fit:cover}
.gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:2px;background:#000}
.gallery img{flex:0 0 100%;max-height:420px;object-fit:contain;scroll-snap-align:center;background:#111}
.price-tag{font-size:1.6rem;font-weight:800;color:#0d6efd}
.avatar-sm{width:30px;height:30px;border-radius:50%;object-fit:cover;display:inline-grid;place-items:center;font-size:.8rem}
.thumb-opt{display:flex;flex-direction:column;align-items:center;gap:2px}
.thumb-opt img{width:72px;height:72px;object-fit:cover;border-radius:10px}
.feed-item{border-radius:16px}
.feed-img{width:100%;max-height:360px;object-fit:cover;border-radius:12px;display:block}
.vote-bar{height:8px;border-radius:99px;background:#f8d7da;overflow:hidden;margin-top:6px}
.vote-bar i{display:block;height:100%;background:#198754;transition:width .3s}
.vote-line{font-size:.95rem}
.skeleton-card{padding:16px}
.sk-line{height:14px;border-radius:8px;margin:8px 0;background:linear-gradient(90deg,#e9ecef,#f8f9fa,#e9ecef);background-size:200% 100%;animation:sk 1.2s infinite}
@keyframes sk{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.sk-line,.vote-bar i{animation:none;transition:none}}
.comment{padding:.75rem 0;border-bottom:1px solid #eee}
.comment:last-child{border-bottom:0}
.replies{margin-top:.5rem;padding-left:.5rem;border-left:3px solid #e9ecef}
.c-actions .btn{padding:.1rem .5rem;font-size:.8rem}
.notif-badge{font-size:.65rem;position:absolute;top:-6px;right:-8px}
.notif-unread{background:#e7f1ff;font-weight:600}
.share-panel{position:absolute;right:0;bottom:100%;z-index:20;width:170px;display:grid;gap:4px;box-shadow:0 4px 18px rgba(0,0,0,.15)}
.share-panel[hidden]{display:none}
.report-dialog{border:0;border-radius:16px;padding:16px;max-width:360px;width:92%}
.report-dialog::backdrop{background:rgba(0,0,0,.45)}

/* ---- Phase 10: final responsive / accessibility polish ---- */
.skip-link{position:absolute;left:-999px;top:0;background:#0d6efd;color:#fff;padding:.5rem 1rem;z-index:2000;border-radius:0 0 8px 0}
.skip-link:focus{left:0}
:focus-visible{outline:3px solid #f2a900;outline-offset:2px}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{-webkit-tap-highlight-color:transparent;overflow-x:hidden}
img,video{max-width:100%;height:auto}
.table-responsive{-webkit-overflow-scrolling:touch}
@media (max-width:767.98px){
  input.form-control,select.form-select,textarea.form-control{font-size:16px}          /* stops iOS zoom-on-focus */
  .btn{min-height:40px}.btn-sm{min-height:36px}
  .bottom-nav a{min-width:56px;padding:2px 6px}
  .container{padding-left:14px;padding-right:14px}
  .feed-filters .row>div{min-width:0}
  .share-panel{right:auto;left:0}
}
@media (min-width:768px){.feed-item,.post-mini,.auth-card{max-width:760px;margin-left:auto;margin-right:auto}}
@media print{.navbar,.bottom-nav,footer,.vote-block,.share,.report-btn,#commentForm{display:none!important}}
@media (display-mode:standalone){header.navbar{padding-top:env(safe-area-inset-top)}}
.city-link{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---- city type-ahead ---- */
.city-picker{position:relative}
.cp-list{position:absolute;left:0;right:0;top:100%;z-index:1060;margin:4px 0 0;padding:4px;list-style:none;background:#fff;border:1px solid #dee2e6;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.15);max-height:280px;overflow:auto}
.cp-list[hidden]{display:none}
.cp-item{display:block;width:100%;text-align:left;border:0;background:none;padding:10px 12px;border-radius:8px;cursor:pointer;line-height:1.25}
.cp-item small{display:block;color:#6c757d}
.cp-item.active,.cp-item:hover{background:#e7f1ff}
.cp-empty{padding:10px 12px;color:#6c757d}
.cp-msg:empty{display:none}

/* Phase 14: coin toasts */
.coin-toast-wrap{position:fixed;left:50%;bottom:76px;transform:translateX(-50%);z-index:1080;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;max-width:92vw}
.coin-toast{background:#1f2937;color:#fff;border-radius:12px;padding:10px 14px;font-size:.9rem;box-shadow:0 6px 20px rgba(0,0,0,.25);transition:opacity .4s,transform .4s}
.coin-toast-ok{background:#146c43}.coin-toast-cap{background:#8a5a00}.coin-toast.out{opacity:0;transform:translateY(8px)}
/* Phase 19: colourful text posts. Always square (1:1); designed on a 1000 x 1000 px canvas and scaled with container units,
   so text never stretches or distorts on phones and desktops. */
.tpg-wrap{width:100%;max-width:560px;margin:.25rem auto}
.tpg-wrap.tpg-detail{max-width:640px}
.tpg{position:relative;box-sizing:border-box;width:100%;aspect-ratio:1/1;overflow:hidden;border-radius:14px;padding:8%;display:flex;align-items:center;justify-content:center;
  background:var(--tpg-bg,#333);color:var(--tpg-fg,#fff);container-type:inline-size;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans","Noto Sans Devanagari",sans-serif;box-shadow:0 1px 3px rgba(0,0,0,.18)}
.tpg-text{width:100%;font-weight:800;line-height:1.22;white-space:pre-line;overflow-wrap:anywhere;word-break:break-word;hyphens:auto;
  font-size:calc(var(--tpg-fs,84) / 10 * 1cqw)}
@supports not (font-size:1cqw){.tpg-text{font-size:calc(var(--tpg-fs,84) / 1000 * min(100vw - 48px, 560px))}}
.tpg-a-left .tpg-text{text-align:left}.tpg-a-center .tpg-text{text-align:center}.tpg-a-right .tpg-text{text-align:right}
.tpg-swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:8px}
.tpg-sw{position:relative;display:block;cursor:pointer;margin:0}
.tpg-sw input{position:absolute;opacity:0;inset:0;width:100%;height:100%;cursor:pointer}
.tpg-sw span{display:block;aspect-ratio:1/1;border-radius:10px;border:2px solid rgba(0,0,0,.15)}
.tpg-sw input:checked+span{outline:3px solid #0d6efd;outline-offset:2px}
.tpg-sw input:focus-visible+span{outline:3px solid #0d6efd;outline-offset:2px}
.btn-check:disabled+.btn{opacity:.35;cursor:not-allowed}
