/* VyapaarHub — Alibaba-style marketplace UI, tuned for Indian traders */
:root {
  --saffron: #F26B1D;
  --saffron-dark: #D4560C;
  --saffron-tint: #FFF1E8;
  --ink: #1A1D24;
  --ink-2: #4B5160;
  --ink-3: #8A90A0;
  --page: #F4F5F7;
  --surface: #FFFFFF;
  --line: #E6E8EC;
  --green: #0E8A5F;
  --green-tint: #E5F5EE;
  --blue: #1F6FEB;
  --red: #D93A3A;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow: 0 1px 2px rgba(26, 29, 36, .06), 0 2px 8px rgba(26, 29, 36, .05);
  --header-h: 64px;
  --tabbar-h: 0px;
  --max: 1240px;
  font-family: "Hind", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); font-size: 15px; line-height: 1.5; min-height: 100vh; padding-bottom: var(--tabbar-h); }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 22px; letter-spacing: -.3px; flex-shrink: 0; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--saffron); color: #fff; display: grid; place-items: center; font-size: 19px; }
.logo b { color: var(--saffron); font-weight: 700; }
.search { flex: 1; display: flex; max-width: 720px; border: 2px solid var(--saffron); border-radius: 999px; background: #fff; overflow: hidden; height: 44px; }
.search select { border: 0; background: var(--page); padding: 0 10px 0 16px; max-width: 150px; font-size: 14px; color: var(--ink-2); border-right: 1px solid var(--line); }
.search input { flex: 1; border: 0; padding: 0 14px; outline: none; min-width: 0; font-size: 15px; }
.search .icon-btn { border: 0; background: transparent; color: var(--ink-3); padding: 0 8px; }
.search .go { border: 0; background: var(--saffron); color: #fff; font-weight: 600; padding: 0 22px; }
.search .go:hover { background: var(--saffron-dark); }
.head-actions { display: flex; align-items: center; gap: 4px; }
.head-link { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink-2); padding: 6px 10px; border-radius: var(--radius-s); position: relative; background: none; border: 0; }
.head-link svg { width: 22px; height: 22px; }
.head-link:hover { background: var(--page); color: var(--ink); }
.badge-dot { position: absolute; top: 2px; right: 8px; background: var(--red); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }
.lang-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.subnav { border-top: 1px solid var(--line); }
.subnav .wrap { height: 40px; display: flex; gap: 22px; align-items: center; font-size: 14px; color: var(--ink-2); overflow-x: auto; scrollbar-width: none; }
.subnav a { white-space: nowrap; }
.subnav a:hover, .subnav a.on { color: var(--saffron); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.btn.primary:hover { background: var(--saffron-dark); }
.btn.outline { border-color: var(--saffron); color: var(--saffron); }
.btn.outline:hover { background: var(--saffron-tint); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
label.field { display: block; }
label.field > span { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.input, .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px 12px; font-size: 15px; outline: none; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-tint); }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--saffron); margin-top: 2px; flex-shrink: 0; }
.form-card { background: #fff; border-radius: var(--radius-l); padding: 20px; box-shadow: var(--shadow); }
.form-error { color: var(--red); font-size: 14px; min-height: 0; }

/* ---------- Cards / chips ---------- */
.card { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.section { margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { color: var(--saffron); font-size: 14px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--green); background: var(--green-tint); font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.verified svg { width: 13px; height: 13px; }
.tag { display: inline-block; font-size: 12px; color: var(--ink-2); background: var(--page); border-radius: 4px; padding: 1px 6px; }

/* Product card (Alibaba style) */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pcard { background: #fff; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color .15s; }
.pcard-link { display: flex; flex-direction: column; flex: 1; }
.pcard-actions { display: flex; gap: 6px; padding: 0 12px 12px; }
.pcard-actions .btn { flex: 1; min-width: 0; }
.btn.xs { height: 32px; padding: 0 10px; font-size: 13px; gap: 4px; }
.btn.xs svg { width: 16px; height: 16px; }
.btn.wa { background: #1FAF54; border-color: #1FAF54; color: #fff; }
.btn.wa:hover { background: #17924A; border-color: #17924A; }
.contact-row .btn { flex: 1; }
.cat-rail a.all { color: var(--saffron); font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ind-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ind-head { display: flex; gap: 12px; align-items: center; }
.ind-head .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--saffron-tint); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.ind-head b { display: block; line-height: 1.3; }
.ind-head:hover b { color: var(--saffron-dark); }
.ind-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ind-card li a { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--page); color: var(--ink-2); }
.ind-card li a:hover { background: var(--saffron-tint); color: var(--saffron-dark); }
.ind-card .more { color: var(--saffron); font-weight: 600; }
.reel .side .side-btn { color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; }
.reel .side .side-btn svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.pcard:hover { border-color: var(--saffron); }
.pcard .img { aspect-ratio: 1; background: var(--page); }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard .name { font-size: 14px; line-height: 1.35; min-height: 38px; }
.price { font-weight: 700; font-size: 18px; color: var(--ink); }
.price small { font-weight: 400; font-size: 13px; color: var(--ink-3); }
.price.ask { font-size: 15px; color: var(--saffron); }
.pcard .moq { font-size: 13px; color: var(--ink-2); }
.pcard .seller { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; color: var(--ink-3); background: linear-gradient(135deg, #fff5ef, #ffe3d1); }

/* ---------- Home ---------- */
.home-top { display: grid; grid-template-columns: 240px 1fr 260px; gap: 16px; margin-top: 16px; }
.cat-rail { padding: 8px 0; max-height: 420px; overflow: auto; }
.cat-rail a { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 14px; }
.cat-rail a:hover { background: var(--saffron-tint); color: var(--saffron-dark); }
.cat-rail .ic { width: 22px; text-align: center; }
.hero { position: relative; overflow: hidden; border-radius: var(--radius-l); background: var(--ink); color: #fff; padding: 32px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(circle at 85% 20%, rgba(242,107,29,.55), transparent 45%),
  repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px); }
.hero > * { position: relative; }
.hero h1 { font-size: 34px; max-width: 520px; }
.hero p { margin-top: 10px; color: #C9CDD6; max-width: 480px; font-size: 16px; }
.hero .row { margin-top: 20px; flex-wrap: wrap; }
.hero .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.hero-stats { display: flex; gap: 28px; margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.hero-stats b { display: block; font-size: 22px; }
.hero-stats span { font-size: 13px; color: #A9AFBC; }
.me-box { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.me-box .hi { font-size: 17px; font-weight: 600; }
.me-box .quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.me-box .quick a { background: var(--page); border-radius: var(--radius); padding: 10px; font-size: 13px; text-align: center; }
.me-box .quick a:hover { background: var(--saffron-tint); }
.me-box .quick b { display: block; font-size: 20px; }
.cat-strip { display: none; }

/* Reels strip — the signature element */
.reel-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.reel-thumb { flex: 0 0 160px; aspect-ratio: 9/16; border-radius: 14px; overflow: hidden; position: relative; background: var(--ink); scroll-snap-align: start; }
.reel-thumb video { width: 100%; height: 100%; object-fit: cover; }
.reel-thumb .over { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.75)); display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; color: #fff; }
.reel-thumb .co { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.reel-thumb .cap { font-size: 12px; margin-top: 4px; opacity: .9; }
.reel-thumb .views { position: absolute; top: 8px; left: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,.45); padding: 1px 7px; border-radius: 999px; }
.reel-thumb.new { background: var(--saffron-tint); display: grid; place-items: center; text-align: center; color: var(--saffron-dark); border: 2px dashed #F7B48A; padding: 12px; font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--page); flex-shrink: 0; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 13px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; border: 4px solid #fff; border-radius: 22px; }
.avatar.md { width: 44px; height: 44px; font-size: 18px; }

.sup-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sup-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sup-card .top { display: flex; gap: 12px; align-items: center; }
.sup-card .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sup-card .thumbs div { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--page); }
.sup-card .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.rfq-band { display: flex; align-items: center; gap: 20px; padding: 22px 24px; background: var(--saffron-tint); border-radius: var(--radius-l); border: 1px solid #FBD3BA; }
.rfq-band h2 { color: var(--saffron-dark); }

/* ---------- Search results ---------- */
.results { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.filters { padding: 16px; align-self: start; position: sticky; top: calc(var(--header-h) + 56px); }
.filters h3 { margin-bottom: 8px; font-size: 15px; }
.filters .grp + .grp { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.filters label { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; cursor: pointer; }
.filters input[type=checkbox], .filters input[type=radio] { accent-color: var(--saffron); width: 16px; height: 16px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- Product page ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) 300px; gap: 20px; margin-top: 16px; align-items: start; }
.gallery .main { aspect-ratio: 1; border-radius: var(--radius-l); overflow: hidden; background: #fff; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery .thumbs button { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #fff; flex-shrink: 0; }
.gallery .thumbs button.on { border-color: var(--saffron); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-info h1 { font-size: 24px; font-weight: 600; }
.slabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); background: var(--saffron-tint); border-radius: var(--radius); padding: 14px; gap: 10px; margin-top: 14px; }
.slabs b { display: block; font-size: 20px; }
.slabs span { font-size: 13px; color: var(--ink-2); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.spec-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.spec-table td:first-child { color: var(--ink-3); width: 40%; }
.sup-side { padding: 18px; position: sticky; top: calc(var(--header-h) + 56px); display: flex; flex-direction: column; gap: 12px; }
.contact-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.contact-line svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--ink-3); }
.lock-note { font-size: 13px; color: var(--ink-2); background: var(--page); border-radius: var(--radius); padding: 10px 12px; display: flex; gap: 8px; }
.pd-actions-mobile { display: none; }
.desc { white-space: pre-line; color: var(--ink-2); }

/* ---------- Company profile (Instagram-style header) ---------- */
.cover { height: 220px; background: var(--ink) center/cover; border-radius: 0 0 var(--radius-l) var(--radius-l); }
.prof-head { display: flex; gap: 20px; align-items: flex-start; margin-top: -48px; padding: 0 8px; }
.prof-head .info { flex: 1; padding-top: 58px; min-width: 0; }
.prof-head h1 { font-size: 26px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prof-stats { display: flex; gap: 28px; margin-top: 16px; }
.prof-stats div { text-align: left; }
.prof-stats b { font-size: 20px; display: block; line-height: 1.1; }
.prof-stats span { font-size: 13px; color: var(--ink-3); }
.prof-bio { margin-top: 12px; max-width: 640px; color: var(--ink-2); }
.prof-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-top: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 18px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--ink); }
.reel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.reel-grid .reel-thumb { flex: none; border-radius: 6px; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.about-grid div { background: #fff; padding: 12px 14px; }
.about-grid span { display: block; font-size: 12px; color: var(--ink-3); }
.map-frame { width: 100%; height: 260px; border: 0; border-radius: var(--radius); margin-top: 12px; }

/* ---------- Reels viewer ---------- */
body.reels-mode { background: #000; }
body.reels-mode .topbar { display: none; }
.reels { height: calc(100dvh - var(--tabbar-h)); overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; background: #000; }
.reels::-webkit-scrollbar { display: none; }
.reel { height: calc(100dvh - var(--tabbar-h)); scroll-snap-align: start; scroll-snap-stop: always; position: relative; display: flex; justify-content: center; }
.reel video { height: 100%; width: 100%; max-width: 480px; object-fit: cover; background: #111; }
.reel .shade { position: absolute; inset: 0; margin: 0 auto; max-width: 480px; background: linear-gradient(rgba(0,0,0,.35), transparent 18%, transparent 58%, rgba(0,0,0,.8)); pointer-events: none; }
.reel .meta { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0 auto; max-width: 480px; padding: 0 76px 0 16px; color: #fff; }
.reel .who { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.reel .who .avatar { width: 36px; height: 36px; border: 2px solid #fff; }
.reel .follow { border: 1px solid #fff; background: transparent; color: #fff; border-radius: 8px; padding: 2px 12px; font-size: 13px; font-weight: 600; }
.reel .follow.on { background: rgba(255,255,255,.2); border-color: transparent; }
.reel .cap { margin-top: 8px; font-size: 14px; line-height: 1.4; }
.reel .prod { margin-top: 12px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.95); color: var(--ink); border-radius: 12px; padding: 8px; }
.reel .prod img, .reel .prod .ph { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; font-size: 22px; }
.reel .prod .btn { height: 34px; padding: 0 14px; font-size: 13px; }
.reel .side { position: absolute; right: max(10px, calc(50% - 240px + 10px)); bottom: 120px; display: flex; flex-direction: column; gap: 18px; align-items: center; color: #fff; }
.reel .side button { background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; }
.reel .side svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.reel .side .liked svg { color: #FF3B5C; fill: #FF3B5C; }
.reels-top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: center; gap: 22px; padding: 14px 16px; color: #fff; font-weight: 600; pointer-events: none; }
.reels-top a, .reels-top button { pointer-events: auto; opacity: .65; color: #fff; background: none; border: 0; font-weight: 600; font-size: 16px; }
.reels-top .on { opacity: 1; border-bottom: 2px solid #fff; }
.reels-top .back { position: absolute; left: 16px; opacity: 1; }
.reels-top .mute { position: absolute; right: 16px; opacity: 1; }
.reel-empty { height: 80vh; display: grid; place-items: center; color: #fff; text-align: center; padding: 24px; }
.tap-pause { position: absolute; inset: 0; max-width: 480px; margin: 0 auto; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 340px 1fr; height: calc(100dvh - var(--header-h) - 41px - 32px); margin-top: 16px; overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; }
.conv-list h2 { padding: 16px; }
.conv { display: flex; gap: 12px; padding: 12px 16px; align-items: center; border-bottom: 1px solid var(--line); }
.conv:hover, .conv.on { background: var(--saffron-tint); }
.conv .unread { background: var(--saffron); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; font-weight: 600; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread-prod { display: flex; gap: 10px; align-items: center; padding: 8px 16px; background: var(--page); font-size: 13px; }
.thread-prod img, .thread-prod .ph { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; font-size: 18px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #F8F9FA; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); white-space: pre-wrap; word-wrap: break-word; align-self: flex-start; font-size: 15px; }
.msg.me { align-self: flex-end; background: #FFE7D6; }
.msg time { display: block; font-size: 11px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.msg.quote { padding: 0; overflow: hidden; min-width: 240px; white-space: normal; }
.msg.quote .qh { background: var(--ink); color: #fff; padding: 8px 12px; font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.msg.quote .qb { padding: 10px 12px; }
.msg.quote .qp { font-size: 22px; font-weight: 700; }
.day-sep { align-self: center; font-size: 12px; color: var(--ink-3); background: #fff; border-radius: 999px; padding: 2px 10px; margin: 8px 0; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.composer textarea { flex: 1; border: 1px solid var(--line); border-radius: 22px; padding: 10px 16px; resize: none; max-height: 120px; outline: none; min-height: 44px; }
.composer .btn { height: 44px; width: 44px; padding: 0; flex-shrink: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.empty h3 { margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.dash-nav { padding: 8px; position: sticky; top: calc(var(--header-h) + 56px); }
.dash-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.dash-nav a.on { background: var(--saffron-tint); color: var(--saffron-dark); }
.dash-nav a:hover { background: var(--page); }
.dash-nav .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 16px; }
.kpi b { font-size: 26px; display: block; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--ink-3); }
.kpi.hot { background: var(--saffron); color: #fff; }
.kpi.hot span { color: #FFE2CF; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.status { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--page); white-space: nowrap; }
.status.new { background: #E8F0FE; color: var(--blue); }
.status.contacted, .status.negotiation { background: #FFF4E0; color: #A15C00; }
.status.won { background: var(--green-tint); color: var(--green); }
.status.lost { background: #FDECEC; color: var(--red); }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item img, .list-item .ph { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; font-size: 24px; }
.uploader { display: flex; gap: 8px; flex-wrap: wrap; }
.uploader .slot { width: 88px; height: 88px; border-radius: var(--radius); overflow: hidden; position: relative; background: var(--page); }
.uploader .slot img, .uploader .slot video { width: 100%; height: 100%; object-fit: cover; }
.uploader .slot button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 1; }
.uploader .add { width: 88px; height: 88px; border-radius: var(--radius); border: 2px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); text-align: center; font-size: 12px; cursor: pointer; background: #fff; }
.uploader .add:hover { border-color: var(--saffron); color: var(--saffron); }
.slab-row, .spec-row { display: grid; grid-template-columns: 1fr 1fr 1fr 36px; gap: 8px; margin-bottom: 8px; }
.spec-row { grid-template-columns: 1fr 1.5fr 36px; }
.icon-x { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); color: var(--ink-3); }

/* ---------- Auth ---------- */
.auth { max-width: 420px; margin: 40px auto; }
.auth .tabs { margin: 0 0 18px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; font-size: 14px; }
.role-pick label b { display: block; font-size: 15px; }
.role-pick input { display: none; }
.role-pick label:has(input:checked) { border-color: var(--saffron); background: var(--saffron-tint); }

/* ---------- Sheet / modal ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,17,22,.5); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.sheet { background: #fff; border-radius: var(--radius-l); width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; padding: 20px; animation: rise .2s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head button { border: 0; background: var(--page); width: 32px; height: 32px; border-radius: 50%; font-size: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--red); }
.create-grid { display: grid; gap: 10px; }
.create-grid a { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.create-grid a:hover { border-color: var(--saffron); background: var(--saffron-tint); }
.create-grid .ic { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--page); border-radius: 12px; }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar { display: none; }
footer.site { margin-top: 48px; padding: 28px 0 40px; border-top: 1px solid var(--line); background: #fff; color: var(--ink-3); font-size: 13px; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.skeleton { background: linear-gradient(90deg, #eceef1 25%, #f5f6f8 50%, #eceef1 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }


/* ---------- Fast catalogue ---------- */
.qc-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed #F7B48A; border-radius: var(--radius-l); background: var(--saffron-tint); color: var(--saffron-dark); text-align: center; cursor: pointer; }
.qc-drop.over, .qc-drop:hover { background: #FFE6D6; }
.qc-drop-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--saffron); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.qc-common-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.qc-rows { display: flex; flex-direction: column; gap: 10px; }
.qc-row { display: flex; gap: 12px; padding: 12px; align-items: flex-start; position: relative; }
.qc-row.err { outline: 2px solid var(--red); }
.qc-imgs { display: flex; gap: 6px; flex-wrap: wrap; width: 196px; flex-shrink: 0; }
.qc-thumb { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; position: relative; background: var(--page); }
.qc-row .qc-imgs .qc-thumb:not(:first-child):not(.add) { width: 44px; height: 44px; }
.qc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qc-thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1; }
.qc-thumb.add { width: 44px; height: 44px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); cursor: pointer; background: #fff; }
.qc-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qc-line { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; }
.qc-del { width: 32px; height: 32px; flex-shrink: 0; }
.qc-bar { position: sticky; bottom: calc(var(--tabbar-h) + 8px); z-index: 20; display: flex; gap: 8px; align-items: center; background: var(--ink); color: #fff; padding: 10px 10px 10px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.qc-bar .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }

/* ---------- My website ---------- */
.site-url { display: flex; gap: 16px; align-items: center; padding: 16px 18px; flex-wrap: wrap; }
.site-url .grow { flex: 1 1 260px; }
.site-url .url { font-size: 20px; font-weight: 700; color: var(--saffron-dark); word-break: break-all; }
.site-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.checklist li.ok { color: var(--green); }
.checklist a { color: var(--saffron); text-decoration: underline; }
.slug-in { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.slug-in span { padding: 10px 0 10px 12px; color: var(--ink-3); white-space: nowrap; font-size: 14px; align-self: center; }
.slug-in input { border: 0 !important; box-shadow: none !important; padding-left: 2px !important; min-width: 0; }
.field .lbl { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches input { display: none; }
.swatches span { display: block; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.site-preview { position: sticky; top: calc(var(--header-h) + 56px); display: flex; flex-direction: column; gap: 8px; }
.frame { background: #fff; border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden; margin: 0 auto; }
.frame iframe { border: 0; display: block; }
.frame.m { width: 390px; max-width: 100%; height: 720px; border: 8px solid var(--ink); border-radius: 32px; }
.frame.m iframe { width: 100%; height: 100%; }
.frame.d { width: 100%; height: 640px; overflow: hidden; }
.frame.d iframe { width: 1280px; height: 1520px; transform: scale(.42); transform-origin: 0 0; }

/* ---------- Training videos ---------- */
.learn-chips { flex-wrap: nowrap; }
.learn-chips .chip b { background: var(--saffron); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.learn-chips .chip.on b { background: #fff; color: var(--ink); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vcard { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.vthumb { display: block; width: 100%; aspect-ratio: 16/9; border: 0; padding: 0; position: relative; background: #000; cursor: pointer; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vplay { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 22px; }
.vbody { padding: 10px 12px 12px; }
.yt { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .home-top { grid-template-columns: 1fr 260px; }
  .cat-rail { display: none; }
  .cat-strip { display: grid; }
  .pd { grid-template-columns: 1fr 1fr; }
  .pd .sup-side { grid-column: 1 / -1; position: static; }
}
@media (max-width: 820px) {
  :root { --header-h: 56px; --tabbar-h: 62px; }
  body { font-size: 15px; }
  .topbar .wrap { gap: 10px; }
  .logo span.txt { display: none; }
  .search { height: 40px; }
  .search select, .search .go-txt { display: none; }
  .search .go { padding: 0 14px; }
  .head-actions .desk { display: none; }
  .subnav { display: none; }
  .home-top { grid-template-columns: 1fr; margin-top: 12px; }
  .me-box { display: none; }
  .hero { min-height: 0; padding: 22px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15px; }
  .hero-stats { gap: 20px; }
  .cat-strip { grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 12px 6px; }
  .cat-strip a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; text-align: center; line-height: 1.2; padding: 6px 2px; }
  .cat-strip .ic { width: 48px; height: 48px; border-radius: 16px; background: var(--saffron-tint); display: grid; place-items: center; font-size: 24px; }
  .reel-thumb { flex-basis: 128px; }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pcard .body { padding: 8px 10px 10px; }
  .pcard-actions { padding: 0 8px 8px; gap: 4px; }
  .pcard-actions .btn span { display: none; }
  .ind-grid { grid-template-columns: 1fr; }
  .pd-actions-mobile .btn span { display: inline; }
  .price { font-size: 16px; }
  .results { grid-template-columns: minmax(0, 1fr); }
  .filters { display: none; position: static; }
  .filters.open { display: block; }
  .pd { grid-template-columns: 1fr; gap: 14px; }
  .gallery .main { border-radius: 0; margin: 0 -16px; }
  .pd-actions-mobile { display: flex; position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 30; gap: 8px; padding: 8px 12px; background: #fff; border-top: 1px solid var(--line); }
  .pd-actions-mobile .btn { flex: 1; }
  .cover { height: 140px; margin: 0 -16px; border-radius: 0; }
  .prof-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: -40px; padding: 0; }
  .prof-head .info { padding-top: 0; }
  .avatar.lg { width: 80px; height: 80px; }
  .prof-head h1 { font-size: 21px; }
  .prof-stats { gap: 0; justify-content: space-between; width: 100%; }
  .prof-actions .btn { flex: 1; }
  .reel-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100dvh - var(--header-h) - var(--tabbar-h)); margin: 0 -16px; border-radius: 0; box-shadow: none; }
  .chat-layout.has-thread .conv-list { display: none; }
  .chat-layout:not(.has-thread) .thread { display: none; }
  .conv-list { border-right: 0; }
  .msg { max-width: 85%; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash .row { flex-wrap: wrap; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .dash-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; padding: 6px; }
  .dash-nav a { white-space: nowrap; padding: 8px 12px; }
  .dash-nav .sep { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .qc-common-grid { grid-template-columns: 1fr 1fr; }
  .qc-row { flex-wrap: wrap; }
  .qc-imgs { width: 100%; }
  .qc-line { grid-template-columns: 1fr 1fr; }
  .qc-line select { grid-column: 1 / -1; }
  .qc-del { position: absolute; top: 8px; right: 8px; }
  .site-grid { grid-template-columns: 1fr; }
  .site-preview { position: static; }
  .frame.m { height: 620px; }
  .site-url .url { font-size: 17px; }
  .tabbar a span { font-size: 10px; }
  .rfq-band { flex-direction: column; align-items: flex-start; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--tabbar-h); background: #fff; border-top: 1px solid var(--line); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  body.reels-mode .tabbar { background: #000; border-color: #222; }
  body.reels-mode .tabbar a { color: #aaa; }
  body.reels-mode .tabbar a.on { color: #fff; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); position: relative; }
  .tabbar a.on { color: var(--saffron); }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .plus span.p { width: 44px; height: 32px; border-radius: 10px; background: var(--saffron); color: #fff; display: grid; place-items: center; }
  .tabbar .badge-dot { right: calc(50% - 18px); top: 4px; }
  .sheet-bg { align-items: flex-end; padding: 0; }
  .sheet { border-radius: var(--radius-l) var(--radius-l) 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  footer.site { display: none; }
  body.has-pd-bar { padding-bottom: calc(var(--tabbar-h) + 60px); }
  body.has-pd-bar #toast { bottom: calc(var(--tabbar-h) + 76px); }
  .dash h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
