/* ============================================================
   GLOBAL MARKET — Vietnam Global Store
   Standalone design system (no framework), mobile-first.
   ============================================================ */
:root {
  --g-primary: #b91c1c;          /* đỏ Việt Nam */
  --g-primary-dark: #991b1b;
  --g-primary-soft: #fef2f2;
  --g-accent: #f59e0b;           /* vàng sao */
  --g-ink: #1f2937;
  --g-ink-soft: #6b7280;
  --g-line: #e5e7eb;
  --g-bg: #f9fafb;
  --g-card: #ffffff;
  --g-green: #059669;
  --g-blue: #2563eb;
  --g-radius: 14px;
  --g-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
  --g-shadow-lg: 0 10px 34px rgba(0,0,0,.13);
  --g-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
            "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--g-font);
  background: var(--g-bg);
  color: var(--g-ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; } /* 16px chống zoom iOS */

/* ── Header ─────────────────────────────────────────────── */
.g-header {
  background: #fff;
  border-bottom: 1px solid var(--g-line);
  position: sticky; top: 0; z-index: 100;
}
.g-header-top {
  background: linear-gradient(90deg, var(--g-primary), #dc2626);
  color: #fff; font-size: 12.5px; padding: 6px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.g-header-top a { color: #fff; opacity: .92; white-space: nowrap; }
.g-header-top a:hover { opacity: 1; text-decoration: underline; }
.g-header-main {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.g-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--g-primary); white-space: nowrap; }
.g-logo .flag { font-size: 22px; }
.g-logo small { display: block; font-size: 10.5px; font-weight: 600; color: var(--g-ink-soft); letter-spacing: .4px; }
.g-search { flex: 1; display: flex; max-width: 560px; }
.g-search input {
  flex: 1; border: 2px solid var(--g-primary); border-right: none;
  border-radius: 10px 0 0 10px; padding: 9px 14px; outline: none; min-width: 0;
}
.g-search button {
  background: var(--g-primary); color: #fff; border: none;
  border-radius: 0 10px 10px 0; padding: 0 18px; font-size: 17px;
}
.g-header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.g-hact {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 1px; padding: 6px 9px; border-radius: 10px; font-size: 11px; color: var(--g-ink-soft);
  border: none; background: transparent;
}
.g-hact:hover { background: var(--g-primary-soft); color: var(--g-primary); }
.g-hact .ico { font-size: 19px; line-height: 1; }
.g-cart-badge {
  position: absolute; top: 0; right: 2px; background: var(--g-primary); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.g-lang-select {
  border: 1.5px solid var(--g-line); border-radius: 10px; padding: 7px 8px;
  font-size: 13.5px; font-weight: 600; background: #fff; color: var(--g-ink); outline: none;
}

/* ── Footer ─────────────────────────────────────────────── */
.g-footer { background: #111827; color: #d1d5db; margin-top: 44px; font-size: 13.5px; }
.g-footer-inner { max-width: 1200px; margin: 0 auto; padding: 34px 16px 90px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 26px; }
.g-footer h4 { color: #fff; font-size: 14.5px; margin-bottom: 12px; }
.g-footer a { display: block; padding: 3px 0; color: #9ca3af; }
.g-footer a:hover { color: #fff; }

/* ── Layout helpers ─────────────────────────────────────── */
.g-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; width: 100%; }
.g-main { flex: 1; }
.g-section-title { font-size: 21px; font-weight: 800; margin: 30px 0 16px; display: flex; align-items: center; gap: 9px; }
.g-section-title .bar { width: 5px; height: 22px; border-radius: 3px; background: var(--g-primary); }

/* ── Hero ───────────────────────────────────────────────── */
.g-hero {
  background: linear-gradient(120deg, #7f1d1d 0%, var(--g-primary) 55%, #dc2626 100%);
  color: #fff; border-radius: 0 0 26px 26px; overflow: hidden; position: relative;
}
.g-hero-inner { max-width: 1200px; margin: 0 auto; padding: 46px 16px 52px; position: relative; z-index: 1; }
.g-hero h1 { font-size: clamp(26px, 4.5vw, 42px); font-weight: 900; line-height: 1.2; max-width: 640px; }
.g-hero p { margin-top: 12px; font-size: clamp(14px, 2vw, 17px); opacity: .92; max-width: 560px; }
.g-hero .stars { position: absolute; right: -30px; top: -30px; font-size: 190px; opacity: .12; transform: rotate(12deg); }
.g-hero-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 12px 22px; font-size: 15px; font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease;
}
.g-btn:active { transform: scale(.97); }
.g-btn-light { background: #fff; color: var(--g-primary); }
.g-btn-outline-light { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.75); }
.g-btn-primary { background: var(--g-primary); color: #fff; box-shadow: 0 4px 14px rgba(185,28,28,.35); }
.g-btn-primary:hover { background: var(--g-primary-dark); }
.g-btn-outline { background: #fff; color: var(--g-primary); border: 2px solid var(--g-primary); }
.g-btn-ghost { background: #f3f4f6; color: var(--g-ink); }
.g-btn:disabled { opacity: .55; cursor: not-allowed; }
.g-btn-lg { padding: 14px 26px; font-size: 16px; }
.g-btn-block { width: 100%; }

/* ── Value props ────────────────────────────────────────── */
.g-catnav {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 4px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin-top: -26px; position: relative; z-index: 2;
}
.g-catnav::-webkit-scrollbar { display: none; }
.g-cat-chip {
  flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px;
  background: var(--g-card); box-shadow: var(--g-shadow); font-size: 13px; font-weight: 600;
  color: var(--g-ink); text-decoration: none; white-space: nowrap; transition: transform .15s ease;
}
.g-cat-chip:hover { transform: translateY(-2px); color: var(--g-primary); }
.g-cat-chip .ico { font-size: 15px; }
.g-props { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; position: relative; z-index: 2; }
.g-prop { background: var(--g-card); border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.g-prop .ico { font-size: 26px; }
.g-prop b { display: block; font-size: 14px; }
.g-prop span { font-size: 12.5px; color: var(--g-ink-soft); }

/* ── Product grid ───────────────────────────────────────── */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.g-card {
  background: var(--g-card); border-radius: var(--g-radius); overflow: hidden;
  box-shadow: var(--g-shadow); transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.g-card:hover { transform: translateY(-3px); box-shadow: var(--g-shadow-lg); }
.g-card-img { aspect-ratio: 1; background: #f3f4f6; position: relative; overflow: hidden; }
.g-card-img img { width: 100%; height: 100%; object-fit: cover; }
.g-tag {
  position: absolute; top: 8px; left: 8px; background: var(--g-accent); color: #fff;
  font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 2px 7px;
}
.g-tag.ws { background: var(--g-blue); }
.g-tag.sale { background: #dc2626; }
.g-card-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.g-card-name { font-size: 13px; line-height: 1.35; height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-card-rating { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.g-card-rating .stars { color: #f59e0b; letter-spacing: 1px; }
.g-card-rating .cnt { color: var(--g-ink-soft); }
.g-card-price { color: var(--g-primary); font-weight: 800; font-size: 16px; }
.g-card-price small { font-weight: 600; font-size: 11px; color: var(--g-ink-soft); }
.g-card-price-orig { color: var(--g-ink-soft); font-weight: 600; font-size: 12px; text-decoration: line-through; }
.g-card-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--g-ink-soft); margin-top: auto; }

/* ── Filter bar ─────────────────────────────────────────── */
.g-filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.g-filterbar select, .g-filterbar input[type="text"] {
  border: 1.5px solid var(--g-line); border-radius: 10px; padding: 8px 12px; background: #fff; outline: none;
}
.g-chip {
  border: 1.5px solid var(--g-line); background: #fff; border-radius: 999px;
  padding: 7px 15px; font-size: 13px; font-weight: 600; color: var(--g-ink-soft);
}
.g-chip.on { background: var(--g-primary); border-color: var(--g-primary); color: #fff; }

/* ── Pagination ─────────────────────────────────────────── */
.g-pager { display: flex; gap: 7px; justify-content: center; margin: 26px 0; flex-wrap: wrap; }
.g-pager button {
  min-width: 38px; height: 38px; border: 1.5px solid var(--g-line); border-radius: 10px;
  background: #fff; font-weight: 700; color: var(--g-ink);
}
.g-pager button.on { background: var(--g-primary); border-color: var(--g-primary); color: #fff; }
.g-pager button:disabled { opacity: .4; }

/* ── Product detail ─────────────────────────────────────── */
.g-pd { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 28px; margin-top: 22px; }
.g-pd-gallery .main { border-radius: var(--g-radius); overflow: hidden; background: #fff; box-shadow: var(--g-shadow); aspect-ratio: 1; }
.g-pd-gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.g-pd-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.g-pd-thumbs img { width: 62px; height: 62px; object-fit: cover; border-radius: 9px; border: 2px solid transparent; cursor: pointer; flex: 0 0 auto; }
.g-pd-thumbs img.on { border-color: var(--g-primary); }
.g-pd-info h1 { font-size: clamp(18px, 2.6vw, 25px); line-height: 1.3; }
.g-pd-sub { display: flex; gap: 14px; color: var(--g-ink-soft); font-size: 13px; margin-top: 8px; flex-wrap: wrap; }
.g-pd-pricebox { background: var(--g-primary-soft); border-radius: var(--g-radius); padding: 15px 17px; margin-top: 14px; }
.g-pd-price { font-size: clamp(24px, 3.4vw, 32px); font-weight: 900; color: var(--g-primary); }
.g-pd-price small { font-size: 13px; font-weight: 600; color: var(--g-ink-soft); }
.g-pd-ws { margin-top: 7px; font-size: 13.5px; color: var(--g-blue); font-weight: 600; }
.g-pd-row { margin-top: 16px; }
.g-pd-row .lbl { font-size: 13px; font-weight: 700; color: var(--g-ink-soft); margin-bottom: 7px; }
.g-variants { display: flex; gap: 8px; flex-wrap: wrap; }
.g-variant {
  border: 1.5px solid var(--g-line); background: #fff; border-radius: 9px; padding: 7px 13px;
  font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.g-variant img { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; }
.g-variant.on { border-color: var(--g-primary); color: var(--g-primary); background: var(--g-primary-soft); font-weight: 700; }
.g-variant:disabled { opacity: .45; }
.g-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--g-line); border-radius: 10px; overflow: hidden; background: #fff; }
.g-qty button { width: 40px; height: 40px; border: none; background: #f9fafb; font-size: 18px; font-weight: 700; }
.g-qty input { width: 58px; height: 40px; border: none; text-align: center; font-weight: 700; outline: none; }
.g-pd-actions { display: flex; gap: 11px; margin-top: 20px; flex-wrap: wrap; }
.g-pd-desc { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 20px; margin-top: 30px; overflow-x: auto; }
.g-pd-desc img { margin: 0 auto; }
.g-ship-note { margin-top: 15px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 11px; padding: 11px 13px; font-size: 13px; color: #1e40af; }

/* ── Cart / checkout ───────────────────────────────────── */
.g-cart-item {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center;
  background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 13px; margin-bottom: 11px;
}
.g-cart-item img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; background: #f3f4f6; }
.g-cart-name { font-size: 13.5px; line-height: 1.35; }
.g-cart-variant { font-size: 12px; color: var(--g-ink-soft); margin-top: 2px; }
.g-cart-price { color: var(--g-primary); font-weight: 800; margin-top: 5px; }
.g-cart-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.g-icon-btn { border: none; background: transparent; color: var(--g-ink-soft); font-size: 16px; padding: 4px; }
.g-icon-btn:hover { color: var(--g-primary); }
.g-summary { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 18px; }
.g-summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.g-summary .row.total { border-top: 1.5px dashed var(--g-line); margin-top: 8px; padding-top: 13px; font-size: 17px; font-weight: 800; }
.g-summary .row.total .val { color: var(--g-primary); font-size: 21px; }
.g-2col { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; margin-top: 20px; }

/* forms */
.g-form-card { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 20px; }
.g-form-card h3 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.g-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-fgroup { margin-bottom: 13px; }
.g-fgroup label { display: block; font-size: 12.5px; font-weight: 700; color: var(--g-ink-soft); margin-bottom: 5px; }
.g-fgroup label .req { color: var(--g-primary); }
.g-fgroup input, .g-fgroup select, .g-fgroup textarea {
  width: 100%; border: 1.5px solid var(--g-line); border-radius: 10px; padding: 10px 12px; outline: none; background: #fff;
}
.g-fgroup input:focus, .g-fgroup select:focus, .g-fgroup textarea:focus { border-color: var(--g-primary); }

/* payment methods */
.g-pay-opt {
  display: flex; align-items: center; gap: 12px; border: 2px solid var(--g-line);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; cursor: pointer; background: #fff;
}
.g-pay-opt.on { border-color: var(--g-primary); background: var(--g-primary-soft); }
.g-pay-opt .ico { font-size: 24px; width: 34px; text-align: center; }
.g-pay-opt b { display: block; font-size: 14px; }
.g-pay-opt span { font-size: 12px; color: var(--g-ink-soft); }
.g-pay-opt input { accent-color: var(--g-primary); width: 18px; height: 18px; margin-left: auto; flex: 0 0 auto; }

/* ── Orders ─────────────────────────────────────────────── */
.g-order-card { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 16px; margin-bottom: 13px; }
.g-order-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px dashed var(--g-line); padding-bottom: 10px; margin-bottom: 10px; }
.g-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; }
.g-badge.pending  { background: #fef3c7; color: #92400e; }
.g-badge.paid     { background: #d1fae5; color: #065f46; }
.g-badge.shipping { background: #dbeafe; color: #1e40af; }
.g-badge.done     { background: #d1fae5; color: #065f46; }
.g-badge.cancel   { background: #fee2e2; color: #991b1b; }

/* timeline */
.g-timeline { position: relative; padding-left: 26px; margin-top: 6px; }
.g-timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--g-line); }
.g-tl-item { position: relative; padding: 7px 0 7px 6px; }
.g-tl-item::before {
  content: ""; position: absolute; left: -24px; top: 13px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--g-line);
}
.g-tl-item.done::before { border-color: var(--g-green); background: var(--g-green); }
.g-tl-item.now::before  { border-color: var(--g-primary); background: #fff; }
.g-tl-item b { font-size: 13.5px; display: block; }
.g-tl-item .note { font-size: 12.5px; color: var(--g-ink-soft); }
.g-tl-item .time { font-size: 11.5px; color: #9ca3af; }
.g-track-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px dotted var(--g-line); flex-wrap: wrap; }
.g-track-row .k { color: var(--g-ink-soft); }
.g-track-row .v { font-weight: 700; word-break: break-all; }

/* ── Misc ───────────────────────────────────────────────── */
.g-empty { text-align: center; color: var(--g-ink-soft); padding: 60px 16px; }
.g-empty .big { font-size: 52px; margin-bottom: 12px; }
.g-alert { border-radius: 11px; padding: 12px 15px; font-size: 14px; margin: 14px 0; }
.g-alert.ok   { background: #d1fae5; color: #065f46; }
.g-alert.err  { background: #fee2e2; color: #991b1b; }
.g-alert.warn { background: #fef3c7; color: #92400e; }
.g-skel { background: linear-gradient(90deg,#eee 25%,#f6f6f6 50%,#eee 75%); background-size: 200% 100%; animation: gskel 1.3s infinite; border-radius: var(--g-radius); }
@keyframes gskel { to { background-position: -200% 0; } }
.g-toasts { position: fixed; top: 74px; right: 14px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.g-toast {
  background: #111827; color: #fff; border-radius: 11px; padding: 11px 16px; font-size: 13.5px;
  box-shadow: var(--g-shadow-lg); animation: gtoast .25s ease; max-width: 320px;
}
.g-toast.ok { background: var(--g-green); }
.g-toast.err { background: var(--g-primary); }
@keyframes gtoast { from { opacity: 0; transform: translateX(24px); } }

/* ── Mobile bottom nav ──────────────────────────────────── */
.g-bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: #fff; border-top: 1px solid var(--g-line);
  padding: 5px 0 calc(5px + env(safe-area-inset-bottom));
}
.g-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 10.5px; color: var(--g-ink-soft); position: relative;
}
.g-bottom-nav a.on { color: var(--g-primary); font-weight: 700; }
.g-bottom-nav .ico { font-size: 20px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .g-pd { grid-template-columns: 1fr; }
  .g-2col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .g-header-main { flex-wrap: wrap; gap: 8px; padding: 9px 12px; }
  .g-search { order: 3; flex-basis: 100%; max-width: none; }
  .g-hact .txt { display: none; }
  .g-bottom-nav { display: flex; }
  body { padding-bottom: 62px; }
  .g-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .g-frow { grid-template-columns: 1fr; }
  .g-hero-inner { padding: 32px 16px 44px; }
  .g-footer-inner { padding-bottom: 110px; }
}

/* ── Support chat widget ────────────────────────────────── */
.g-chat-fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 200;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--g-primary), #dc2626);
  color: #fff; font-size: 24px; box-shadow: var(--g-shadow-lg);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.g-chat-fab:hover { transform: scale(1.08); }
.g-chat-fab.open { transform: scale(.92); opacity: .85; }
.g-chat-fab-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
  border-radius: 10px; background: var(--g-accent); color: #fff;
  font-size: 11px; font-weight: 800; display: flex; align-items: center;
  justify-content: center; padding: 0 5px; border: 2px solid #fff;
}
.g-chat-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 210;
  width: 380px; max-width: calc(100vw - 40px); height: 560px; max-height: calc(100vh - 130px);
  background: var(--g-card); border-radius: 18px; box-shadow: var(--g-shadow-lg);
  border: 1px solid var(--g-line);
  display: none; flex-direction: column; overflow: hidden;
}
.g-chat-panel.show { display: flex; animation: gchatin .18s ease; }
@keyframes gchatin { from { opacity: 0; transform: translateY(14px); } }
.g-chat-hd {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: linear-gradient(135deg, var(--g-primary), #dc2626); color: #fff;
  flex-shrink: 0;
}
.g-chat-hd-back, .g-chat-hd-x {
  background: rgba(255,255,255,.16); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.g-chat-hd-info { flex: 1; min-width: 0; }
.g-chat-hd-title { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-chat-hd-sub { font-size: 11px; opacity: .85; }
.g-chat-body { flex: 1; overflow-y: auto; background: var(--g-bg); -webkit-overflow-scrolling: touch; }
.g-chat-loading { padding: 30px 16px; text-align: center; color: var(--g-ink-soft); font-size: 13px; }
.g-chat-empty {
  padding: 44px 24px; text-align: center; color: var(--g-ink-soft);
  display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 13px;
}
.g-chat-empty .big { font-size: 40px; }
.g-chat-empty b { color: var(--g-ink); font-size: 14px; }
.g-chat-list { display: flex; flex-direction: column; }
.g-chat-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: #fff; border: none; border-bottom: 1px solid var(--g-line);
  text-align: left; width: 100%;
}
.g-chat-item:hover { background: var(--g-primary-soft); }
.g-chat-item-img {
  width: 42px; height: 42px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--g-bg); display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.g-chat-item-img img { width: 100%; height: 100%; object-fit: cover; }
.g-chat-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-chat-item-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-chat-item-info span { font-size: 11px; color: var(--g-ink-soft); }
.g-chat-unread {
  min-width: 19px; height: 19px; border-radius: 10px; background: var(--g-primary);
  color: #fff; font-size: 10.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0;
}
.g-chat-msgs { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.g-chat-msg { display: flex; flex-direction: column; max-width: 82%; }
.g-chat-msg.me { align-self: flex-end; align-items: flex-end; }
.g-chat-msg.staff { align-self: flex-start; align-items: flex-start; }
.g-chat-msg .who { font-size: 10px; color: var(--g-ink-soft); margin-bottom: 3px; }
.g-chat-bubble {
  padding: 8px 12px; border-radius: 14px; font-size: 13.5px;
  white-space: pre-wrap; word-break: break-word; display: inline-block;
}
.g-chat-msg.me .g-chat-bubble { background: var(--g-primary); color: #fff; border-bottom-right-radius: 4px; }
.g-chat-msg.staff .g-chat-bubble { background: #fff; border: 1px solid var(--g-line); border-bottom-left-radius: 4px; }
.g-chat-msgimg {
  max-width: 200px; max-height: 200px; border-radius: 12px; cursor: zoom-in;
  border: 1px solid var(--g-line); background: #fff;
}
.g-chat-card {
  display: flex; gap: 9px; align-items: center; background: #fff;
  border: 1px solid var(--g-line); border-radius: 12px; padding: 9px;
  max-width: 250px; box-shadow: var(--g-shadow);
}
.g-chat-card img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.g-chat-card .oic {
  width: 44px; height: 44px; border-radius: 9px; background: #fef3c7;
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.g-chat-card .inf { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-chat-card .inf b { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-chat-card .inf i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--g-primary); }
.g-chat-card .inf u { text-decoration: none; font-size: 10.5px; color: var(--g-blue); }
.g-chat-composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--g-line); flex-shrink: 0;
}
.g-chat-attach { font-size: 20px; cursor: pointer; padding: 6px 2px; flex-shrink: 0; }
.g-chat-composer textarea {
  flex: 1; border: 1.5px solid var(--g-line); border-radius: 12px;
  padding: 8px 12px; resize: none; outline: none; max-height: 110px; min-width: 0;
}
.g-chat-composer textarea:focus { border-color: var(--g-primary); }
.g-chat-send {
  width: 38px; height: 38px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--g-primary); color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.g-chat-send:disabled { opacity: .5; }
@media (max-width: 760px) {
  .g-chat-fab { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); width: 50px; height: 50px; font-size: 21px; }
  .g-chat-panel {
    right: 0; left: 0; top: 0; bottom: 0; width: 100%; max-width: 100%;
    height: 100%; max-height: 100%; border-radius: 0; border: none;
  }
  .g-chat-hd { padding-top: calc(12px + env(safe-area-inset-top)); }
}
