/* Kasi Market: trust score, verified badges, chat, Safe Pay, verification and AI helper */

/* ---------- Kasi Trust Score & verified badges ---------- */
.trust-chip { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--glass-2); color: var(--muted); }
.trust-chip.excellent { background: rgba(60,207,122,.16); color: var(--green); }
.trust-chip.good { background: rgba(60,207,122,.10); color: #8fe3b2; }
.trust-chip.fair { background: rgba(255,192,77,.14); color: var(--amber); }
.chat-head .trust-chip { align-self: center; flex: none; }
.vbadges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(60,207,122,.14); color: var(--green); }
.vbadge.biz { background: rgba(255,138,31,.16); color: var(--orange); }
.vbadge.off { background: var(--glass-2); color: var(--muted); font-weight: 500; }
.trust { display: flex; gap: 16px; align-items: flex-start; padding: 18px; margin: 16px 0; }
.detail-wrap > .trust { grid-column: 2; margin-top: 0; }
.trust-ring {
  --c: var(--muted); flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1;
  background: radial-gradient(closest-side, #1b1918 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.08) 0);
}
.trust-ring b { font-size: 24px; color: var(--text); }
.trust-ring span { font-size: 10px; color: var(--muted); }
.trust-ring.excellent { --c: var(--green); }
.trust-ring.good { --c: #8fe3b2; }
.trust-ring.fair { --c: var(--amber); }
.trust-label.excellent { color: var(--green); }
.trust-label.good { color: #8fe3b2; }
.trust-label.fair { color: var(--amber); }
.trust-label.new { color: var(--muted); }
.trust-body { min-width: 0; flex: 1; }
.trust-title { font-weight: 600; }
.trust-why { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.trust-why summary { cursor: pointer; }
.trust-why ul { margin: 6px 0 0; padding-left: 18px; }
.stars { color: rgba(255,255,255,.2); letter-spacing: 1px; }
.stars .on { color: var(--amber); }
.reviews { display: grid; gap: 10px; }
.review-card { padding: 14px; }
.review-card .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.review-card p { margin: 8px 0 4px; }

/* star picker: stars up to the chosen one light up */
.star-pick { display: flex; gap: 6px; font-size: 34px; }
.star-pick input { position: absolute; opacity: 0; pointer-events: none; }
.star-pick span { cursor: pointer; color: rgba(255,255,255,.2); transition: color .15s; }
.star-pick:has(input:checked) label span { color: var(--amber); }
.star-pick label:has(input:checked) ~ label span { color: rgba(255,255,255,.2); }
.star-pick label:has(input:focus-visible) span { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

/* ---------- unread chat badge in the navigation ---------- */
.tabbar a, .desknav a { position: relative; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.tabbar .nav-badge { position: absolute; top: 0; right: 4px; }
.nav-badge[hidden] { display: none; }

/* ---------- chat ---------- */
.chat-row { position: relative; }
.chat-row .row { display: flex; justify-content: space-between; gap: 8px; }
.chat-row.unread h4 { color: var(--orange); }
.chat-last { font-size: 13px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-count { position: absolute; right: 12px; bottom: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.chat-page { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; position: sticky; top: 8px; z-index: 5; background: rgba(27,25,24,.92); }
.chat-ad { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.chat-ad .thumb { width: 44px; height: 44px; flex: none; border-radius: 12px; font-size: 22px; aspect-ratio: auto; }
.chat-ad > span:last-child { display: grid; min-width: 0; }
.chat-ad .mini, .chat-ad b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unlock { font-size: 12.5px; color: var(--muted); padding: 8px 12px; border-radius: 12px; background: var(--glass); border: 1px dashed var(--line); }
.unlock.done { color: var(--green); border-style: solid; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chat-msgs { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; overflow-y: auto; height: calc(100vh - 380px); min-height: 220px; }
.msg { display: grid; gap: 4px; max-width: 82%; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.theirs { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; font-size: 14.5px; }
.msg.mine .bubble { background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: #fff; border-bottom-right-radius: 6px; }
.msg.theirs .bubble { background: var(--glass-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble .t { display: block; font-size: 10.5px; opacity: .7; margin-top: 3px; }
.scam-warn { font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 14px; background: rgba(255,90,90,.12); border: 1px solid rgba(255,90,90,.45); color: #ffc2c2; display: grid; gap: 4px; }
.scam-warn b { color: #ff9a9a; }
.scam-warn .link-btn { justify-self: start; padding: 2px 0; color: #ff9a9a; }
.hide-note { font-size: 11px; }
.chat-send { display: flex; gap: 8px; align-items: flex-end; padding: 8px; background: rgba(27,25,24,.95); }
.chat-send textarea.input { min-height: 44px; max-height: 140px; resize: none; padding: 11px 14px; }
/* Phones: a chat fills the screen like a messaging app. The tab bar steps aside, messages scroll with the page,
   and the message box stays stuck to the bottom. */
@media (max-width: 959px) {
  body.in-chat .tabbar { display: none; }
  body.in-chat .shell { padding-bottom: 12px; }
  .chat-head { margin-right: 56px; }
  .chat-msgs { height: auto; min-height: 40vh; overflow: visible; }
  .chat-send { position: sticky; bottom: 8px; z-index: 5; }
}

/* ---------- Safe Pay ---------- */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; }
.modal .row { display: flex; justify-content: space-between; align-items: center; }
.track { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.track li { counter-increment: s; font-size: 11.5px; color: var(--muted); text-align: center; display: grid; justify-items: center; gap: 6px; }
.track li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--line); font-weight: 700; }
.track li.done { color: var(--green); }
.track li.done::before { content: "✓"; background: rgba(60,207,122,.18); border-color: var(--green); color: var(--green); }
.form .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- phone verification & AI helper ---------- */
.otp-input { font-size: 26px; letter-spacing: 10px; text-align: center; }
.ai-box { margin-top: 12px; padding: 14px; border-radius: 16px; border: 1px solid rgba(255,138,31,.4); background: linear-gradient(160deg, rgba(255,138,31,.12), rgba(255,106,0,.04)); display: grid; gap: 8px; }
.ai-head { font-size: 14px; }
.ai-row { display: flex; gap: 8px; }
.ai-row select { flex: 1; min-width: 0; }
.flagged p { margin: 8px 0; }
