/* Consumer Crow AI shell — Demo Integration D1. The smallest clean
   reusable shell: top-left nav (☰ Chat / Explore), one active surface.
   Deliberately NOT a dashboard — two destinations only. */
:root {
  --cs-bg: var(--xk-ivory, #faf8f3); --cs-ink: var(--xk-ink, #14120d); --cs-ink-2: var(--xk-ink-2, #6b665a);
  --cs-line: var(--xk-line, #e4dfd2); --cs-paper: var(--xk-paper, #f1ede3); --cs-accent: var(--xk-ink, #14120d);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: var(--cs-bg); color: var(--cs-ink);
  display: flex; flex-direction: column;
  /* Phase 5 (§28) — real, evidenced mobile bug: a bare `100vh` does not
     shrink when the on-screen keyboard opens on a real mobile browser,
     so the chat/search input bar can end up covered by the keyboard.
     `100dvh` (the actual visible viewport) is preferred; `100vh` stays
     as the fallback for browsers that don't support it — never a
     removal of old behavior, purely an additive, more-correct unit. */
  min-height: 100vh;
  min-height: 100dvh;
}

#csTopbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--cs-line); background: var(--cs-bg);
  position: sticky; top: 0; z-index: 40;
}
#csMenuBtn {
  border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer;
  padding: 6px 8px; border-radius: 8px; color: var(--cs-ink);
}
#csMenuBtn:hover { background: var(--cs-paper); }
#csBrand { font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
#csBizName { margin-left: auto; font-size: 13px; color: var(--cs-ink-2); max-width: 50%; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#csNav {
  position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--cs-bg);
  border-right: 1px solid var(--cs-line); transform: translateX(-100%);
  transition: transform .18s ease; z-index: 60; padding: 16px 10px; display: flex; flex-direction: column; gap: 4px;
}
#csNav.open { transform: translateX(0); }
#csNavScrim {
  position: fixed; inset: 0; background: rgba(20,18,10,.28); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
#csNavScrim.open { opacity: 1; pointer-events: auto; }
#csNav button {
  display: flex; align-items: center; gap: 10px; text-align: left; border: none; background: none;
  padding: 11px 12px; border-radius: 10px; font-size: 15px; color: var(--cs-ink); cursor: pointer;
}
#csNav button:hover { background: var(--cs-paper); }
#csNav button.active { background: var(--cs-paper); font-weight: 600; }
#csNavHeader { font-size: 13px; color: var(--cs-ink-2); padding: 4px 12px 10px; }

#csSurface { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#csSurface[hidden] { display: none; }

/* ── Chat surface (D2 §3-4,§20-22) — a centered, consumer-grade column,
   never edge-to-edge admin-style stretch. ───────────────────────────── */
#csChat { flex: 1; display: flex; flex-direction: column; min-height: 0; align-items: center; }
#csChatLog {
  flex: 1; overflow-y: auto; width: 100%; max-width: 820px;
  padding: 28px 20px 16px; display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}

/* Welcome state — business-aware intro, never a lonely bubble on a huge
   blank page (§4). */
#csWelcome { text-align: center; padding: 10px 8px 6px; }
#csWelcome .csw-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
#csWelcome .csw-greeting { color: var(--cs-ink-2); font-size: 15px; margin-bottom: 18px; }
#csWelcome .csw-suggestions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#csWelcome .csw-suggestions button {
  border: 1px solid var(--cs-line); background: #fff; border-radius: 999px; padding: 9px 16px;
  font-size: 13.5px; cursor: pointer; color: var(--cs-ink); transition: border-color .12s ease, background .12s ease;
}
#csWelcome .csw-suggestions button:hover { border-color: var(--cs-ink); background: var(--cs-paper); }

#csChatLog .csm-row { display: flex; width: 100%; animation: csFadeUp .18s ease; }
#csChatLog .csm-row.user { justify-content: flex-end; }
#csChatLog .csm-row.ai { justify-content: flex-start; }
#csChatLog .csm { max-width: 72%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; }
#csChatLog .csm.user { background: var(--cs-ink); color: #fff; border-bottom-right-radius: 5px; }
#csChatLog .csm.ai { background: var(--cs-paper); color: var(--cs-ink); border-bottom-left-radius: 5px; }
#csChatLog .csm-think-row { display: flex; justify-content: flex-start; }
#csChatLog .csm.think {
  background: var(--cs-paper); color: var(--cs-ink-2); font-size: 13px; padding: 10px 15px;
  border-radius: 16px; border-bottom-left-radius: 5px; display: flex; align-items: center; gap: 7px;
}
#csChatLog .csm-typing { display: inline-flex; gap: 3px; }
#csChatLog .csm-typing span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--cs-ink-2);
  animation: csTypingDot 1.1s ease-in-out infinite;
}
#csChatLog .csm-typing span:nth-child(2) { animation-delay: .15s; }
#csChatLog .csm-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes csTypingDot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes csFadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Structured recommendation card (§18) — item name/price/description +
   a real CTA, not a bare text dump. */
#csChatLog .csm-item-card {
  max-width: 72%; align-self: flex-start; background: #fff; border: 1px solid var(--cs-line);
  border-radius: 14px; padding: 12px 14px; margin-top: -4px;
}
#csChatLog .csm-item-card .csic-name { font-weight: 600; font-size: 14.5px; }
#csChatLog .csm-item-card .csic-price { color: var(--cs-ink-2); font-size: 13.5px; margin: 2px 0 4px; }
#csChatLog .csm-item-card .csic-desc { color: var(--cs-ink-2); font-size: 13px; line-height: 1.4; margin-bottom: 8px; }

#csChatLog .csm-actions { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
#csChatLog .csm-actions { padding-left: 2px; }
#csChatLog .csm-actions button {
  border: 1px solid var(--cs-line); background: #fff; border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; cursor: pointer; color: var(--cs-ink); transition: border-color .12s ease;
}
#csChatLog .csm-actions button:hover { border-color: var(--cs-ink); }

