/* Bidhaus design language — light, warm paper, ink + cobalt, geometric. */
:root {
  --awayah: #C8FF00;          /* Awayah brand */
  --awayah-hover: #b4e600;
  --awayah-ink: #171c00;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #eeebe3;
  --border: #e3dfd4;
  --ink: #1b1917;
  --muted: #6f6a5f;
  --accent: #2743cc;
  --accent-soft: #e9ecfa;
  --live: #d92d20;
  --green: #1a7f4e;
  --green-soft: #e3f2ea;
  --red: #c62f24;
  --red-soft: #fbe9e7;
  --amber: #96690e;
  --amber-soft: #f7efdc;
  --stage: #17140f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(27,25,23,.05), 0 8px 24px -12px rgba(27,25,23,.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
button { font-family: var(--font); }
input, select, textarea {
  font-family: var(--font); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; outline: none; width: 100%;
}
input::placeholder, textarea::placeholder { color: #a39d90; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 4px; font-weight: 700; }
code { background: var(--surface-2); border-radius: 5px; padding: 1px 5px; font-size: .92em; }

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 0 22px; height: 64px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.logoimg { height: 25px; width: auto; display: block; }
.logomark { display: inline-flex; gap: 3px; align-items: flex-end; }
.logomark i { display: block; width: 11px; height: 11px; }
.logomark i:nth-child(1) { background: var(--live); border-radius: 50%; }
.logomark i:nth-child(2) { background: var(--awayah); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.logomark i:nth-child(3) { background: var(--ink); }
.logotype { font-size: 21px; font-weight: 900; letter-spacing: -.03em; color: var(--ink); }
.logolive { background: var(--awayah); color: var(--awayah-ink); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; padding: 3px 8px; border-radius: 7px; }
#mainnav { display: flex; gap: 2px; }
#mainnav a { color: var(--muted); font-weight: 700; font-size: 14px; padding: 7px 13px; border-radius: 999px; }
#mainnav a:hover { color: var(--ink); background: var(--surface-2); }
#mainnav a.active { color: var(--ink); background: var(--accent-soft); }
#searchform { flex: 1; display: flex; justify-content: center; min-width: 120px; }
#searchbox {
  max-width: 560px; border-radius: 999px; padding: 10px 20px 10px 42px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f6a5f' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center;
}
#searchbox:focus { background-color: var(--surface); }
#userarea { display: flex; align-items: center; gap: 9px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; flex: none; }
.wallet-chip { font-size: 13px; font-weight: 800; color: var(--green); background: var(--green-soft); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.bell { position: relative; background: none; border: none; font-size: 19px; cursor: pointer; padding: 7px; border-radius: 999px; }
.bell:hover { background: var(--surface-2); }
.bell .dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--live); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

#notif-panel {
  position: fixed; top: 70px; right: 16px; width: 360px; max-height: 480px; overflow-y: auto; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
#notif-panel.hidden { display: none; }
.notif { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--ink); }
.notif:hover { background: var(--bg); }
.notif.unread { background: var(--accent-soft); }
.notif b { display: block; font-size: 13.5px; }
.notif small { color: var(--muted); font-size: 12.5px; }

/* ---------- layout ---------- */
#app.page { max-width: 1280px; margin: 0 auto; padding: 24px 22px 80px; }
#app.full { padding: 0; }
h1 { font-size: 26px; margin: 6px 0 18px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 26px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.mob-only { display: none !important; }
.ico { flex: none; vertical-align: -3px; }
.tabs .ico, .pininfo .ico { vertical-align: -2.5px; margin-right: 3px; }
.small { font-size: 12.5px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-wide { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.clickable:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--ink); color: #fff; border: none; border-radius: 14px;
  font-weight: 700; font-size: 14px; padding: 10px 18px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #33302b; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.secondary:hover { background: var(--border); }
.btn.accent { background: var(--awayah); color: var(--awayah-ink); }
.btn.accent:hover { background: var(--awayah-hover); }
.btn.awayah { background: var(--awayah); color: var(--awayah-ink); }
.btn.awayah:hover { background: var(--awayah-hover); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #a52820; }
.btn.green { background: var(--green); }
.btn.green:hover { background: #16693f; }
.btn.light { background: #fff; color: var(--ink); }
.btn.light:hover { background: #eee; }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.lg { padding: 13px 26px; font-size: 15px; }
.btn.full { width: 100%; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 7px; text-transform: uppercase; letter-spacing: .4px; }
.badge.live { background: var(--live); color: #fff; }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.badge.scheduled { background: var(--accent-soft); color: var(--accent); }
.badge.gray { background: var(--surface-2); color: var(--muted); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- product cards ---------- */
.pcard { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.pimg { width: 100%; aspect-ratio: 1 / .85; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 52px; position: relative; background: var(--surface-2); border-radius: 0; overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
/* quiet "no photo" placeholder (products without an uploaded image) */
.noimg { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.noimg i { font-style: normal; font-size: 12px; font-weight: 600; }
.pimg.ph { background: repeating-linear-gradient(45deg, var(--surface-2) 0 14px, var(--surface) 14px 28px); }
.pbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ptitle { font-weight: 700; font-size: 14px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.pprice { font-weight: 800; font-size: 17px; color: var(--ink); }
.pmeta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: auto; }
.corner-badge { position: absolute; top: 10px; left: 10px; }

/* ---------- home (sidebar + feed) ---------- */
.home-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.sidebar {
  border-right: 1px solid var(--border); background: var(--surface);
  padding: 26px 18px; position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto; display: flex; flex-direction: column;
}
.sidegreet { font-size: 21px; font-weight: 900; letter-spacing: -.02em; margin: 0 8px 18px; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a { color: var(--muted); font-weight: 600; font-size: 14.5px; padding: 8px 10px; border-radius: 9px; }
.sidenav a:hover { color: var(--ink); background: var(--surface-2); }
.sidenav a.active { color: var(--accent); font-weight: 800; }
.sidefoot { margin-top: auto; padding: 20px 10px 4px; font-size: 12px; color: var(--muted); line-height: 2; }
.sidefoot a { color: var(--muted); margin-right: 10px; }
.sidefoot a:hover { color: var(--ink); }
.home-main { padding: 26px 30px 80px; min-width: 0; }
.home-main > .section-head:first-child { margin-top: 0; }

/* show tiles (Live cards) */
.showgrid { display: grid; gap: 20px 14px; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }
.showtile { min-width: 0; }
.showhost { display: flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.showhost .avatar { width: 24px; height: 24px; font-size: 10px; }
.showcover {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface-2);
  font-size: 56px; transition: box-shadow .15s, transform .15s;
}
.showcover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.showcover img { width: 100%; height: 100%; object-fit: cover; }
.livebadge {
  position: absolute; top: 10px; left: 10px; background: var(--live); color: #fff;
  font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 8px;
}
.schedbadge {
  position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 8px;
}
.showtitle {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 8px; font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink);
}
.showcat { font-size: 12.5px; margin-top: 2px; }
.showcat a { font-weight: 700; }
.showcat span { color: var(--muted); }

/* category tiles */
.catrow { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.cattile {
  flex: none; width: 195px; height: 92px; border-radius: 12px; padding: 14px 16px;
  color: #fff; font-weight: 800; font-size: 14.5px; line-height: 1.25;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .15s, box-shadow .15s;
}
.cattile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cattile .cemoji { font-size: 20px; align-self: flex-end; }

/* slim, unobtrusive scrollbars for the live-page panels */
.leftcol, .chatlog, .shoppane, .hostpane, .bid-history {
  scrollbar-width: thin;
  scrollbar-color: rgba(27,25,23,.22) transparent;
}
.leftcol::-webkit-scrollbar, .chatlog::-webkit-scrollbar,
.shoppane::-webkit-scrollbar, .hostpane::-webkit-scrollbar, .bid-history::-webkit-scrollbar { width: 8px; }
.leftcol::-webkit-scrollbar-track, .chatlog::-webkit-scrollbar-track,
.shoppane::-webkit-scrollbar-track, .hostpane::-webkit-scrollbar-track, .bid-history::-webkit-scrollbar-track { background: transparent; }
.leftcol::-webkit-scrollbar-thumb, .chatlog::-webkit-scrollbar-thumb,
.shoppane::-webkit-scrollbar-thumb, .hostpane::-webkit-scrollbar-thumb, .bid-history::-webkit-scrollbar-thumb {
  background: rgba(27,25,23,.18); border-radius: 8px; border: 2px solid transparent; background-clip: content-box;
}
.leftcol::-webkit-scrollbar-thumb:hover, .chatlog::-webkit-scrollbar-thumb:hover,
.shoppane::-webkit-scrollbar-thumb:hover, .hostpane::-webkit-scrollbar-thumb:hover { background: rgba(27,25,23,.34); background-clip: content-box; }

/* ---------- show room (shop | stage | chat) ---------- */
.showroom { display: grid; grid-template-columns: 360px 1fr 370px; height: calc(100vh - 64px); background: var(--bg); }
.leftcol { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.showmeta { margin-bottom: 4px; }
.showmeta b { font-size: 16px; line-height: 1.3; display: block; }
.panehead { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; }
.panehead h3 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 7px; }
.panehead h3 .muted { font-weight: 600; }
.sheet-handle { display: none; }
.hostpane { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.hostbox { font-size: 13.5px; }
#sheet-backdrop { display: none; }
.shoplist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.shopitem {
  display: grid; grid-template-columns: 62px 1fr; gap: 5px 12px; align-items: start;
  padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: background .12s, box-shadow .12s;
}
.shopitem:hover { background: var(--bg); box-shadow: var(--shadow); }
.shopitem .thumb {
  width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-size: 27px; grid-row: span 2;
}
.shopitem .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sititle { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.simeta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.shopitem .btn { grid-column: 2; margin-top: 6px; justify-self: stretch; }

.stagecol { position: relative; background: var(--stage); overflow: hidden; }
.stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; color: #fff;
}
.stage .stage-note { color: rgba(255,255,255,.55); font-size: 12.5px; }
.stage .host-avatar { width: 96px; height: 96px; border-radius: 50%; font-size: 38px; box-shadow: 0 0 0 5px rgba(255,255,255,.14), 0 0 70px rgba(255,255,255,.12); }
.stage .eq { display: flex; gap: 4px; height: 22px; align-items: flex-end; }
.stage .eq i { width: 5px; background: #fff; opacity: .85; border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.stage .eq i:nth-child(2) { animation-delay: .15s; } .stage .eq i:nth-child(3) { animation-delay: .3s; }
.stage .eq i:nth-child(4) { animation-delay: .45s; } .stage .eq i:nth-child(5) { animation-delay: .6s; }
@keyframes eq { 0%,100% { height: 6px; } 50% { height: 22px; } }
.stage-msg { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
/* web: contain so the full video frame (incl. height) is always visible; phones go full-bleed */
.stage-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; background: #000; }
#stage-placeholder { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#unmute-btn { position: absolute; bottom: 90px; left: 16px; z-index: 2; }
.stage-msg b { font-size: 20px; }
.stage-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 10px; align-items: center; z-index: 2; }
.stagectl { display: flex; gap: 10px; align-items: center; }
/* selfie preview is mirrored locally so the host reads it naturally; viewers get the raw feed */
.stage-video.mirror { transform: scaleX(-1); }
.hostchip {
  display: flex; gap: 9px; align-items: center; background: rgba(0,0,0,.5); color: #fff;
  padding: 6px 12px 6px 6px; border-radius: 999px; backdrop-filter: blur(6px);
}
.hostchip .avatar { width: 32px; height: 32px; font-size: 12px; }
.hostchip b { font-size: 13.5px; display: block; line-height: 1.2; }
.hostchip .sub { font-size: 11.5px; color: rgba(255,255,255,.65); }
.spacer { flex: 1; }
.viewers-chip { background: rgba(0,0,0,.5); color: #fff; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; backdrop-filter: blur(6px); }
.auction-overlay {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2;
  background: rgba(20,17,13,.86); color: #fff; backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px 16px;
}
.auction-overlay .muted { color: rgba(255,255,255,.6); }
.auction-overlay input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.auction-overlay .timer { font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.hot { color: #ff6b5e; animation: pulse 1s infinite; }
.bidbar { display: flex; gap: 8px; margin-top: 10px; }
.bidbar input { max-width: 130px; }
.bidbar .btn { background: var(--awayah); color: var(--awayah-ink); }
.bidbar .btn:hover { background: var(--awayah-hover); }

.chatpane { display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; }
.chathead { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 800; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.chatlog { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chatmsg { display: flex; gap: 9px; font-size: 13.5px; align-items: flex-start; }
.chatmsg .avatar { width: 28px; height: 28px; font-size: 11px; margin-top: 1px; }
.chatmsg .who { font-weight: 800; margin-right: 6px; }
.chatmsg .who.seller { color: var(--amber); }
.chatmsg .who.admin { color: var(--live); }
.msg-time { font-size: 10px; color: var(--muted); margin-left: 7px; white-space: nowrap; opacity: .8; }
.viewers-chip { display: inline-flex; align-items: center; gap: 4px; }
.chatmsg.system {
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px;
  padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--ink); justify-content: center;
}
.chatinput { padding: 10px; border-top: 1px solid var(--border); display: flex; gap: 6px; position: relative; }
.chatinput input { border-radius: 999px; background: var(--bg); flex: 1; min-width: 0; }
/* @user / #product autocomplete riding above the chat input */
#tag-pop {
  position: absolute; bottom: calc(100% + 6px); left: 8px; right: 8px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); overflow: hidden auto; max-height: 250px;
}
#tag-pop .tagopt {
  display: flex; gap: 9px; align-items: center; width: 100%; text-align: left;
  padding: 9px 12px; border: none; background: none; color: var(--text);
  font-size: 13.5px; cursor: pointer;
}
#tag-pop .tagopt.active, #tag-pop .tagopt:hover { background: var(--surface-2); }
#tag-pop .avatar { width: 22px; height: 22px; font-size: 9px; flex: none; }
#tag-pop .thumb {
  width: 26px; height: 26px; border-radius: 6px; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 14px;
}
#tag-pop .thumb img { width: 100%; height: 100%; object-fit: cover; }
/* rendered tags inside chat messages */
.chatmsg .tag-user { color: var(--accent); font-weight: 700; text-decoration: none; }
.chatmsg .tag-user.me { background: rgba(39,67,204,.14); border-radius: 6px; padding: 0 4px; }
.chatmsg .tag-product {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
  color: var(--accent); font-weight: 700; text-decoration: none;
  background: rgba(39,67,204,.1); border: 1px solid rgba(39,67,204,.3);
  border-radius: 8px; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#chat-send { padding: 10px 13px; flex: none; }
.msg-product-card { display: flex; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 4px; align-items: center; max-width: 260px; }
.msg-product-card .thumb { width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; flex: none; background: var(--surface-2); }
.msg-product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* pinned/giveaway cards — desktop: anchored to the bottom of the video stage */
#pinbar:empty, #giveaway-bar:empty { display: none; }
.stage #stage-cards { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.stage:has(#stage-cards .pincard) .auction-overlay { bottom: 94px; }
.stage:has(#pinbar .pincard):has(#giveaway-bar .pincard) .auction-overlay { bottom: 168px; }
.gcard { border-color: var(--accent); background: linear-gradient(100deg, var(--accent-soft), var(--surface) 55%); }
.pincard {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 10px; box-shadow: var(--shadow);
}
.pincard .thumb {
  width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.pincard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pincard .pinlink { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; }
.pincard .pininfo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pincard .pininfo b { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* in-show product details — expands over the stream without stopping it */
#product-sheet { position: fixed; inset: 0; z-index: 60; display: none; }
#product-sheet.open { display: block; }
#product-sheet .backdrop { position: absolute; inset: 0; background: rgba(20,17,13,.5); }
#product-sheet .sheetcard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(480px, 92vw); max-height: 84vh; overflow-y: auto;
  background: var(--surface); border-radius: 16px; padding: 18px; box-shadow: var(--shadow);
}
#product-sheet .sheetimg { max-height: 230px; overflow: hidden; border-radius: 12px; }
#product-sheet .sheetimg .pimg { aspect-ratio: auto; height: 230px; }

/* floating heart reactions */
.reactions { position: absolute; right: 18px; bottom: 110px; width: 64px; pointer-events: none; z-index: 4; }
.reactions span {
  position: absolute; bottom: 0; left: 50%;
  animation: floatup 2.4s ease-out forwards;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
@keyframes floatup {
  0% { transform: translate(-50%, 0) scale(.5); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), -46vh) scale(1.15) rotate(var(--rot, 0deg)); opacity: 0; }
}

/* confetti burst over the stage */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.confetti i { position: absolute; top: -16px; width: 9px; height: 15px; border-radius: 2px; opacity: .95; animation: cfall linear forwards; }
@keyframes cfall { to { transform: translateY(105vh) rotate(740deg); opacity: .7; } }

/* standalone chatpane (communities) keeps a border-radius */
.community-layout .chatpane { border: 1px solid var(--border); border-radius: 14px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button, .tabs a {
  display: inline-block; background: none; border: none; color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active, .tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 22px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- auth / forms ---------- */
.authbox { max-width: 420px; margin: 40px auto; }
.formcard { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; }
.form-error { background: var(--red-soft); color: var(--red); border: 1px solid #f0c4bf; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-top: 14px; }
.demo-hint { margin-top: 16px; font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 10px 14px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 18px; font-size: 13.5px; max-width: 360px;
  box-shadow: var(--shadow); animation: slidein .25s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

.loading-page { display: flex; justify-content: center; padding: 90px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.countdown { font-variant-numeric: tabular-nums; font-weight: 800; }
.bid-history { max-height: 260px; overflow-y: auto; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 30px 0 14px; }
.section-head h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

.host-avatar { width: 96px; height: 96px; border-radius: 50%; font-size: 38px; }

.channel-list { display: flex; flex-direction: column; gap: 2px; }
.channel-list a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.channel-list a:hover, .channel-list a.active { background: var(--surface-2); color: var(--ink); }
.community-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }

/* ---------- bottom navigation (mobile app bar) ---------- */
#bottomnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
#bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0 2px; color: var(--muted); font-size: 10.5px; font-weight: 700;
  border-radius: 10px; -webkit-tap-highlight-color: transparent;
}
#bottomnav a svg { width: 24px; height: 24px; }
#bottomnav a.active { color: var(--ink); }
#bottomnav a:active { background: var(--surface-2); }

/* auth page separator between Awayah SSO and the demo form */
.orsep { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; color: var(--muted); font-size: 12px; }
.orsep::before, .orsep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- live discovery hub (#/live) ---------- */
.livehub {
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 380px; gap: 20px;
  max-width: 1520px; margin: 0 auto; padding: 20px 22px 90px;
}
/* Recommended Live is the height standard: its content sizes the grid row;
   the video player and chat stretch to exactly that height. */
.lh-main { min-width: 0; height: 100%; }
#lh-hero { height: 100%; }
.lh-side { padding: 12px; }
.lh-sidehead { margin: 2px 4px 8px; font-size: 15px; }
.lh-filters { display: flex; gap: 6px; margin: 0 2px 10px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.chip.active { background: var(--awayah); border-color: var(--awayah); color: var(--awayah-ink); }
.lh-creator {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  background: none; border: none; border-radius: 12px; padding: 8px; cursor: pointer; color: var(--ink);
}
.lh-creator:hover { background: var(--surface-2); }
.lh-creator.active { background: rgba(200, 255, 0, .25); }
.lh-creator .avatar { width: 38px; height: 38px; font-size: 13px; }
.lh-cinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lh-cinfo b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-cstat { display: flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: #1fc16b; display: inline-block; }
/* hero */
.lh-stage { position: relative; height: 100%; min-height: 340px; border-radius: 16px; overflow: hidden; background: var(--stage); }
.lh-cover, .lh-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lh-cover img { width: 100%; height: 100%; object-fit: cover; }
.lh-stage video { z-index: 1; }
.lh-livebadge {
  position: absolute; top: 14px; left: 14px; z-index: 3; display: inline-flex; gap: 7px; align-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; font-weight: 800;
  padding: 5px 12px; border-radius: 999px; backdrop-filter: blur(6px);
}
.lh-livebadge i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.2s infinite; }
.lh-schedbadge { position: absolute; top: 14px; left: 14px; z-index: 3; background: rgba(255,255,255,.9); color: var(--ink); font-size: 12.5px; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.lh-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.lh-arrow.prev { left: 12px; } .lh-arrow.next { right: 12px; }
.lh-arrow:hover { background: #fff; }
.lh-info {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 3;
  display: flex; gap: 12px; align-items: center;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 14px; padding: 12px 14px; color: var(--ink);
}
.lh-info .avatar { width: 44px; height: 44px; }
.lh-infotext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lh-infotext b { display: flex; gap: 7px; align-items: center; font-size: 14.5px; }
.lh-title { font-size: 13px; color: #3d3a34; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-pills { display: flex; gap: 6px; margin-top: 3px; }
.pill { background: rgba(27, 25, 23, .07); color: var(--ink); font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.lh-dots { position: absolute; right: 16px; top: -22px; display: flex; gap: 5px; }
.lh-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; }
.lh-dots i.on { background: var(--awayah); }
/* chat panel */
.lh-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100%; min-height: 0; box-shadow: var(--shadow); }
.lh-chathead { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
/* flex-basis 0 so chat content never inflates the grid row — the hero's
   16:9 box sets the row height and the chat matches it exactly */
.lh-chatlog { flex: 1 1 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 9px; min-height: 120px; }
.lh-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; border-radius: 10px; padding: 4px 6px; }
.lh-msg .avatar.mini, .avatar.mini { width: 24px; height: 24px; font-size: 9px; }
.lh-msg.host { background: rgba(200, 255, 0, .22); }
.lh-msg.sys { background: var(--amber-soft); color: var(--amber); font-weight: 600; padding: 6px 10px; }
.lh-msgbody { min-width: 0; }
.lh-msgbody b { margin-right: 4px; }
.rolebadge { background: var(--awayah); color: var(--awayah-ink); font-size: 9.5px; font-weight: 900; text-transform: uppercase; border-radius: 5px; padding: 1px 5px; margin-right: 4px; vertical-align: 1px; }
.lh-prod { display: flex; gap: 9px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; margin-top: 5px; color: var(--ink); }
.lh-prod .thumb { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.lh-prod .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lh-prodinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; }
.lh-chatinput { display: flex; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--border); }
.lh-chatinput input { border-radius: 12px; }
/* below-the-fold sections */
.lh-below { grid-column: 1 / -1; min-width: 0; }
.lh-cats { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.lh-cat { position: relative; flex: 0 0 190px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; }
.lh-cat img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.lh-cat:hover img { transform: scale(1.05); }
.lh-cat::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72), transparent 55%); }
.lh-catname { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; color: #fff; font-weight: 800; font-size: 14.5px; display: flex; flex-direction: column; }
.lh-catname small { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.8); }
.lh-shoprow { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.lh-shopcard { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.lh-shopimg { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.lh-shopimg img { width: 100%; height: 100%; object-fit: cover; }
.lh-shopimg .livebadge { position: absolute; top: 8px; left: 8px; }
.lh-shoptitle { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-upcoming { display: flex; flex-direction: column; gap: 10px; }
.lh-upitem { display: flex; gap: 12px; align-items: center; padding: 10px 14px; }
.lh-upcover { position: relative; width: 84px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; display: block; }
.lh-upcover img { width: 100%; height: 100%; object-fit: cover; }
.lh-upinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lh-upacts { display: flex; gap: 8px; }
@media (max-width: 1250px) {
  .livehub { grid-template-columns: minmax(0, 1fr) 340px; }
  .lh-side { display: none; }
  .lh-stage { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .lh-chat { height: calc((100vw - 404px) * 9 / 16); } /* hero width = 100vw - 340 chat - 20 gap - 44 padding */
}
@media (max-width: 960px) {
  .livehub { display: flex; flex-direction: column; align-items: stretch; padding: 14px 14px 90px; }
  .lh-chat { height: 380px; }
  .lh-side { display: block; order: 3; height: auto; overflow: visible; }
  .lh-side #lh-creators { display: flex; overflow-x: auto; gap: 8px; }
  .lh-creator { flex: 0 0 200px; }
  .lh-side #lh-more { display: none; }
  .lh-below { order: 4; }
  .lh-info { left: 8px; right: 8px; bottom: 8px; padding: 9px 10px; gap: 9px; }
  .lh-info .avatar { width: 36px; height: 36px; }
  .lh-watch { padding: 10px 16px; font-size: 13.5px; }
  .lh-pills { display: none; }
}

/* ---------- delivery tracking (buyer orders) ---------- */
.delivery-steps { display: flex; align-items: flex-start; margin: 14px 2px 4px; }
.dstep { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.dstep i { width: 12px; height: 12px; border-radius: 50%; background: var(--border); z-index: 1; }
.dstep::before { content: ''; position: absolute; top: 5px; left: -50%; right: 50%; height: 2px; background: var(--border); }
.dstep:first-child::before { display: none; }
.dstep.done i { background: var(--green); }
.dstep.done::before { background: var(--green); }
.dstep.now i { box-shadow: 0 0 0 4px rgba(34, 165, 89, .22); }
.dstep em { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; }
.dstep.now em { color: var(--text); font-weight: 800; }
.ridercard {
  margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px;
  background: var(--accent-soft); border: 1px solid rgba(39, 67, 204, .25);
}

/* ---------- seller hub workspace ---------- */
.hub-layout { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 64px); background: var(--bg); }
.hubnav {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 64px; height: calc(100vh - 64px);
}
.hubbrand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 10px; border-bottom: 1px solid var(--border); }
.hubbrand b { display: block; font-size: 14px; line-height: 1.2; }
.hubbrand .sub { font-size: 11.5px; color: var(--muted); }
.hubnav nav { display: flex; flex-direction: column; gap: 2px; }
.hubnav nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 14px; }
.hubnav nav a:hover { background: var(--surface-2); }
.hubnav nav a.active { background: var(--surface-2); color: var(--accent); }
.hubstore { margin-top: auto; display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.hubmain { padding: 22px 26px 46px; min-width: 0; }
.hubhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hubhead h1 { margin: 0; font-size: 22px; }
.hubgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.quickacts { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.quickacts .btn { justify-content: flex-start; }
.hubsearch { max-width: 340px; margin-bottom: 12px; }
/* listing / order rows */
.plist { display: flex; flex-direction: column; gap: 10px; }
.pitem {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px;
}
.pitem.oitem, .pitem:not(:has(.pthumb)) { grid-template-columns: minmax(0, 1fr) auto; }
.pthumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted);
}
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pthumb.showthumb { font-size: 24px; }
.pinfo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pinfo .ptitle { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinfo .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pacts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* hub modals (new listing, edit, auction, ship) */
#hub-modal { display: none; }
#hub-modal.open { display: block; position: fixed; inset: 0; z-index: 90; } /* above #bottomnav (80) */
#hub-modal .backdrop { position: absolute; inset: 0; background: rgba(20, 17, 13, .5); }
#hub-modal .modalcard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: 86dvh; overflow-y: auto;
  background: var(--surface); border-radius: 16px; padding: 16px 20px 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
#hub-modal .modalhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
#hub-modal .modalhead h3 { margin: 0; }
.modalfoot { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* photo picker */
.imgpick { display: flex; gap: 12px; align-items: center; }
.imgprev {
  width: 72px; height: 72px; border-radius: 12px; flex: none; overflow: hidden;
  border: 1.5px dashed var(--border); background: var(--surface-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.imgprev img { width: 100%; height: 100%; object-fit: cover; }
.imgbtns { display: flex; gap: 8px; flex-wrap: wrap; }


/* ---------- global footer ---------- */
#sitefoot { border-top: 1px solid var(--border); background: var(--surface); margin-top: 34px; }
.sf-inner { max-width: 1280px; margin: 0 auto; padding: 28px 22px 32px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sf-brand { display: flex; gap: 8px; align-items: center; }
.sf-logo { height: 20px; width: auto; }
.sf-brand .logolive { font-size: 10px; padding: 2px 7px; }
.sf-tag { margin: 0; color: var(--muted); font-size: 13px; max-width: 480px; }
.sf-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.sf-links a { color: var(--ink); }
.sf-links a:hover { color: var(--accent); }
.sf-legal { color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 12px; width: 100%; }
body.showpage #sitefoot { display: none; } /* fullscreen live stream has no chrome */

@media (max-width: 1080px) {
  .showroom { grid-template-columns: 300px 1fr 300px; }
  .hub-layout { grid-template-columns: 200px 1fr; }
}
@media (max-width: 960px) {
  #mainnav { display: none; }
  .home-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidenav { flex-direction: row; flex-wrap: wrap; }
  .sidefoot { display: none; }
  .showroom { grid-template-columns: 1fr; height: auto; }
  .stagecol { position: relative; height: 60vh; order: -1; }
  .shoppane, .chatpane { border: none; border-top: 1px solid var(--border); }
  .chatpane { height: 420px; }
  .community-layout { grid-template-columns: 1fr; }
}

/* ---------- phones: app-like layout ---------- */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overscroll-behavior-y: contain; }

  /* bottom bar on, content padded above it */
  #bottomnav { display: flex; }
  #app.page { padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); }
  .home-main { padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }

  /* compact top bar: logo + search + user chips */
  #topbar { height: 56px; padding: 0 12px; gap: 10px; }
  #topbar .logolive { display: none; }
  .logoimg { height: 19px; }
  .sf-inner { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  #userarea .btn { display: none; }           /* Seller Hub/Admin live in Profile on mobile */
  #searchform { justify-content: flex-end; }
  #searchbox { padding: 9px 14px 9px 38px; background-position: 13px center; }
  #notif-panel { left: 10px; right: 10px; width: auto; top: 62px; }

  /* type & touch */
  h1 { font-size: 21px; margin: 2px 0 14px; }
  h2 { font-size: 17px; margin: 20px 0 10px; }
  input, select, textarea { font-size: 16px; }  /* stops iOS focus zoom */
  .btn { padding: 11px 18px; }
  .hidden { display: none !important; }

  /* grids tighten to phone widths */
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .grid-wide { grid-template-columns: 1fr !important; }
  .showgrid { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .v { font-size: 18px; }
  .cattile { width: 150px; height: 84px; font-size: 13.5px; }
  .sidebar { display: none; }                 /* categories live on the home feed + Discover */

  /* scrollable tab bars instead of wrapping */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { white-space: nowrap; padding: 10px 13px; }

  .mob-only { display: inline-flex !important; }
  .mob-only.hidden { display: none !important; }

  /* ---- live show: full-screen stream, TikTok Shop style ---- */
  body.showpage #topbar, body.showpage #bottomnav { display: none; }
  body.showpage { overflow: hidden; }
  .showroom { display: block; height: 100dvh; }
  .stagecol { position: fixed; inset: 0; height: 100dvh; z-index: 1; }
  /* legibility scrim behind the top chips, over the video */
  .stagecol::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: calc(84px + env(safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(0,0,0,.45), transparent);
    z-index: 2; pointer-events: none;
  }
  .stage-top { z-index: 3; }
  /* host controls: round icon buttons on a thumb-reachable right-side rail.
     Above the chat overlay (z6) and stage cards (z8) so every button stays tappable. */
  .stagectl {
    position: fixed; right: 10px; top: 42%; transform: translateY(-50%);
    flex-direction: column; gap: 12px; z-index: 9;
  }
  .stagectl .btn { width: 46px; height: 46px; padding: 0; border-radius: 50%; }
  .stagectl .lbl { display: none; }

  /* chat floats over the video at the bottom; input + CTA pinned last */
  .chatpane {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    background: transparent; border: none; height: auto; max-height: 42dvh;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom));
  }
  .chathead { display: none; }
  /* small toggle riding the top-left of the chat overlay: hide chat to watch
     the stream unobstructed; the icon stays put as the way to bring it back */
  #chat-toggle {
    align-self: flex-start; width: 32px; height: 32px; padding: 0; margin: 0 0 2px 2px;
    border: none; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff;
    align-items: center; justify-content: center; cursor: pointer;
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  }
  body.chat-hidden .chatlog { display: none; }
  .chatlog {
    flex: initial; padding: 20px 2px 10px; overflow-y: auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%);
    mask-image: linear-gradient(to bottom, transparent, #000 18%);
  }
  .chatmsg {
    background: rgba(0,0,0,.52); color: #fff; width: fit-content; max-width: 88%;
    border-radius: 14px; padding: 6px 11px; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  }
  .chatmsg .avatar { width: 22px; height: 22px; font-size: 9px; }
  .chatmsg a { color: #cdd6ff; }
  /* mentions over video need real contrast: solid pill, white text */
  .chatmsg .tag-user {
    color: #fff; font-weight: 800; background: rgba(58, 92, 255, .68);
    border-radius: 7px; padding: 0 6px;
  }
  .chatmsg .tag-user.me { background: #f0a72c; color: #1d1610; } /* you were tagged — amber pop */
  .chatmsg .tag-product { color: #fff; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); }
  #tag-pop { left: 0; right: 0; }
  body.showpage .msg-time { display: none; } /* timestamps are a web-chat detail */
  .chatinput { border: none; padding: 8px 0 0; }
  .chatinput input {
    background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.28);
    border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  }
  .chatinput input::placeholder { color: rgba(255,255,255,.65); }
  #shop-cta { border-radius: 999px; }

  /* the auction card is the CTA layer, just above the chat input */
  .auction-overlay { position: fixed; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 7; padding: 12px; }
  /* product details become a bottom sheet on phones */
  #product-sheet .sheetcard {
    left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto;
    max-height: 82dvh; border-radius: 18px 18px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  /* hearts rise from above the chat overlay on phones */
  .reactions { bottom: 34%; right: 12px; }
  .stage-video { object-fit: cover; } /* full-bleed like TikTok on phones */

  /* pinned/giveaway cards stack below the chat box; chat shifts up per card */
  body.showpage #stage-cards { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 8; display: flex; flex-direction: column; gap: 8px; }
  .showroom:has(#stage-cards .pincard) .chatpane { bottom: calc(82px + env(safe-area-inset-bottom)); padding-bottom: 0; }
  .showroom:has(#pinbar .pincard):has(#giveaway-bar .pincard) .chatpane { bottom: calc(156px + env(safe-area-inset-bottom)); }
  .showroom:has(#stage-cards .pincard) .auction-overlay { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .showroom:has(#pinbar .pincard):has(#giveaway-bar .pincard) .auction-overlay { bottom: calc(224px + env(safe-area-inset-bottom)); }

  /* shop and host-control drawers slide up as separate bottom sheets */
  .leftcol { display: contents; }
  .shoppane, .hostpane {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    max-height: 74dvh; overflow-y: auto; background: var(--surface);
    border: none; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 34px rgba(0,0,0,.3);
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .25s ease;
  }
  .shoppane.open, .hostpane.open { transform: translateY(0); }
  .sheet-handle { display: block; width: 42px; height: 4px; border-radius: 2px; background: var(--border); margin: 6px auto 12px; }
  .panehead { position: sticky; top: 0; background: var(--surface); z-index: 2; padding: 4px 0 8px; }
  #sheet-backdrop.show { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(20,17,13,.45); }
  #unmute-btn { bottom: auto; top: calc(60px + env(safe-area-inset-top)); }
  .stage-top { top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; }

  /* ---- seller hub: app-style workspace on phones ---- */
  .hub-layout { display: block; }
  .hubnav {
    position: sticky; top: 56px; z-index: 5; height: auto;
    flex-direction: row; align-items: center; gap: 4px;
    padding: 8px 10px; border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: none;
  }
  .hubnav::-webkit-scrollbar { display: none; }
  .hubbrand { display: none; }
  .hubnav nav { flex-direction: row; gap: 4px; }
  .hubnav nav a { padding: 9px 12px; white-space: nowrap; font-size: 13.5px; }
  .hubstore { display: none; }
  .hubmain { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
  .hubhead { position: sticky; top: 105px; z-index: 4; background: var(--bg); padding: 6px 0; margin-bottom: 10px; }
  .hubhead h1 { font-size: 19px; margin: 0; }
  .hubgrid2 { grid-template-columns: 1fr; }
  .hubsearch { max-width: none; }
  /* rows stack: thumb + info on top, actions get a full-width row of big touch targets */
  .pitem { grid-template-columns: 48px minmax(0, 1fr); padding: 10px 12px; }
  .pitem.oitem, .pitem:not(:has(.pthumb)) { grid-template-columns: minmax(0, 1fr); }
  .pthumb { width: 48px; height: 48px; }
  .pacts { grid-column: 1 / -1; justify-content: flex-start; }
  .pacts .btn { flex: 1 0 auto; }
  /* modals become bottom sheets */
  #hub-modal .modalcard {
    left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto;
    max-height: 92dvh; border-radius: 18px 18px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
  .grid2 { grid-template-columns: 1fr; gap: 0; }

  /* auth & forms */
  .authbox { margin: 14px auto; }
  .formcard { padding: 20px 18px; }

  /* toasts above the bottom bar, full width */
  #toasts { left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  /* tables stay scrollable, slightly denser */
  table { font-size: 12.5px; }
  th, td { padding: 8px 8px; }
}
