/* ================= Come-back features ================= */

/* Status pill: Market Day tag */
.sp-md { font-weight: 800; color: #e8433a; }

/* Shop panel: follow, offer, share */
.follow { margin-left: auto; align-self: flex-start; flex: none; padding: 8px 12px; border-radius: 999px; background: #efede7; font-size: 13px; font-weight: 700; white-space: nowrap; }
.follow.on { background: #fff3cd; color: #9a6a00; }
.flag.md { background: #ffe1dc; color: #c0392b; }
.pc-extras { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.offer-btn { padding: 4px 9px; border-radius: 999px; background: #fff3cd; color: #7a5a12; font-size: 12px; font-weight: 700; }
.offer-btn:hover { background: #ffe8a3; }
.fixed-tag { font-size: 11px; color: var(--muted); }
.share-btn { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.int-pop .fixed-price { color: var(--muted); font-size: 12.5px; }
.int-pop .share-pop { height: 36px; font-size: 13px; }

/* Shopping together chip on the map */
.together-chip { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; background: linear-gradient(135deg, #1f9d55, #16884f); color: #fff; border-radius: 999px; box-shadow: var(--shadow); }
.together-chip button { color: #fff; }
.tg-open { padding: 7px 6px 7px 14px; font-size: 13px; }
.tg-leave { width: 30px; height: 30px; margin-right: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); font-size: 16px; }
@media (max-width: 900px) {
  .together-chip { top: 52px; }
}

/* Phone: home screen scrolls now that there are many apps */
.phone .home { overflow-y: auto; }
.phone .dock { position: sticky; bottom: 0; }
.phone .widget { margin-bottom: 10px; }
.phone .w-time { font-size: 40px; }
.phone .w-card { margin-top: 8px; }

/* Market Day app */
.md-hero { border-radius: 16px; padding: 14px; background: linear-gradient(135deg, #3f4bd8, #6a4bd8); color: #fff; display: flex; flex-direction: column; gap: 4px; flex: none; }
.md-hero.on { background: linear-gradient(135deg, #ff9a3d, #e8433a); }
.md-hero b { font-size: 17px; }
.md-hero small { opacity: 0.92; }
.md-shops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: none; }
.md-shop { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.md-shop span { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; }
.md-shop small { font-size: 10px; text-align: center; line-height: 1.2; color: var(--ink); }

/* Discover app */
.disc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.disc { background: #fff; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 2px; text-align: left; font-size: 12.5px; }
.disc-img { position: relative; height: 70px; border-radius: 10px; display: grid; place-items: center; font-size: 34px; margin-bottom: 4px; }
.disc-img i { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 9.5px; font-weight: 700; background: rgba(255, 255, 255, 0.92); padding: 1px 6px; border-radius: 999px; }
.disc small { color: var(--muted); font-size: 11px; }
.disc-price { color: var(--green); font-weight: 800; }

/* Find it app */
.fi-form { display: flex; flex-direction: column; gap: 6px; flex: none; }
.fi-form input { height: 38px; border-radius: 12px; border: 0; background: #e9e7e1; padding: 0 12px; font: inherit; font-size: 13.5px; outline: none; }
.fi-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: none; }
.fi-chips button { font-size: 11.5px; padding: 4px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.fi-resp { display: flex; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); animation: pop 0.25s ease; }
.fi-resp p { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.4; }
.fi-actions { display: flex; gap: 6px; align-items: center; }
.p-btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* Following app */
.fol .p-row { background: #f6f5f1; }

/* Friends app */
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.cmp > div { background: #fff; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cmp h5 { margin: 0; font-size: 12px; }
.cmp small { color: var(--muted); font-size: 11px; }
.cmp-item { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 6px; text-align: left; font-size: 11.5px; }
.cmp-item span { grid-row: span 2; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.cmp-item small { color: var(--green); font-weight: 700; }
.cmp-note { color: var(--muted); }
.tg-thread { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; flex: none; }
.tg-msg { align-self: flex-start; max-width: 85%; background: #fff; border-radius: 4px 14px 14px 14px; padding: 7px 10px; font-size: 13px; }
.tg-msg.me { align-self: flex-end; background: var(--green-soft); border-radius: 14px 4px 14px 14px; }
.tg-msg small { display: block; color: var(--muted); font-size: 10.5px; }
.tg-sys { align-self: center; font-size: 11px; color: var(--muted); text-align: center; }
.tg-share { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; text-align: left; margin-top: 3px; }
.tg-share span { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; }
.tg-form { display: flex; gap: 6px; flex: none; }
.tg-form input { flex: 1; min-width: 0; height: 36px; border-radius: 10px; border: 0; background: #e9e7e1; padding: 0 10px; font: inherit; font-size: 13px; outline: none; }
.tg-invite { bottom: 90px; }

/* Phone: scroll without a visible scrollbar (it also pushed the grid off-centre) */
.phone .home, .phone .app-body, .phone .tg-thread { scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; }
.phone .home::-webkit-scrollbar, .phone .app-body::-webkit-scrollbar, .phone .tg-thread::-webkit-scrollbar { display: none; }
.phone .app-grid { justify-items: center; width: 100%; }
.phone .app { width: 100%; }

/* Tabs inside the Shops app */
.shop-tabs { display: flex; gap: 4px; margin: 0 14px 6px; padding: 3px; background: #e9e7e1; border-radius: 12px; flex: none; }
.shop-tabs button { flex: 1; padding: 7px 4px; border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.shop-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.phone .phone-screen { min-width: 0; width: 100%; }
.phone .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.phone .app-label { max-width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.phone .dock { justify-content: space-evenly; }

/* Jobs app */
.jb-hero { flex: none; border-radius: 16px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, #1e3a8a, #3b82f6); display: flex; flex-direction: column; gap: 4px; }
.jb-hero b { font-size: 16px; }
.jb-hero small { opacity: 0.92; line-height: 1.4; }
.jb-hero span { align-self: flex-start; margin-top: 4px; font-size: 11.5px; font-weight: 800; background: rgba(255, 255, 255, 0.2); padding: 3px 9px; border-radius: 999px; }
.jb-active { flex: none; background: #fff; border: 2px solid #3b82f6; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.jb-active small { color: var(--muted); }
/* Debug performance meter */
.perf-meter { position: fixed; left: 12px; bottom: 180px; z-index: 60; background: rgba(0, 0, 0, 0.7); color: #a7f3d0; font: 600 12px ui-monospace, Consolas, monospace; padding: 5px 9px; border-radius: 8px; pointer-events: none; }

/* Badge on a phone app tab */
.tab-badge { font-style: normal; background: #ef4444; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 10.5px; margin-left: 2px; }

/* Help app */
.help-ask { display: flex; gap: 6px; flex: none; }
.help-ask input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #d1d5db; font: inherit; font-size: 13.5px; }
.help-ask button { padding: 0 14px; border-radius: 12px; background: #0369a1; color: #fff; font-weight: 800; }
.help-a { flex: none; background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.help-a b { font-size: 13.5px; }
.help-a p { margin: 0; font-size: 13px; color: #475569; line-height: 1.45; }
.help-a .p-btn { align-self: flex-start; margin-top: 4px; }
.help-topics { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.help-topics button { padding: 10px 8px; border-radius: 12px; background: #fff; font-weight: 700; font-size: 12.5px; text-align: left; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.help-topics button:hover { background: #eff6ff; }
.help-links { flex: none; display: flex; flex-direction: column; gap: 6px; }
.help-back { align-self: flex-start; font-weight: 700; color: #0369a1; padding: 2px 0; }

/* Contacts app */
.ct-row { flex: none; position: relative; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.ct-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.ct-dot { position: absolute; left: 38px; top: 34px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px #fff; }
.ct-actions { display: flex; gap: 4px; flex: none; }
.ct-actions button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: #f1f5f9; font-size: 13px; font-weight: 700; }
.ct-actions button:hover { background: #e2e8f0; }
.ct-empty { flex: none; color: #94a3b8; font-size: 12.5px; margin: 0 2px; }

/* Staff app */
.sf-card { flex: none; display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 14px; padding: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.sf-top { display: flex; align-items: center; gap: 10px; }
.sf-top .p-meta { flex: 1; min-width: 0; }
.sf-stars { flex: none; color: #f59e0b; font-size: 13px; letter-spacing: 1px; }
.sf-does { color: #64748b; font-size: 12px; line-height: 1.35; }
.sf-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #475569; }
.sf-morale { flex: 1; height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.sf-morale i { display: block; height: 100%; border-radius: 999px; }
.sf-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sf-actions small { color: #94a3b8; font-size: 12px; }
.sf-actions button { padding: 6px 10px; border-radius: 999px; background: #f1f5f9; font-size: 12px; font-weight: 700; }
.sf-actions button:hover { background: #e2e8f0; }
.sf-actions button.go { background: #0ea5e9; color: #fff; }
.sf-actions button.danger { background: #fee2e2; color: #b91c1c; margin-left: auto; }