#csChatInputWrap {
  width: 100%; display: flex; justify-content: center; padding: 10px 20px 18px;
  /* §28 — the composer must never sit behind Android's system nav bar. */
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(var(--cs-bg-transparent, rgba(251,249,245,0)), var(--cs-bg) 40%);
}
#csChatInputRow {
  display: flex; align-items: flex-end; gap: 8px; width: 100%; max-width: 820px;
  background: #fff; border: 1px solid var(--cs-line); border-radius: 22px; padding: 8px 8px 8px 18px;
  box-shadow: 0 2px 10px rgba(20,18,10,.05);
}
#csChatInput {
  flex: 1; border: none; padding: 8px 0; font-size: 14.5px; outline: none; background: transparent;
  resize: none; max-height: 120px; line-height: 1.4; font-family: inherit;
}
#csChatSend {
  border: none; background: var(--cs-ink); color: #fff; border-radius: 50%; width: 36px; height: 36px;
  font-size: 15px; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease;
}
#csChatSend:hover:not(:disabled) { transform: scale(1.05); }
#csChatSend:disabled { opacity: .4; cursor: default; }

/* ── Explore surface ──────────────────────────────────────────────── */
#csExplore { flex: 1; min-height: 0; overflow-y: auto; }
#csExploreLoading { padding: 40px; text-align: center; color: var(--cs-ink-2); }

/* ── Ask Crow entry inside Explore (§33) ─────────────────────────── */
#csAskCrow {
  position: fixed; right: 18px; bottom: 18px; z-index: 30;
  border: none; background: var(--cs-ink); color: #fff; border-radius: 999px;
  padding: 12px 18px; font-size: 14px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
#csAskCrow[hidden] { display: none; }

/* ── Phase 5 — Explore's real action bar (Order/Book, §8/§10) ───────── */
#csExploreActionBar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--cs-line); background: #fff;
}
#csExploreActionBar .csexp-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Topbar sign-in affordance ────────────────────────────────────── */
#csAuthBtn {
  border: 1px solid var(--cs-line); background: #fff; border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; cursor: pointer; color: var(--cs-ink); margin-left: 8px; flex: none;
  max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-biz-switch {
  border: 1px solid transparent; background: none; padding: 6px 8px;
  font-size: 12.5px; color: var(--cs-ink-2); text-decoration: none; flex: none;
  margin-left: 8px; white-space: nowrap;
}
.cs-biz-switch:hover { text-decoration: underline; color: var(--cs-ink); }
@media (max-width: 640px) { .cs-biz-switch { display: none; } }

/* ── Shared tags/buttons (Search results, Explore action bar, Activity) ── */
.cstag {
  display: inline-block; border: 1px solid var(--cs-line); border-radius: 999px;
  padding: 3px 10px; font-size: 11.5px; color: var(--cs-ink-2); background: var(--cs-paper);
}
.cs-fresh-confirmed { color: #1a7a3e; border-color: #bfe3c9; background: #eefaf1; }
.cs-fresh-recent { color: #9a6b0f; border-color: #f0dfb0; background: #fdf7e8; }
.cs-fresh-unknown { color: var(--cs-ink-2); }
.csbtn-primary {
  border: none; background: var(--cs-ink); color: #fff; border-radius: 999px; padding: 8px 16px;
  font-size: 13px; cursor: pointer;
}
.csbtn-primary:disabled { opacity: .5; cursor: default; }
.csbtn-ghost {
  border: 1px solid var(--cs-line); background: #fff; color: var(--cs-ink); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; cursor: pointer;
}
.cs-muted { color: var(--cs-ink-2); font-size: 13px; }
.cs-loading { padding: 30px; text-align: center; color: var(--cs-ink-2); }
.cs-payline { color: var(--cs-ink-2); }
/* Phase 7 — deliberately distinct from .csbtn-primary (Order/Book) and
   never styled like an "Ask"/chat affordance — a lock icon + a
   different color reinforces "human, secure, different domain." */
.csbtn-message {
  border: 1px solid #1f6feb; background: #eef5ff; color: #10346b; border-radius: 999px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
}

/* ── Search surface (Phase 5) ─────────────────────────────────────── */
#csSearch { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 40px; max-width: 720px; margin: 0 auto; width: 100%; }
#csSearchBar { display: flex; gap: 8px; margin-bottom: 12px; }
#csSearchInput {
  flex: 1; border: 1px solid var(--cs-line); border-radius: 14px; padding: 14px 16px;
  font-size: 15px; outline: none; background: #fff;
}
#csSearchGo {
  border: none; background: var(--cs-ink); color: #fff; border-radius: 14px; width: 48px;
  font-size: 16px; cursor: pointer;
}
#csSearchChips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cschip {
  border: 1px solid var(--cs-line); background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: 13px; cursor: pointer; color: var(--cs-ink);
}
.cschip.active { background: var(--cs-ink); color: #fff; border-color: var(--cs-ink); }
#csSearchStatus { font-size: 13px; color: var(--cs-ink-2); margin-bottom: 10px; }
#csSearchResults { display: flex; flex-direction: column; gap: 12px; }
.cscard {
  border: 1px solid var(--cs-line); border-radius: 16px; padding: 14px 16px; background: #fff; cursor: pointer;
}
.cscard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cscard-name { font-weight: 600; font-size: 15px; }
.cscard-right { text-align: right; font-size: 12.5px; color: var(--cs-ink-2); flex: none; }
.cscard-offering { font-size: 13.5px; margin: 6px 0; color: var(--cs-ink-2); }
.cscard-offering b { color: var(--cs-ink); }
.cscard-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cscard-actions { display: flex; gap: 8px; }

/* ── Activity surface (Phase 5) ───────────────────────────────────── */
#csActivity { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 40px; max-width: 720px; margin: 0 auto; width: 100%; }
#csActivityTitle { font-size: 20px; margin: 0 0 14px; }
.csact-row { border: 1px solid var(--cs-line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.csact-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.csact-state { color: var(--cs-ink-2); font-size: 12.5px; }
.csact-biz { color: var(--cs-ink-2); font-size: 12.5px; cursor: pointer; margin-bottom: 4px; }
.csact-status { font-size: 13px; }

/* ── Messages surface (Phase 7, Secure Messaging) ─────────────────── */
#csSurfaceMessages { flex: 1; min-height: 0; overflow-y: auto; }
#csMessagesList, #csConversationDetail { max-width: 720px; margin: 0 auto; width: 100%; padding: 20px 16px 40px; }
#csMessagesTitle { font-size: 20px; margin: 0 0 6px; }
.csconv-row {
  border: 1px solid var(--cs-line); border-radius: 14px; padding: 12px 14px; margin-top: 10px;
  background: #fff; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.csconv-name { font-weight: 600; font-size: 14.5px; }
.csconv-time { color: var(--cs-ink-2); font-size: 12px; }
#csConversationTitle { font-size: 18px; margin: 10px 0 14px; }
.cs-msg-honest-state {
  border: 1px solid #cfe0fb; background: #f3f8ff; border-radius: 14px; padding: 16px; font-size: 14px;
}
.cs-msg-honest-state p { margin: 0 0 10px; }
.cs-msg-honest-state p:last-child { margin-bottom: 0; }

/* ── Shared modals (sign-in, booking) ─────────────────────────────── */
.cs-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,18,10,.4); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cs-modal-overlay[hidden] { display: none; }
.cs-modal {
  background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 380px;
  position: relative; max-height: 86vh; overflow-y: auto;
}
.cs-modal h3 { margin: 0 0 14px; }
.cs-modal label { display: block; font-size: 12.5px; color: var(--cs-ink-2); margin-bottom: 10px; }
.cs-modal input, .cs-modal select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--cs-line);
  border-radius: 8px; font-size: 14px;
}
.cs-modal-close {
  position: absolute; right: 14px; top: 14px; border: none; background: none; font-size: 20px;
  cursor: pointer; color: var(--cs-ink-2);
}
#csAuthMsg, #csBookMsg { font-size: 12.5px; color: #b34141; min-height: 16px; margin-top: 4px; }

/* ── Status strip (Phase 5) ───────────────────────────────────────── */
#csStatusStrip {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70;
  background: var(--cs-ink); color: #fff; border-radius: 14px; padding: 10px 16px; font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 90%;
}
#csStatusStrip[hidden] { display: none; }

@media (max-width: 640px) {
  #csChatLog .csm { max-width: 88%; }
  #csBizName { display: none; }
}

/* Account menu (signed-in) */
#csAccountMenu { position: absolute; top: 100%; right: 12px; min-width: 200px; background: #fff; color: #111;
  border: 1px solid rgba(0,0,0,.12); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px 0; z-index: 50; }
#csAccountMenu[hidden] { display: none; }
#csAccountMenu #csAccountEmail { padding: 8px 14px; font-size: 12px; color: #666; border-bottom: 1px solid rgba(0,0,0,.08); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#csAccountMenu a, #csAccountMenu button { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
#csAccountMenu a:hover, #csAccountMenu button:hover { background: rgba(0,0,0,.05); }
#csTopbar { position: relative; }

/* ═══ General-mode shell: Map · Explore · Ask · Messages · Profile ═══
   One shell for all five sections. Mobile: bottom tab bar (safe-area
   aware). Laptop (>=900px): left rail. Business mode keeps its drawer. */
#csTopbar { position: sticky; min-height: 56px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
body.cs-general #csMenuBtn, body.cs-general #csNavScrim, body.cs-general #csNavHeader { display: none; }
body.cs-general #csNav {
  position: fixed; inset: auto 0 0 0; width: auto; transform: none; transition: none;
  flex-direction: row; justify-content: space-around; gap: 0;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  border-right: none; border-top: 1px solid var(--cs-line); z-index: 45;
}
body.cs-general #csNav button {
  flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  padding: 6px 2px; font-size: 11px; min-height: 52px; border-radius: 12px;
}
body.cs-general #csNav .ic { font-size: 19px; line-height: 1; }
body.cs-general #csSurface { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
#csNav .lb { white-space: nowrap; }
.cs-chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-linkbtn { background: none; border: none; padding: 6px 0; color: var(--cs-ink-2); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.cschip { border: 1px solid var(--cs-line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--cs-ink); }
.cschip.active { background: var(--cs-ink); color: #fff; border-color: var(--cs-ink); }
@media (min-width: 900px) {
  body.cs-general #csNav {
    inset: 56px auto 0 0; width: 200px; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 14px 10px; border-top: none; border-right: 1px solid var(--cs-line);
  }
  body.cs-general #csNav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 11px 12px; min-height: 0; }
  body.cs-general #csSurface { padding-left: 200px; padding-bottom: 0; }
}

/* ── Map ── */
#csMap { display: flex; flex-direction: column; height: calc(100dvh - 56px - 60px - env(safe-area-inset-bottom, 0px)); min-height: 0; }
#csMapPanel { padding: 8px 12px 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#csMapBar { display: flex; gap: 8px; }
#csMapBar input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--cs-line); border-radius: 12px; font: inherit; font-size: 16px; }
#csMapStatus { font-size: 12.5px; min-height: 16px; }
#csMapList { display: none; }
#csMapStage { position: relative; flex: 1; min-height: 240px; border-top: 1px solid var(--cs-line); margin-top: 8px; }
#csMapCanvas { position: absolute; inset: 0; }
#csMapSearchArea { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 500; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#csMapSearchArea[hidden], #csMapPreview[hidden] { display: none; }
#csMapPreview {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 500; background: #fff;
  border: 1px solid var(--cs-line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.csmp-name { font-weight: 700; font-size: 15px; } .csmp-meta { font-size: 12.5px; color: var(--cs-ink-2); margin: 2px 0 8px; }
.csmp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 900px) {
  #csMap { height: calc(100dvh - 56px); flex-direction: row; }
  #csMapPanel { width: 360px; flex: none; padding: 14px 14px 0; border-right: 1px solid var(--cs-line); overflow-y: auto; }
  #csMapList { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; }
  #csMapStage { flex: 1; margin-top: 0; border-top: none; }
  #csMapPreview { left: 16px; right: auto; width: 340px; }
}
.csmap-row { text-align: left; border: 1px solid var(--cs-line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; }
.csmap-row.active { border-color: var(--cs-ink); }
.csmap-row b { display: block; font-size: 14px; } .csmap-row span { font-size: 12px; color: var(--cs-ink-2); }
.csmap-nopin { font-size: 12.5px; color: var(--cs-ink-2); }
.csmap-nopin button { margin-left: 6px; }

/* ── Explore ── */
#csDiscover { padding: 18px 16px 28px; width: 100%; max-width: 1080px; margin: 0 auto; }
#csDiscover h1, #csAskIntro h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.csdisc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 22px; }
.csdisc-tile { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px; border: 1px solid var(--cs-line); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; min-width: 0; }
.csdisc-tile b { font-size: 15px; } .csdisc-tile span { font-size: 12.5px; color: var(--cs-ink-2); }
.csdisc-sec h2 { font-size: 16px; margin: 20px 0 10px; }
.csdisc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

/* ── Ask ── */
#csAskIntro { width: 100%; max-width: 820px; margin: 0 auto; padding: 16px 16px 0; }
#csSearch { width: 100%; max-width: 820px; margin: 0 auto; }
#csSearchBar input { font-size: 16px; }   /* no iOS zoom-on-focus */
#csCompareBtn { margin: 6px 0; }
.cs-uncertain { font-size: 12px; color: #8a6a1f; }

/* ── Profile ── */
#csActivity { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px; }
#csActivity h2 { font-size: 16px; margin: 22px 0 8px; }
#csProfileCard { display: flex; gap: 14px; align-items: center; border: 1px solid var(--cs-line); border-radius: 14px; padding: 14px 16px; margin: 10px 0 14px; background: #fff; }
#csProfileAvatar { width: 52px; height: 52px; border-radius: 50%; background: var(--cs-ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
#csProfileMeta { min-width: 0; } #csProfileWho { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#csProfileActions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#csProfileSettings { border: 1px solid var(--cs-line); border-radius: 12px; padding: 10px 14px; background: #fff; }
#csProfileSettings summary { cursor: pointer; font-weight: 600; }
#csPwForm { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-width: 360px; }
#csPwForm input { padding: 10px 12px; border: 1px solid var(--cs-line); border-radius: 10px; font-size: 16px; }
.cs-biz-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--cs-line); border-radius: 12px; padding: 10px 12px; background: #fff; margin-bottom: 8px; cursor: pointer; }

/* ── Modals: never taller than the visible viewport (keyboard-safe) ── */
.cs-modal { max-height: 88dvh; overflow-y: auto; }
.cs-modal input { font-size: 16px; }
#csAuthOverlay .cs-modal { display: flex; flex-direction: column; gap: 10px; }
#csAuthOverlay .cs-modal > div { display: flex; flex-direction: column; gap: 10px; }
#csAuthOverlay [hidden] { display: none !important; }

.csmap-pin span { display: block; width: 26px; height: 26px; background: #17160f; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.csmap-pin.active span { background: #c2410c; }
.leaflet-container { font: inherit; }

/* The business context switch stays visible on phones in the consumer shell. */
@media (max-width: 640px) { body.cs-general .cs-biz-switch { display: inline-block; padding: 6px 4px; } }

/* ═══ XkroX visual system v2 (see static/xk/xk-brand.css) ═══════════════
   Black + warm white, real imagery for richness, sans UI type with
   serif reserved for a few display moments. No permanent side rail:
   desktop = compact top navigation, mobile = bottom tabs. */
body { font-family: var(--xk-ui); }
[hidden] { display: none !important; }
#csTopbar { min-height: 56px; padding: env(safe-area-inset-top, 0px) 20px 0; background: var(--cs-bg); border-bottom: 1px solid var(--cs-line); gap: 14px; }
#csBrand { display: inline-flex; align-items: center; margin-right: 6px; }
#csBrand img { display: block; height: 15px; width: auto; }
#csBack { font-size: 20px; text-decoration: none; color: var(--cs-ink); padding: 6px 8px 6px 0; }
#csBizName { font-size: 14px; font-weight: 600; color: var(--cs-ink); }
.cs-biz-switch { margin-left: auto; font-size: 13px; color: var(--cs-ink-2); text-decoration: none; padding: 6px 4px; }
.cs-biz-switch:hover { color: var(--cs-ink); text-decoration: underline; }
.cs-crow-btn { margin-left: auto; border: 1px solid var(--cs-ink); background: var(--cs-ink); color: var(--cs-bg); border-radius: 4px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
body.cs-business #csBizName + .cs-crow-btn { margin-left: auto; }
#csAuthBtn { margin-left: 0; border: 1px solid var(--cs-ink); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; }
#csAuthBtn.authed { width: 34px; height: 34px; padding: 0; background: var(--cs-ink); color: var(--cs-bg); display: grid; place-items: center; font-weight: 600; }
body.cs-general #csAuthBtn { margin-left: auto; }
body.cs-general .cs-biz-switch { margin-left: auto; }
body.cs-general #csBizSwitch:not([hidden]) ~ #csAuthBtn { margin-left: 0; }

/* Navigation: icons + labels bottom bar on phones; text links in the top bar on desktop */
body.cs-general #csNav { background: var(--cs-bg); }
body.cs-general #csNav button { font-size: 11px; color: var(--cs-ink-2); }
body.cs-general #csNav button.active, body.cs-general #csNav button:hover { background: none; color: var(--cs-ink); }
body.cs-general #csNav button.active { font-weight: 600; }
#csNav .ic { display: inline-grid; place-items: center; }
body.cs-business #csNav, body.cs-business #csMenuBtn, body.cs-business #csNavScrim { display: none; }
@media (min-width: 900px) {
  body.cs-general #csNav {
    inset: 0 auto auto 50%; transform: translateX(-50%); width: auto; height: 56px;
    flex-direction: row; align-items: center; justify-content: center; gap: 30px;
    padding: 0; border: none; background: none; z-index: 46;
  }
  body.cs-general #csNav button { flex: none; flex-direction: row; min-height: 0; padding: 18px 2px 16px; font-size: 14px; border-radius: 0; gap: 0; border-bottom: 2px solid transparent; }
  body.cs-general #csNav button.active { border-bottom-color: var(--cs-ink); }
  body.cs-general #csNav .ic { display: none; }
  body.cs-general #csSurface { padding-left: 0; padding-bottom: 0; }
}
body.cs-general #csSurface { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { body.cs-general #csSurface { padding-bottom: 0; } }

/* Quiet controls: underlined text options instead of pill soup */
.cs-chiprow { gap: 18px; }
.cschip { border: none; border-bottom: 1px solid var(--cs-line); background: none; border-radius: 0; padding: 4px 1px; font-size: 13.5px; color: var(--cs-ink-2); }
.cschip:hover { color: var(--cs-ink); border-bottom-color: var(--cs-ink); }
.cschip.active { background: none; color: var(--cs-ink); border-bottom: 2px solid var(--cs-ink); font-weight: 600; }
.csbtn-primary { background: var(--cs-ink); color: var(--cs-bg); border-radius: 4px; border: 1px solid var(--cs-ink); }
.csbtn-ghost { border-radius: 4px; }

/* ── Business page: Crow AI is a contextual panel, not a second shell ── */
#csCrowHead { display: none; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--cs-line); font-weight: 600; font-size: 14px; }
#csCrowHead button { border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--cs-ink); }
body.cs-business #csCrowHead { display: flex; }
body.cs-business #csSurfaceChat { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: 100%; background: var(--cs-bg); display: flex; flex-direction: column; }
body.cs-business #csSurfaceChat[hidden] { display: none !important; }
body.cs-business #csChat { flex: 1; min-height: 0; }
@media (min-width: 900px) {
  body.cs-business #csSurfaceChat { top: 56px; width: 440px; border-left: 1px solid var(--cs-line); box-shadow: -12px 0 40px rgba(20,18,13,.08); }
}
body.cs-embed #csTopbar { display: none; }
body.cs-embed #csSurfaceChat { top: 0; width: 100%; border: none; box-shadow: none; }
body.cs-embed #csSurface { display: block; }

/* ── Map: the map IS the page; results float over it ── */
#csMap { position: relative; display: block; height: calc(100dvh - 56px - 60px - env(safe-area-inset-bottom, 0px)); }
#csMapStage { position: absolute; inset: 0; margin: 0; border: none; min-height: 0; }
#csMapPanel { position: absolute; z-index: 600; top: 12px; left: 12px; right: 12px; width: auto; padding: 0; border: none; background: none; max-height: calc(100% - 24px); overflow: visible; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
#csMapPanel > * { pointer-events: auto; }
#csMapBar { background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; padding: 6px; box-shadow: 0 6px 24px rgba(20,18,13,.12); }
#csMapBar input { border: none; background: none; padding: 8px 10px; outline: none; }
#csMapLocate { white-space: nowrap; align-self: center; margin-right: 8px; }
#csMapChips { background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; padding: 8px 12px; align-self: flex-start; }
#csMapChips:empty { display: none; }
#csMapStatus, #csMapNoPin { align-self: flex-start; background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; padding: 6px 12px; font-size: 12.5px; }
#csMapStatus:empty { display: none; }
#csMapList { display: none; }
#csMapSearchArea { top: auto; bottom: 18px; left: 50%; border-radius: 4px; }
#csMapPreview { left: 12px; right: 12px; bottom: 14px; border-radius: 8px; box-shadow: 0 10px 30px rgba(20,18,13,.2); }
.csmp-name { font-size: 16px; }
@media (min-width: 900px) {
  #csMap { height: calc(100dvh - 56px); flex-direction: row; }
  #csMapPanel { right: auto; width: 360px; max-height: calc(100% - 24px); }
  #csMapList { display: flex; flex-direction: column; gap: 0; background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; overflow-y: auto; box-shadow: 0 6px 24px rgba(20,18,13,.12); }
  #csMapList:empty { display: none; }
  #csMapPanel.collapsed #csMapList, #csMapPanel.collapsed #csMapChips { display: none; }
  #csMapPreview { left: 396px; right: auto; width: 360px; bottom: 18px; }
  #csMapSearchArea { left: calc(50% + 190px); }
}
.csmap-row { border: none; border-bottom: 1px solid var(--cs-line); border-radius: 0; background: transparent; padding: 12px 14px; display: block; width: 100%; text-align: left; }
.csmap-row:last-child { border-bottom: none; }
.csmap-row.active { background: var(--cs-paper); }
#csMapToggle { display: none; }
@media (min-width: 900px) { #csMapToggle { display: inline-block; align-self: flex-start; background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; } }

/* ── Explore: image-led, editorial ── */
#csDiscover { max-width: 1240px; padding: 28px 28px 56px; }
#csDiscover .xe-head { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
#csDiscover h1 { font-family: var(--xk-display); font-weight: 500; font-size: 44px; letter-spacing: -.015em; line-height: 1; margin: 0; }
.xe-search { flex: 1; min-width: 240px; max-width: 520px; border: none; border-bottom: 1px solid var(--cs-ink); background: none; padding: 10px 2px; font: inherit; font-size: 16px; outline: none; border-radius: 0; }
.xe-tabs { display: flex; gap: 26px; margin: 22px 0 6px; overflow-x: auto; white-space: nowrap; border-bottom: 1px solid var(--cs-line); }
.xe-tab { border: none; background: none; padding: 8px 0 12px; font: inherit; font-size: 14px; color: var(--cs-ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.xe-tab.on { color: var(--cs-ink); font-weight: 600; border-bottom-color: var(--cs-ink); }
.xe-sec { margin-top: 36px; }
.xe-sec-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.xe-sec-h h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.xe-sec-h span { font-size: 12.5px; color: var(--cs-ink-2); }
.xe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 24px; }
.xe-card { display: block; text-align: left; border: none; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.xe-img { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--cs-paper); border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.xe-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.xe-card:hover .xe-img img { transform: scale(1.03); }

.xe-body { padding-top: 12px; }
.xe-name { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.xe-meta { margin-top: 3px; font-size: 13px; color: var(--cs-ink-2); }
.xe-act { margin-top: 10px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--cs-ink); display: inline-block; }
.xe-empty { padding: 60px 0; color: var(--cs-ink-2); }
@media (max-width: 640px) { #csDiscover { padding: 20px 16px 40px; } #csDiscover h1 { font-size: 34px; } .xe-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ── Ask: identity + one dominant input; results take over ── */
#csSearch { max-width: 860px; display: flex; flex-direction: column; padding: 28px 20px 40px; }
#csAskIntro { padding: 0; max-width: none; }
#csSearch.ask-empty { min-height: calc(100dvh - 56px - 60px - env(safe-area-inset-bottom, 0px)); justify-content: center; }
@media (min-width: 900px) { #csSearch.ask-empty { min-height: calc(100dvh - 56px); } }
#csSearch.ask-empty #csAskIntro { text-align: center; }
#csAskIntro h1 { font-family: var(--xk-display); font-weight: 500; font-size: 56px; letter-spacing: -.02em; line-height: 1; margin: 0 0 22px; }
#csSearch.ask-active #csAskIntro h1 { font-size: 26px; margin: 0 0 14px; }
#csSearch.ask-active #csAskExamples { display: none; }
#csAskExamples { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 22px 0 0; order: 3; }
#csAskExamples .cschip { border: none; font-size: 14.5px; color: var(--cs-ink-2); }
#csAskExamples .cschip:hover { color: var(--cs-ink); }
#csSearchBar { gap: 0; margin: 0; border: 1px solid var(--cs-ink); border-radius: 6px; background: #fff; overflow: hidden; }
#csSearchInput { border: none; border-radius: 0; padding: 20px 20px; font-size: 18px; background: #fff; }
#csSearchGo { border-radius: 0; width: 64px; font-size: 20px; }
#csSearchChips { justify-content: center; margin: 16px 0 6px; gap: 22px; }
#csSearch.ask-empty #csSearchChips { margin-top: 18px; }
#csSearchStatus { text-align: left; }

/* ── Messages: a real messenger ── */
#csSurfaceMessages { display: flex; flex-direction: column; min-height: 0; }
#csMessagesList, #csConversationDetail { max-width: none; padding: 0; margin: 0; width: 100%; }
#csMessagesHead { padding: 22px 20px 10px; }
#csMessagesTitle { font-size: 26px; font-weight: 700; letter-spacing: -.015em; margin: 0 0 12px; font-family: var(--xk-ui); }
#csMessagesSearch { width: 100%; border: 1px solid var(--cs-line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14px; background: #fff; outline: none; }
#csConversationList { padding: 0 8px 20px; }
#csMessagesSignedOut { padding: 0 20px; }
.xkm-group { display: none; }
.xkm-rows { gap: 0; }
.xkm-row { padding: 12px; border: none; border-radius: 10px; align-items: center; gap: 12px; }
.xkm-row:hover { background: var(--cs-paper); }
.xkm-row.active { background: var(--cs-paper); }
.xkm-row:hover .xkm-row-name { text-decoration: none; }
.xkm-row-av { width: 44px; height: 44px; border-radius: 50%; background: var(--cs-ink); color: var(--cs-bg); display: grid; place-items: center; font-weight: 600; flex: none; background-size: cover; background-position: center; }
.xkm-row-name { font-family: var(--xk-ui); font-size: 15px; font-weight: 650; }
.xkm-row-prev { font-size: 13.5px; }
#csConversationEmpty { margin: auto; color: var(--cs-ink-3, #9a9484); font-size: 15px; display: none; }
#csConvPane { display: flex; flex-direction: column; min-height: 0; height: 100%; }
#csConvHead { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--cs-line); }
#csConversationBack { border: none; background: none; font-size: 22px; cursor: pointer; padding: 0 6px 0 0; color: var(--cs-ink); }
#csConvAvatar { width: 38px; height: 38px; border-radius: 50%; background: var(--cs-ink); color: var(--cs-bg); display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; }
#csConversationTitle { font-family: var(--xk-ui); font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -.005em; }
#csConversationBody { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 16px 12px; }
@media (max-width: 899px) {
  #csSurfaceMessages { height: calc(100dvh - 56px - 60px - env(safe-area-inset-bottom, 0px)); }
  #csMessagesList, #csConversationDetail { flex: 1; min-height: 0; overflow-y: auto; }
  #csConversationDetail { overflow: hidden; }
}
@media (min-width: 900px) {
  #csSurfaceMessages { flex-direction: row; height: calc(100dvh - 56px); max-width: 1240px; margin: 0 auto; border-left: 1px solid var(--cs-line); border-right: 1px solid var(--cs-line); }
  #csMessagesList { display: block !important; width: 360px; flex: none; border-right: 1px solid var(--cs-line); overflow-y: auto; }
  #csConversationDetail { display: flex !important; flex: 1; min-width: 0; flex-direction: column; background: #fff; }
  #csConversationEmpty { display: block; }
  #csConversationDetail.has-thread #csConversationEmpty { display: none; }
  #csConversationBack { display: none; }
  #csConversationDetail #csConvPane { flex: 1; }
}
.xkm-msg { max-width: min(520px, 78%); }
.xkm-thread .xkm-list { padding-top: 14px; }

/* ── Profile: identity-first ── */
#csActivity { max-width: 1040px; padding: 32px 24px 56px; }
#csProfileSignedOut { max-width: 420px; margin: 80px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#csProfileSignedOut h1 { font-family: var(--xk-display); font-weight: 500; font-size: 44px; margin: 0; }
.csp-grid { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: start; }
#csProfileCard { display: block; border: none; padding: 0; background: none; margin: 0; }
#csProfileAvatar { width: 96px; height: 96px; font-size: 38px; margin-bottom: 16px; }
#csProfileName { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
#csProfileWho { margin-top: 2px; word-break: break-all; }
#csProfileActions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; align-items: stretch; }
#csProfileActions a, #csProfileActions button { text-align: center; text-decoration: none; padding: 10px 14px; font: inherit; font-size: 14px; cursor: pointer; }
#csProfileTabs { display: flex; gap: 28px; border-bottom: 1px solid var(--cs-line); margin-bottom: 22px; }
#csProfileTabs button { border: none; background: none; padding: 8px 0 12px; font: inherit; font-size: 14.5px; color: var(--cs-ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
#csProfileTabs button.on { color: var(--cs-ink); font-weight: 600; border-bottom-color: var(--cs-ink); }
.cs-biz-card { border: none; border-bottom: 1px solid var(--cs-line); border-radius: 0; background: none; padding: 14px 0; }
.csact-row { border: none; border-bottom: 1px solid var(--cs-line); border-radius: 0; background: none; padding: 14px 0; }
#csPwForm { max-width: 360px; }
@media (max-width: 760px) { .csp-grid { grid-template-columns: 1fr; gap: 24px; } #csProfileAvatar { width: 72px; height: 72px; font-size: 28px; } #csProfileActions { flex-direction: row; flex-wrap: wrap; } }

#csAskExamples .cschip:nth-child(n+5) { display: none; }
.leaflet-bottom.leaflet-right { margin-bottom: 8px; }
@media (max-width: 899px) { .leaflet-bottom.leaflet-right { margin-bottom: 4px; } }

#csSurfaceMessages { width: 100%; }
.csp-sec { margin-bottom: 34px; }
.csp-sec h2 { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cs-ink-2); margin: 0 0 12px; border-bottom: 1px solid var(--cs-line); padding-bottom: 10px; }
#csProfileSettings summary { cursor: pointer; font-size: 13px; color: var(--cs-ink-2); }
#csProfileSettings { border: none; padding: 0; background: none; }

body.cs-business #csChatInputRow textarea, #csChatInput { font-size: 15px; }
#csChatInput::placeholder { font-size: 14px; }
.csw-suggestions button { border: none; border-bottom: 1px solid var(--cs-line); border-radius: 0; background: none; padding: 4px 1px; color: var(--cs-ink-2); }
#csWelcome .csw-name { font-size: 22px; font-weight: 700; }
body.cs-business .cs-biz-switch { display: none !important; }

/* ═══ Business pages (profile → menu → item → order) share ONE look ═════
   The storefront renderer (profile.js) is reused untouched; here it is
   joined to the XkroX shell: same header, same tokens, same cards. The
   merchant theme is not applied in the consumer shell. */
.cs-gnav { display: none; }
body.cs-business #csBack, body.cs-business #csBizName, body.cs-business #csCrowBtn { display: none !important; }
@media (min-width: 900px) {
  body.cs-business .cs-gnav { display: flex; gap: 30px; position: fixed; left: 50%; top: 0; height: 56px; align-items: center; transform: translateX(-50%); z-index: 46; }
  body.cs-business .cs-gnav a { text-decoration: none; font-size: 14px; color: var(--cs-ink-2); }
  body.cs-business .cs-gnav a:hover { color: var(--cs-ink); }
}
body.cs-business #csAuthBtn { margin-left: auto; }
body.cs-business #csSurface { background: var(--cs-bg); }
#csExplore {
  --pv-bg: var(--xk-ivory); --pv-text: var(--xk-ink); --pv-muted: var(--xk-ink-2); --pv-card: var(--xk-paper);
  --pv-border: var(--xk-line); --pv-accent: var(--xk-ink); --pv-radius: 4px; --pv-font: var(--xk-ui);
}
body.cs-business #csExplore .bp-root { background: var(--cs-bg); background-image: none; }
body.cs-business .bp-hero, body.cs-business .bp-promo, body.cs-business .bp-header-id { display: none; }
body.cs-business .bp-header { position: static; padding: 6px 28px; border-bottom: none; justify-content: space-between; }
body.cs-business .bp-header-actions { margin-left: auto; }
body.cs-business .bp-section { padding: 28px; border-bottom: none; }
body.cs-business .bp-section-title { font-family: var(--xk-ui); font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
body.cs-business .bp-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 24px 18px; }
body.cs-business .bp-card-media { aspect-ratio: 4 / 3; border-radius: 4px; margin-bottom: 10px; background: var(--cs-paper); }
body.cs-business .bp-card-name { font-size: 14.5px; font-weight: 600; }
body.cs-business .bp-card-price { color: var(--cs-ink); font-weight: 500; }
body.cs-business .bp-ph-mark { font-family: var(--xk-display); }
body.cs-business .bp-nav-item { font-size: 13.5px; }
/* the business identity bar (same hierarchy as the profile header) */
#csExploreActionBar { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: var(--cs-bg); border-bottom: 1px solid var(--cs-line); position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
.csb-back { font-size: 22px; text-decoration: none; color: var(--cs-ink); padding: 0 4px; }
.csb-logo { width: 44px; height: 44px; border-radius: 50%; background: var(--cs-ink); color: var(--cs-bg); display: grid; place-items: center; font-weight: 600; overflow: hidden; position: relative; flex: none; }
.csb-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.csb-id { min-width: 0; }
.csb-name { font-family: var(--xk-display); font-size: 26px; font-weight: 500; letter-spacing: -.015em; line-height: 1.1; }
.csb-meta { font-size: 13px; color: var(--cs-ink-2); margin-top: 2px; text-transform: capitalize; }
#csExploreActionBar .csexp-actions { margin-left: auto; display: flex; gap: 8px; }
#csExploreActionBar .csexp-actions button { border-radius: 4px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#csExploreActionBar .csbtn-message, #csExploreActionBar .csbtn-ghost { background: transparent; border: 1px solid var(--cs-ink); color: var(--cs-ink); }
@media (max-width: 760px) {
  #csExploreActionBar { padding: 12px 16px; gap: 10px; }
  .csb-name { font-size: 22px; }
  #csExploreActionBar .csexp-actions { margin-left: 0; width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  #csExploreActionBar .csexp-actions button { padding: 10px 6px; font-size: 13.5px; }
  body.cs-business .bp-header { padding: 6px 16px; } body.cs-business .bp-section { padding: 22px 16px; }
}

/* ── Ask: answer first, then evidence-backed cards ── */
#csSearch.ask-active { max-width: 1120px; }
.ask-answer { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--cs-ink); margin: 18px 0 6px; line-height: 1.35; }
#csSearchFollow { margin: 4px 0 18px; gap: 20px; }
#csSearchFollow:empty { display: none; }
#csSearchResults { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.cscard { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--cs-line); border-radius: 8px; background: #fff; padding: 16px; cursor: pointer; }
.cscard:hover { border-color: var(--cs-ink); }
.cscard-head { display: flex; gap: 14px; align-items: center; }
.cscard-thumb { width: 64px; height: 64px; border-radius: 6px; background-size: 26px; overflow: hidden; position: relative; flex: none; }
.cscard-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cscard-id { min-width: 0; }
.cscard-name { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.cscard-metaline { font-size: 13px; color: var(--cs-ink-2); margin-top: 2px; }
.cscard-metaline.cat { text-transform: capitalize; }
.cscard-why { font-size: 12.5px; color: var(--cs-ink-2); margin-top: 2px; }
.cscard-offers { display: flex; flex-direction: column; gap: 6px; }
.cscard-offer { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; padding-bottom: 6px; border-bottom: 1px solid var(--cs-line); }
.cscard-offer:last-child { border-bottom: none; padding-bottom: 0; }
.cscard-offer span:last-child { font-weight: 600; white-space: nowrap; }
.cscard-actions { display: flex; gap: 8px; margin-top: 2px; }
.cscard-actions button { padding: 9px 18px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 4px; }
@media (max-width: 640px) { .ask-answer { font-size: 16.5px; } .cscard { padding: 14px; } .cscard-thumb { width: 52px; height: 52px; } }

/* ── Map: compact controls, no stacked status bars ── */
#csMapStatus { font-size: 12px; padding: 4px 10px; }
#csMapNoPin { background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; padding: 4px 10px; font-size: 12px; align-self: flex-start; }
#csMapNoPin .cschip { font-size: 12px; margin-left: 2px; }
#csMapChips { padding: 6px 10px; gap: 14px; }
#csMapPreview { border-radius: 14px 14px 8px 8px; padding: 14px 16px; }
@media (max-width: 899px) {
  #csMapPanel { top: 8px; left: 8px; right: 8px; gap: 6px; }
  #csMapPreview { left: 8px; right: 8px; bottom: 8px; }
}

#csSearchStatus.ask-answer { font-size: 18px; font-weight: 600; color: var(--cs-ink); margin: 18px 0 6px; }
@media (max-width: 640px) { #csSearchStatus.ask-answer { font-size: 16.5px; } }
body.cs-business .bp-detail-panel { border-radius: 8px; background: var(--cs-bg); }
body.cs-business .bp-detail-name { font-family: var(--xk-ui); font-weight: 700; font-size: 26px; letter-spacing: -.015em; }
body.cs-business .bp-detail-price { color: var(--cs-ink); font-weight: 600; font-size: 18px; }
body.cs-business .bp-addcart { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; border-radius: 4px; }
body.cs-business .bp-qty { border-radius: 4px; }

body.cs-business .bp-header { display: none; }
.csb-cart { position: relative; border: none; background: none; cursor: pointer; padding: 8px; color: var(--cs-ink); }
.csb-cart-n { position: absolute; top: 2px; right: 0; background: var(--cs-ink); color: var(--cs-bg); border-radius: 999px; font-size: 10.5px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
@media (max-width: 760px) { .csb-cart { position: absolute; right: 12px; top: 14px; } #csExploreActionBar { position: sticky; } }
@media (max-width: 899px) { .leaflet-control-zoom { display: none; } }

/* ═══ Final polish ═══════════════════════════════════════════════════════ */
/* Explore on phones: ~2 cards per screen, still image-led */
.xe-text { min-width: 0; }
.xe-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.xe-act { margin-top: 2px; flex: none; }
@media (max-width: 640px) {
  #csDiscover { padding: 14px 16px 24px; }
  #csDiscover h1 { font-size: 28px; }
  #csDiscover .xe-head { gap: 8px; }
  .xe-search { padding: 8px 2px; font-size: 16px; }
  .xe-tabs { margin: 10px 0 2px; gap: 22px; }
  .xe-tab { padding: 6px 0 10px; }
  .xe-sec { margin-top: 18px; } .xe-sec-h { margin-bottom: 10px; } .xe-sec-h h2 { font-size: 17px; }
  .xe-grid { gap: 16px; }
  .xe-img { aspect-ratio: 16 / 9; }
  .xe-body { align-items: center; padding-top: 8px; }
  .xe-name { font-size: 16px; } .xe-meta { font-size: 12.5px; margin-top: 1px; }
  .xe-act { margin-top: 0; }
  #csDiscoverLocate { font-size: 13px; }
}
/* storefront bar: Order/Message primary, Crow quieter */
#csExploreActionBar .csbtn-ghost { border: none; background: none; text-decoration: underline; text-underline-offset: 3px; padding: 10px 6px; color: var(--cs-ink); }
@media (max-width: 760px) { #csExploreActionBar .csexp-actions { grid-auto-flow: column; grid-auto-columns: auto; grid-template-columns: 1fr 1fr auto; align-items: center; } #csExploreActionBar .csbtn-ghost { padding: 10px 4px; white-space: nowrap; } }
/* map list empty line */
.csmap-empty { padding: 14px; font-size: 13px; color: var(--cs-ink-2); }
/* Crow AI: same calm language as global Ask */
#csChatLog .csw-suggestions, #csWelcome .csw-suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; }
#csWelcome { text-align: left; padding: 8px 4px 6px; }
#csWelcome .csw-suggestions button { border: none; background: none; padding: 2px 0; font-size: 15px; color: var(--cs-ink-2); border-bottom: 1px solid var(--cs-line); border-radius: 0; text-align: left; }
#csWelcome .csw-suggestions button:hover { color: var(--cs-ink); border-bottom-color: var(--cs-ink); background: none; }
#csChatLog .csm { border-radius: 8px; max-width: 86%; }
#csChatLog .csm.ai { background: none; padding: 4px 0; font-size: 15px; max-width: 94%; border-radius: 0; }
#csChatLog .csm.user { border-radius: 8px; border-bottom-right-radius: 2px; background: var(--cs-ink); }
#csChatLog .csm-actions button { border-radius: 4px; border: 1px solid var(--cs-ink); background: none; }
#csChatInputWrap { background: var(--cs-bg); }
#csChatInputRow { border-radius: 6px; border-color: var(--cs-ink); box-shadow: none; padding: 6px 6px 6px 14px; }
#csChatSend { border-radius: 4px; width: 38px; height: 38px; }
body.cs-business #csCrowHead { font-weight: 600; }
