/* SBUY — shared design system for storefront and admin */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f3efe7;
  --line: #e7e1d6;
  --ink: #1c1b19;
  --ink-2: #57534c;
  --ink-3: #8a857c;
  --gold: #a8863f;
  --gold-ink: #7d6127;      /* gold used for text: 5.3:1 on white */
  --gold-soft: #f5eddc;
  --ok: #2f7a4f;  --ok-soft: #e7f3ec;
  --warn: #9a6a00; --warn-soft: #fbf1db;
  --bad: #b23a3a; --bad-soft: #fbeaea;
  --info: #2f5f9a; --info-soft: #e8eff8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28,27,25,.04), 0 8px 24px rgba(28,27,25,.06);
  --shadow-lg: 0 24px 64px rgba(28,27,25,.18);
  --font: "Noto Sans Lao", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", "Noto Sans Lao", Georgia, serif;
  --header-h: 64px;
  --tabbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* ------------------------------------------------------------ buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #95752f; }
.btn-outline { background: var(--surface); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #962f2f; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #256440; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 0; background: transparent; position: relative; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--info-soft); color: var(--info); }
.badge-shipped { background: var(--gold-soft); color: var(--gold-ink); }
.badge-completed { background: var(--ok-soft); color: var(--ok); }
.badge-rejected { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: var(--surface-2); color: var(--ink-3); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--ink-3); }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; letter-spacing: .02em; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ dialogs */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(20,19,17,.5); backdrop-filter: blur(3px); }
.modal { width: 560px; border-radius: 20px; max-height: calc(100dvh - 32px); }
.modal[open] { display: flex; flex-direction: column; animation: pop .2s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; background: var(--bg); }
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 440px; border-radius: 0; }
.drawer[open] { display: flex; flex-direction: column; animation: slide .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 639px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .modal[open] { animation: sheet .25s ease-out; }
  .drawer { width: 100vw; max-width: 100vw; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* ------------------------------------------------------------ toast */
.toasts { position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 768px) { .toasts { bottom: 24px; } }
.toast { display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s ease-out; }
.toast.error { background: var(--bad); }
.toast.ok .icon { color: #9fe0b8; }

/* ------------------------------------------------------------ storefront header */
.announce { background: var(--ink); color: #eae6dd; font-size: 13px; text-align: center; padding: 8px 16px; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(250,248,244,.9); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; background: linear-gradient(135deg, #cfae6a, #9e7b35); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .14em; line-height: 1; }
.brand-sub { display: block; font-size: 11px; color: var(--gold-ink); letter-spacing: .08em; margin-top: 2px; }
.main-nav { display: none; gap: 4px; }
.main-nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.header-actions { display: flex; gap: 4px; align-items: center; }
.count-badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
@media (min-width: 768px) { .main-nav { display: flex; } }

/* mobile app tab bar */
.tabbar { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a, .tabbar button { display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); text-decoration: none; border: 0; background: none; position: relative; }
.tabbar [aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar .count-badge { top: 6px; right: calc(50% - 20px); }
@media (min-width: 768px) { .tabbar { display: none; } }
.shop-main { padding-bottom: calc(var(--tabbar-h) + 32px); min-height: 60vh; }
@media (min-width: 768px) { .shop-main { padding-bottom: 64px; } }

/* ------------------------------------------------------------ hero & catalog */
.hero { position: relative; margin-top: 24px; border-radius: 24px; overflow: hidden; background: #2a2723; color: #fff; min-height: 340px; display: flex; align-items: flex-end; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.1)); }
.hero-content { position: relative; z-index: 1; padding: 32px 24px; max-width: 560px; }
.hero .eyebrow { display: inline-block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #e8d3a2; margin-bottom: 12px; }
.hero h1 { font-size: clamp(28px, 5vw, 46px); font-weight: 600; line-height: 1.25; margin-bottom: 12px; }
.hero p { color: #e2ded6; margin-bottom: 24px; }
.hero .btn-gold { box-shadow: 0 8px 24px rgba(168,134,63,.35); }
@media (min-width: 768px) { .hero { min-height: 440px; align-items: center; } .hero-content { padding: 56px; } }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.section-head h2 { font-family: var(--font-display); font-size: 26px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: none; }
.toolbar .select { width: auto; min-height: 38px; padding: 6px 12px; border-radius: 999px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product { display: flex; flex-direction: column; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.product-media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product:hover .product-media img { transform: scale(1.04); }
.product-tag { position: absolute; left: 10px; top: 10px; }
.product-info { padding: 10px 2px 0; display: grid; gap: 2px; }
.product-cat { font-size: 12px; color: var(--ink-3); }
.product-name { font-size: 15px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .price { font-size: 15px; }
.soldout img { filter: grayscale(.6); opacity: .7; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-3); display: grid; gap: 12px; justify-items: center; }
.empty .icon { width: 40px; height: 40px; color: var(--line); }

.skeleton { background: linear-gradient(90deg, var(--surface-2), #ece6db, var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* product dialog */
.pd { width: 920px; }
.pd .pd-grid { display: grid; }
@media (min-width: 768px) { .pd .pd-grid { grid-template-columns: 1fr 1fr; } }
.pd-media { background: var(--surface-2); aspect-ratio: 4 / 5; max-height: 70dvh; width: 100%; }
.pd-media img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.pd-info h2 { font-family: var(--font-display); font-size: 24px; }
.pd-close { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.92); z-index: 2; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn { min-width: 52px; min-height: 44px; padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.size-btn:hover { border-color: var(--ink); }
.size-btn[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.size-btn:disabled { color: var(--ink-3); text-decoration: line-through; background: var(--surface-2); cursor: not-allowed; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; }

/* cart */
.cart-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-line img { width: 72px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.cart-line .stepper button { width: 32px; height: 32px; }
.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.summary-row.total { font-size: 18px; font-weight: 700; }

/* checkout */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.steps li { flex: 1; list-style: none; font-size: 12px; color: var(--ink-3); border-top: 3px solid var(--line); padding-top: 6px; }
.steps li[aria-current="step"], .steps li.done { color: var(--ink); border-color: var(--gold); font-weight: 600; }
.steps { padding: 0; margin-top: 0; }
.pay-box { display: grid; gap: 16px; justify-items: center; text-align: center; padding: 20px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--line); }
.pay-box img { width: 220px; height: 220px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 8px; }
.pay-amount { font-size: 28px; font-weight: 700; color: var(--ink); }
.copy-row { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; }
.dropzone { display: grid; justify-items: center; gap: 8px; padding: 24px; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--ink-2); cursor: pointer; background: var(--surface); }
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: var(--gold-soft); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone img { max-height: 200px; width: auto; border-radius: 8px; }
.success { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 16px 0; }
.success .ring { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.order-code { font-size: 26px; font-weight: 700; letter-spacing: .06em; }

/* tracking */
.narrow { max-width: 640px; margin: 32px auto 0; }
.page-title { font-family: var(--font-display); font-size: 28px; margin-bottom: 6px; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 20px 32px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.timeline li.done .dot { background: var(--gold); border-color: var(--gold); }
.timeline li.bad .dot { background: var(--bad); border-color: var(--bad); }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.progress span { height: 6px; border-radius: 999px; background: var(--line); }
.progress span.on { background: var(--gold); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* about */
.values { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 768px) { .values { grid-template-columns: repeat(3, 1fr); } }
.values .card { padding: 24px; display: grid; gap: 8px; }
.values .icon { color: var(--gold); width: 28px; height: 28px; }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--ink-3); font-size: 13px; margin-bottom: var(--tabbar-h); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
@media (min-width: 768px) { .site-footer { margin-bottom: 0; } }

/* ------------------------------------------------------------ admin */
.admin-body { background: #f6f5f2; }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 32px; display: grid; gap: 20px; box-shadow: var(--shadow); }
.login-card .brand { justify-self: center; }
.login-card h1 { font-size: 20px; text-align: center; }
.remembered { display: grid; gap: 6px; }
.remembered[hidden] { display: none; }
.remembered .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.remembered-chip { padding: 0; min-height: 34px; overflow: hidden; }
.remembered-chip.active { border-color: var(--ink); color: var(--ink); }
.remembered-chip button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; min-height: 34px; }
.remembered-pick { padding: 4px 6px 4px 14px; font-family: var(--mono, monospace); }
.remembered-x { padding: 4px 12px 4px 6px; color: var(--ink-3) !important; font-size: 13px; }
.remembered-x:hover { color: var(--bad) !important; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 1px; }

.admin-shell { display: grid; min-height: 100dvh; }
@media (min-width: 960px) { .admin-shell { grid-template-columns: 248px 1fr; } }
.sidebar { background: var(--ink); color: #d9d5cc; padding: 20px 14px; display: none; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; }
@media (min-width: 960px) { .sidebar { display: flex; } }
.sidebar .brand { color: #fff; padding: 4px 10px 20px; }
.sidebar .brand-sub { color: #cfae6a; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: inherit; text-align: left; font-size: 14px; width: 100%; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.side-link .count-badge { position: static; margin-left: auto; }
.sidebar .grow { flex: 1; }
.side-user { padding: 12px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; display: grid; gap: 2px; }

.admin-top { position: sticky; top: 0; z-index: 30; background: rgba(246,245,242,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 16px; }
@media (min-width: 960px) { .admin-top-row { padding: 0 32px; } .admin-top .mobile-only { display: none; } }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs .chip { flex: none; min-height: 34px; font-size: 13px; }
@media (min-width: 960px) { .admin-tabs { display: none; } }
.admin-main { padding: 20px 16px 48px; min-width: 0; }
@media (min-width: 960px) { .admin-main { padding: 28px 32px 64px; } }
.admin-main h1 { font-size: 22px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px 18px; display: grid; gap: 4px; }
.stat .label { font-weight: 500; color: var(--ink-3); }
.stat .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel { padding: 20px; }
.panel h2 { font-size: 16px; margin-bottom: 16px; }
.two-col { display: grid; gap: 20px; }
@media (min-width: 1100px) { .two-col { grid-template-columns: 2fr 1fr; } }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar i { display: block; width: 100%; max-width: 28px; background: var(--gold); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.chart .bar small { font-size: 10px; color: var(--ink-3); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--bg); }
.table tr.clickable { cursor: pointer; }
.table .thumb { width: 44px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 16px; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters .input { max-width: 280px; min-height: 40px; }

.slip-img { width: 100%; max-height: 420px; object-fit: contain; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: zoom-in; }
.detail-grid { display: grid; gap: 20px; }
.items-list { display: grid; gap: 8px; }
.items-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-row { display: grid; grid-template-columns: 1fr 120px 44px; gap: 8px; align-items: center; }
.qr-2fa { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* small utilities (no inline styles: CSP blocks them) */
.p-0 { padding: 0 !important; }
.small { font-size: 13px; }
.mt-6 { margin-top: 6px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .btn { flex: 1; }
.narrow.wide { max-width: 860px; }
.pd-price { font-size: 20px; margin-top: 6px; }
.modal-foot.stack { flex-direction: column; align-items: stretch; }
.track-form { padding: 20px; margin: 20px 0; }
.skel-line { height: 14px; margin-top: 12px; width: 70%; }
.search-hit { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; align-items: center; }
.search-hit:hover { background: var(--bg); }
.search-hit img { height: 72px; }
@media (max-width: 767px) { .pd-media { aspect-ratio: auto; height: 42dvh; } .pd-info { padding: 20px 16px 24px; } }
[tabindex="-1"]:focus { outline: none; }
button.stat { text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.stat:hover { border-color: var(--gold); }
.table td .badge { margin: 2px; }
.file-warning { position: sticky; top: 0; z-index: 100; border-radius: 0; text-align: center; }

/* ------------------------------------------------------------ v2: prices, promos, product page, reviews */
a.product { text-decoration: none; color: inherit; }
.product-tags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.video-tag { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 11px; }
.badge-sale { background: var(--bad); color: #fff; }
.price-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.price-block .price.sale { color: var(--bad); }
.price-block.big .price { font-size: 24px; }
.compare { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }

.promo-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.promo-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-size: 14px; font-weight: 500; }

.crumbs { font-size: 13px; color: var(--ink-3); margin: 20px 0 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.product-page { display: grid; gap: 24px; }
@media (min-width: 900px) { .product-page { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; } .gallery { position: sticky; top: calc(var(--header-h) + 16px); } }
.gallery { display: grid; gap: 10px; }
.gallery-stage { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.gallery-main { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; background: #000; }
video.gallery-main { object-fit: contain; cursor: default; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.thumb-btn { flex: none; width: 68px; height: 84px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn[aria-current="true"] { border-color: var(--ink); }
.thumb-video { display: grid; place-items: center; width: 100%; height: 100%; background: var(--ink); color: #fff; font-size: 16px; }
.pd-info { display: flex; flex-direction: column; gap: 14px; padding: 0; }
.pd-title { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); }
.rating-link { text-decoration: none; }
.sale-ends { color: var(--bad); font-size: 13px; font-weight: 600; }
.promo-list, .assurance { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.promo-list li { display: flex; gap: 8px; align-items: center; color: var(--gold-ink); background: var(--gold-soft); padding: 8px 12px; border-radius: var(--radius-sm); }
.assurance { border-top: 1px solid var(--line); padding-top: 14px; color: var(--ink-2); }
.assurance li { display: flex; gap: 10px; align-items: center; }
.pd-desc { color: var(--ink-2); white-space: pre-line; }
.pd-section { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 28px; }
.pd-section h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 16px; }
.spec-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }

.review-summary { display: grid; gap: 20px; margin-bottom: 24px; }
@media (min-width: 640px) { .review-summary { grid-template-columns: 180px 1fr; align-items: center; } }
.review-score { display: grid; justify-items: start; gap: 2px; }
.review-score strong { font-size: 40px; line-height: 1; }
.review-bars { display: grid; gap: 6px; max-width: 420px; }
.review-bar { display: grid; grid-template-columns: 32px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; display: block; }
.bar-track i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.review-list { display: grid; gap: 0; }
.review { border-bottom: 1px solid var(--line); padding: 16px 0; display: grid; gap: 8px; }
.review-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.review-media { display: flex; gap: 8px; flex-wrap: wrap; }
.review-thumb { width: 76px; height: 76px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: inline-block; }
.review-thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-reply { background: var(--bg); border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 14px; }
.star-input { display: flex; gap: 4px; }
.star-input button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); padding: 2px; }
.star-input button.on { color: var(--gold); }

.lightbox { width: min(960px, 100vw); max-height: 100dvh; background: #000; border-radius: 12px; padding: 0; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox-media { max-width: 100%; max-height: 90dvh; object-fit: contain; display: block; }
.lightbox-close { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.9); z-index: 2; }

/* cart & checkout */
.hint { display: grid; gap: 6px; font-size: 13px; color: var(--gold-ink); font-weight: 500; padding: 4px 0; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row .input { min-height: 40px; }
.summary { display: grid; gap: 6px; }
.summary-row.discount { color: var(--bad); }
.free-ship { color: var(--ok); font-weight: 600; }
.pay-methods { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.pay-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.pay-option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pay-option input { margin-top: 4px; accent-color: var(--ink); width: 18px; height: 18px; }
.pay-option span { display: grid; gap: 2px; }
.edit-line { display: grid; grid-template-columns: 1fr 96px auto 40px; gap: 8px; align-items: center; }
.edit-line .select { min-height: 40px; padding: 6px 10px; }
@media (max-width: 520px) { .edit-line { grid-template-columns: 1fr auto 40px; } .edit-line .product-name { grid-column: 1 / -1; } }
.row-end { display: inline-flex; gap: 8px; align-items: center; }
.items-list > div { align-items: center; }
@media (max-width: 899px) { .gallery-stage { aspect-ratio: auto; height: min(62vh, 560px); } }
.cart-line a.product-name { text-decoration: none; } .cart-line a.product-name:hover { text-decoration: underline; }

/* ------------------------------------------------------------ v2 admin */
.modal.wide { width: 760px; }
.row-gap { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.sale-text { color: var(--bad); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; }
.fieldset legend { padding: 0 6px; }
@media (min-width: 640px) { .form-grid.three { grid-template-columns: repeat(3, 1fr); } }
.form-grid.three { display: grid; gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.slip-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.slip-grid figure { margin: 0; display: grid; gap: 4px; }
.slip-grid .slip-img { max-height: 260px; }
.media-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.media-tile { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.media-tile img, .media-tile video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.media-cover { position: absolute; top: 8px; left: 8px; }
.media-actions { display: flex; justify-content: space-between; background: var(--surface); border-top: 1px solid var(--line); }
.media-actions .icon-btn { width: 40px; height: 40px; }
.media-actions .icon-btn:disabled { opacity: .3; }
.upload-row { display: grid; gap: 4px; }
.empty-thumb { display: grid; place-items: center; color: var(--ink-3); }
.channel { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 8px; margin-bottom: 12px; }
.channel .page-head { margin: 0; }
.review-admin-list { display: grid; gap: 12px; }
.review-admin { display: grid; gap: 10px; }
.review-admin .page-head { margin: 0; }
.big-stars { font-size: 18px; }
.review-video { width: 220px; max-height: 220px; border-radius: 10px; background: #000; }

/* ------------------------------------------------------------ v3: edit mode, branding, footer, policies */
.edit-banner { position: sticky; top: var(--header-h); z-index: 35; background: var(--gold-soft); border-bottom: 1px solid #e6d4ac; color: var(--gold-ink); font-size: 14px; }
.edit-banner .container { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.edit-banner .icon { vertical-align: -3px; }
.brand-logo { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
.size-select { width: auto; min-height: 36px; padding: 4px 10px; font-size: 13px; }
.pd-top { margin: 0; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.recent-orders { display: grid; gap: 8px; margin-bottom: 16px; }
.site-footer { padding: 40px 0 24px; }
.footer-grid { display: grid !important; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-col { display: grid; gap: 6px; align-content: start; color: var(--ink-2); }
.footer-col strong { color: var(--ink); margin-bottom: 4px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; color: var(--ink); }
.footer-bottom { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; font-size: 12px; color: var(--ink-3); }
.pre { white-space: pre-line; }
.policy-list { display: grid; gap: 16px; margin-top: 16px; }
.policy { padding: 24px; display: grid; gap: 10px; }
.policy h2 { font-size: 18px; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.check-col { width: 36px; }
.check-col input { width: 18px; height: 18px; accent-color: var(--ink); cursor: pointer; }
.settings-grid { display: grid; gap: 20px; }
@media (min-width: 1100px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.logo-row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.logo-preview { width: 120px; height: 120px; border: 1px dashed var(--line); border-radius: var(--radius); display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar .brand-logo { background: #fff; border-radius: 8px; padding: 2px; }

/* ------------------------------------------------------------ v4: announcement bar, order lookup */
.announce { min-height: 34px; display: flex; align-items: center; justify-content: center; }
.announce a { color: inherit; text-decoration: none; }
.announce a:hover { text-decoration: underline; }
.announce-gold { background: var(--gold); color: #fff; }
.announce-red { background: #a32d2d; color: #fff; }
.announce-green { background: #24613f; color: #fff; }
.announce-in { animation: annIn .4s ease-out; }
@keyframes annIn { from { opacity: 0; transform: translateY(4px); } }
.lookup { padding: 0; margin-bottom: 16px; }
.lookup summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--gold-ink); list-style: none; }
.lookup summary::-webkit-details-marker { display: none; }
.lookup summary::before { content: "＋ "; }
.lookup[open] summary::before { content: "－ "; }
.lookup form, .lookup [data-lookup-result] { padding: 0 20px 16px; }
.order-list { display: grid; gap: 8px; margin-top: 8px; }
.order-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.order-row:hover { border-color: var(--ink); }
.order-row-main { display: grid; gap: 2px; min-width: 0; }
.order-row-side { display: grid; gap: 4px; justify-items: end; flex: none; }
.ann-editor { margin-bottom: 20px; display: grid; gap: 14px; }
.ann-editor .page-head { margin: 0; }
.announce-preview { border-radius: var(--radius-sm); font-size: 13px; padding: 8px 14px; }
.ann-list { display: grid; gap: 10px; }
.ann-row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
@media (min-width: 1100px) { .ann-row { grid-template-columns: 1.6fr 1fr auto; align-items: center; } }
.ann-row.off { opacity: .55; }
.ann-main, .ann-dates { display: grid; gap: 6px; }
.ann-dates label { display: grid; gap: 2px; color: var(--ink-3); }
.ann-dates .input { min-height: 38px; padding: 6px 10px; font-size: 13px; }
.ann-actions { display: flex; gap: 4px; align-items: center; }
.ann-options { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; }
.ann-options .field { min-width: 180px; }
.rot90 { transform: rotate(90deg); }

.contact-shop { display: grid; gap: 10px; margin-top: 12px; }

/* ------------------------------------------------------------ v6: returns, staff orders, reports */
.badge-returned { background: #efe7f6; color: #6b3f8f; }
.returns-box { display: grid; gap: 10px; }
.returns-box .page-head { margin: 0; }
.return-card { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.review-admin-list .return-card { border-top: 0; }
.return-line { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.return-line .input { min-height: 38px; padding: 6px 10px; }
.link-btn { border: 0; background: none; padding: 0; font-weight: 700; color: var(--ink); text-decoration: underline; cursor: pointer; }
.pick-results { display: grid; gap: 4px; }
.pick-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.pick-row:hover { border-color: var(--ink); }
.pick-row img { width: 40px; height: 48px; object-fit: cover; border-radius: 6px; }
.check-group { display: grid; gap: 8px; }
.report-bar { align-items: center; }
.report-bar .input { max-width: 170px; min-height: 38px; }
.report-stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1100px) { .report-stats { grid-template-columns: repeat(4, 1fr); } }
.report-grid { display: grid; gap: 20px; margin-top: 20px; }
@media (min-width: 1100px) { .report-grid { grid-template-columns: 1fr 1fr; } }
.table td.num, .table th.num { text-align: right; }
.chart-wide { height: 220px; gap: 3px; }
.chart-wide .bar i { max-width: 22px; }

/* ------------------------------------------------------------ v7: advanced security */
.mt-section { margin-top: 20px; }
.code-box { display: grid; gap: 6px; margin-top: 12px; }
.approval-code { font-size: 36px; font-weight: 700; letter-spacing: .12em; padding: 12px 20px; background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--radius); text-align: center; }

/* ------------------------------------------------------------ v9: banner slides, about page */
.hero { display: block; padding: 0; }
.hero::after { display: none; }
.hero-loading { background: linear-gradient(90deg, #2a2723, #3a3631, #2a2723); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.hero-slide { position: absolute; inset: 0; display: flex; align-items: flex-end; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.1)); }
.hero-slide.center { justify-content: center; text-align: center; }
.hero-slide.center::after { background: rgba(0,0,0,.42); }
.hero-slide.center .hero-content { margin: 0 auto; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.hero-slide .hero-content { position: relative; z-index: 1; }
.hero-title { font-size: clamp(28px, 5vw, 46px); font-weight: 600; line-height: 1.25; margin-bottom: 12px; }
@media (min-width: 768px) { .hero-slide { align-items: center; } }
.hero-dots { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dots button { width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0; background: rgba(255,255,255,.5); transition: width .3s; }
.hero-dots button[aria-selected="true"] { width: 26px; background: #fff; }
.hero-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; display: none; place-items: center; backdrop-filter: blur(4px); }
.hero-arrow:hover { background: rgba(255,255,255,.32); }
.hero-arrow.prev { left: 14px; }
.hero-arrow.next { right: 14px; }
@media (min-width: 768px) { .hero-arrow { display: grid; } }
.about-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 16px 0; }
.about-text { font-size: 16px; line-height: 1.8; }

.slide-list { display: grid; gap: 14px; margin: 12px 0 16px; }
.slide-card { display: grid; gap: 12px; background: var(--bg); }
.slide-card .page-head { margin: 0; }
.slide-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .slide-grid { grid-template-columns: 280px 1fr; } }
.img-pick { display: grid; gap: 10px; align-content: start; }
.img-pick-preview { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); border: 1px dashed var(--line); background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.img-pick-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-pick label.btn { cursor: pointer; justify-self: start; }
.textarea.short { min-height: 64px; }
.value-row { display: grid; grid-template-columns: 120px 1fr 1.6fr 40px; gap: 8px; align-items: center; }
@media (max-width: 700px) { .value-row { grid-template-columns: 1fr 40px; } .value-row > :nth-child(2), .value-row > :nth-child(3) { grid-column: 1 / -1; } }
/* grid/flex children may shrink below their content width (prevents sideways scrolling on small screens) */
.admin-shell > div, .admin-main, .slide-grid > *, .settings-grid > * { min-width: 0; }
.page-head > p { flex: 1 1 260px; min-width: 0; }

/* ------------------------------------------------------------ v10: storefront redesign (home, collections, colours, help, languages) */
:root[data-lang="th"] body, :root[data-lang="vi"] body, :root[data-lang="zh"] body { font-family: system-ui, -apple-system, "Segoe UI", "Leelawadee UI", "Microsoft YaHei", sans-serif; }
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: inline-grid; } }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lang-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.small-modal { width: 380px; }
.lang-list { display: grid; gap: 8px; }
.lang-option { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 16px; text-align: left; }
.lang-option:hover { border-color: var(--ink); }
.lang-option[aria-current="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
.main-nav .nav-sale { color: var(--bad); }
.main-nav a { white-space: nowrap; }
@media (max-width: 1099px) { .main-nav { display: none; } }
/* absolutely positioned bits (screen-reader text) must stay inside sideways-scrolling rows */
.rail, .product, .price-block { position: relative; }
.site-header .container { gap: 12px; }
.header-actions { gap: 2px; }
@media (max-width: 380px) { .lang-btn span { display: none; } .lang-btn { padding: 0 10px; } }

/* home */
.home-section { margin-top: 48px; }
.home-section .section-head { margin: 0 0 18px; align-items: center; }
.section-head.tight { margin-top: 8px; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--gold-ink); }
.more-link:hover { text-decoration: underline; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .rail { grid-auto-columns: 31%; } }
@media (min-width: 1024px) { .rail { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; gap: 24px 20px; } }
.cat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cat-tile { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; background: #2a2723; }
@media (max-width: 639px) { .cat-tiles { grid-template-columns: 1fr 1fr; } .cat-tile { aspect-ratio: 3 / 4; } .cat-tile:first-child:nth-last-child(odd) { grid-column: 1 / -1; aspect-ratio: 16 / 9; } }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.65)); }
.cat-tile-text { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 14px; display: grid; gap: 2px; }
.cat-tile-text strong { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.cat-tile-text span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #eee5d3; }
.trust { margin-top: 56px; }
.trust-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 640px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--surface); }
.trust-item .icon { color: var(--gold); width: 26px; height: 26px; margin-top: 2px; }
.trust-item strong { display: block; margin-bottom: 2px; }
.review-rail { grid-auto-columns: 82%; }
@media (min-width: 640px) { .review-rail { grid-auto-columns: 45%; } }
@media (min-width: 1024px) { .review-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.quote { margin: 0; padding: 20px; display: grid; gap: 10px; align-content: start; }
.quote blockquote { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.quote a { color: var(--gold-ink); }
.help-band { margin-top: 56px; padding: 28px 24px; border-radius: 20px; background: var(--ink); color: #fff; display: grid; gap: 18px; }
.help-band h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; }
.help-band .muted { color: #c9c3b8; }
.help-band .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.help-band .btn-ghost { color: #fff; }
.help-band .btn-ghost:hover { background: rgba(255,255,255,.08); }
@media (min-width: 900px) { .help-band { grid-template-columns: 1fr auto; align-items: center; padding: 36px 40px; } }

/* product cards */
.product-media .alt-img { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
@media (hover: hover) { .product:hover .product-media .alt-img { opacity: 1; } }
.badge-new { background: var(--ink); color: #fff; }
.swatches { display: flex; gap: 5px; align-items: center; margin: 4px 0 2px; }
.swatch-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sw, #999); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); flex: none; display: inline-block; }
.chip .swatch-dot { margin-right: 6px; }
.product-name { color: var(--ink); }

/* collections */
.toolbar-end { display: flex; gap: 8px; align-items: center; }
.filter-btn { gap: 6px; }
.filter-btn[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.count-badge.static { position: static; margin-left: 2px; }
.filters-panel { padding: 16px 18px; margin: -6px 0 18px; display: grid; gap: 14px; }
.filter-group { display: grid; gap: 8px; }
.filter-group .chip { min-height: 34px; font-size: 13px; }
.filter-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
a.chip { text-decoration: none; }
.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
[data-product-count] { margin: 0 0 12px; }
@media (max-width: 639px) { .toolbar { flex-direction: column; align-items: stretch; } .toolbar-end { justify-content: space-between; } }

/* product page */
.product-page { margin-top: 4px; }
@media (min-width: 900px) { .product-page { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; } .product-page .gallery { position: sticky; top: calc(var(--header-h) + 16px); } }
.gallery-stage { position: relative; }
.gallery-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.gallery-slide .gallery-main { background: var(--surface-2); }
.gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(28,27,25,.7); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; pointer-events: none; }
@media (max-width: 899px) { .product-page .gallery { margin: 0 -16px; } .product-page .gallery-stage { border-radius: 0; } .product-page .thumbs { padding: 0 16px; } }
.pd-top { display: flex; justify-content: space-between; align-items: center; }
.pd-top .product-cat { text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.swatch-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--surface); background: var(--sw, #999); box-shadow: 0 0 0 1px var(--line); position: relative; }
.swatch-btn:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.swatch-btn[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch-btn.out::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--bad); transform: rotate(45deg); }
.size-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.size-head .label { margin: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.warn-text { color: var(--warn); font-weight: 600; }
.buy-row > .stepper { flex: none; }
.accordion { border-top: 1px solid var(--line); }
.acc { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 2px; font-weight: 600; }
.acc summary::-webkit-details-marker { display: none; }
.acc-icon { transition: transform .2s; color: var(--ink-3); }
.acc[open] .acc-icon { transform: rotate(180deg); }
.acc-body { padding: 0 2px 18px; color: var(--ink-2); }
.size-table { font-size: 14px; }
.size-table th[scope="row"] { font-weight: 700; color: var(--ink); }
.size-table td, .size-table th { padding: 10px 12px; text-align: center; }
.size-table thead th { background: var(--bg); }
.sticky-buy { position: fixed; z-index: 39; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(28,27,25,.06); }
.sticky-info { flex: 1; min-width: 0; display: grid; }
.sticky-info .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-buy .btn { flex: none; }
@media (min-width: 900px) { .sticky-buy { display: none !important; } }
.product-page + .pd-section, .pd-section + .home-section { margin-top: 48px; }

/* help & info pages */
.help-layout { display: grid; gap: 24px; margin-top: 28px; }
@media (min-width: 900px) { .help-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 48px; } }
.help-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.help-nav::-webkit-scrollbar { display: none; }
.help-nav a { flex: none; text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink-2); }
.help-nav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (min-width: 900px) { .help-nav { flex-direction: column; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; } .help-nav a { border: 0; background: none; border-radius: 10px; } .help-nav a:hover { background: var(--surface-2); } .help-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; } }
.help-body { display: grid; gap: 20px; align-content: start; max-width: 760px; }
.help-body > .pre { line-height: 1.8; color: var(--ink-2); }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps-list li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step-no { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; }
.help-more { border-top: 1px solid var(--line); padding-top: 16px; }
.help-more a { color: var(--gold-ink); font-weight: 600; }
.contact-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card { display: flex; gap: 14px; align-items: center; padding: 18px; text-decoration: none; }
a.contact-card:hover { border-color: var(--ink); }
.contact-card > .icon { color: var(--gold); width: 26px; height: 26px; }
.contact-card > span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.big-empty { padding: 80px 16px; }
.big-empty .page-title { font-size: 56px; color: var(--ink-3); }

/* footer */
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.footer-brand .brand-name { font-size: 18px; }
.footer-brand > span { font-size: 13px; line-height: 1.7; }
.footer-col a { display: inline-flex; align-items: center; gap: 8px; }
.footer-col a .icon { color: var(--ink-3); flex: none; }
.social { display: flex; gap: 4px; margin-top: 6px; }
.social .icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
.footer-links { display: inline-flex; gap: 16px; align-items: center; }
.footer-links a { color: inherit; }
.footer-links .link-btn { font-weight: 500; text-decoration: none; color: var(--ink-2); }

/* admin: colours × sizes, translations, home/help editors */
.color-list { gap: 8px; }
.color-row { display: grid; grid-template-columns: 48px 1fr 150px 40px; gap: 8px; align-items: center; }
@media (max-width: 560px) { .color-row { grid-template-columns: 48px 1fr 40px; } .color-row > select { grid-column: 1 / -1; } }
.color-input { width: 48px; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.size-custom { max-width: 200px; min-height: 38px; }
.stock-matrix input { width: 76px; min-height: 38px; padding: 4px 8px; }
.stock-matrix th, .stock-matrix td { padding: 6px 8px; }
.translations summary { cursor: pointer; }
.translations[open] summary { margin-bottom: 12px; }
.tr-block { border-top: 1px dashed var(--line); padding-top: 12px; }
.color-tr { max-width: 160px; min-height: 38px; }
.faq-row { display: grid; grid-template-columns: 1fr 40px; gap: 8px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.faq-row .textarea { grid-column: 1 / 2; }
.cat-pick-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tr-row { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .tr-row { grid-template-columns: 1fr 1fr; gap: 16px; } }
.tr-source p { margin-top: 4px; max-height: 120px; overflow: auto; }

/* partner shops (marketplace) */
.product-shop { font-size: 12px; color: var(--gold-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sold-by { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; }
.sold-by:hover { border-color: var(--ink); }
.sold-by img, .sold-by .brand-mark { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.sold-by > span { flex: 1; display: grid; }
.cart-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 12px; margin-bottom: 14px; }
.cart-group-head { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 10px 0 4px; }
.group-summary { padding-top: 10px; font-size: 14px; }
.pay-group { display: grid; gap: 14px; }
.pay-group.card { padding: 16px; }
.placed-orders { display: grid; gap: 10px; justify-items: center; }
.placed-order { display: grid; gap: 2px; justify-items: center; }
.partner-head { display: flex; gap: 20px; align-items: center; margin: 28px 0 20px; padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.partner-logo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; font-size: 32px; }
.partner-info { display: grid; gap: 4px; min-width: 0; }
@media (max-width: 639px) { .partner-head { flex-direction: column; text-align: center; } .partner-head .actions-row { justify-content: center; } }
.eyebrow-dark { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.sell-page { display: grid; gap: 24px; margin-top: 28px; }
.sell-hero { display: grid; gap: 6px; }
.sell-form { padding: 24px; }
.sell-form h2 { font-family: var(--font-display); font-size: 22px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rules { padding: 14px 18px; background: var(--bg); }
.rules summary { cursor: pointer; font-weight: 600; }
.rules ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.footer-col a.footer-sell { color: var(--gold-ink); font-weight: 600; }
.footer-col .footer-chat { font-size: inherit; font-weight: 600; color: var(--gold-ink); text-decoration: none; gap: 8px; justify-self: start; }
.footer-col .footer-chat:hover { text-decoration: underline; }
.footer-col .footer-report { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--ink-3); }
.footer-col .footer-report a { display: inline; text-decoration: underline; }
.footer-col span.pre { display: inline-flex; gap: 8px; align-items: flex-start; }
.checklist { display: grid; gap: 8px; }
.check-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.check-item:hover { border-color: var(--ink); }
.check-item.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; text-decoration: line-through; }
.shop-card { display: grid; gap: 10px; }
.shop-card .page-head { margin: 0; }
.review-product { display: grid; gap: 12px; }
.review-product .page-head { margin: 0; }

/* M2a: stock in cart, tracking proof, receipt checks, bell, seller shop tools */
.stock-note { font-size: 12px; color: var(--ok); margin-top: 2px; }
.stock-note.low { color: var(--warn); font-weight: 600; }
.stock-note.out { color: var(--bad); font-weight: 600; }
.tracking-proof { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin-top: 12px; }
.tracking-proof .barcode { margin: 0; display: grid; gap: 4px; justify-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tracking-proof .barcode svg { width: 220px; height: 56px; }
.tracking-proof .barcode figcaption { font-size: 13px; letter-spacing: .12em; }
.receipt-thumb { display: grid; gap: 4px; justify-items: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.receipt-thumb img { width: 96px; height: 140px; object-fit: cover; border-radius: 6px; }
.small-icon { width: 32px; height: 32px; vertical-align: middle; }
.verified { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; background: var(--info); color: #fff; font-size: 12px; font-weight: 700; vertical-align: middle; }
.verified-note { color: var(--info); font-size: 13px; font-weight: 600; }
.tracking-panel { display: grid; gap: 10px; }
.tracking-panel.flagged { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.check-list li { padding: 8px 10px; border-radius: var(--radius-sm); }
.check-list li.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.check-list li.warn { background: var(--warn-soft); color: var(--warn); }
.ok-text { color: var(--ok); font-weight: 600; }
.receipt-preview { max-width: 180px; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.chip-bad[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.bell { margin-right: 4px; }
.notif-list { display: grid; gap: 6px; }
.notif { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; }
.notif.unread { border-color: var(--gold); background: var(--gold-soft); }
.notif:hover { border-color: var(--ink); }
.sub-box { border-top: 1px solid var(--line); padding-top: 14px; }
.danger-box summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.danger-box[open] { display: grid; gap: 10px; }
.retention-note { display: grid; gap: 8px; margin-bottom: 16px; }
.doc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.doc-grid figure { margin: 0; display: grid; gap: 4px; }
.doc-grid img { width: 100%; max-height: 260px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rules-list { display: grid; gap: 8px; padding-left: 18px; margin: 0; }
.rot180 { transform: rotate(180deg); }

/* mobile tab bar: 5 items */
.tabbar { grid-template-columns: repeat(5, 1fr); }
.tabbar span:not(.count-badge) { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }

/* ---------- payment slip checks (back office) ---------- */
.slip-grid:has(.slip-card) { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.slip-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.slip-card.flagged { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
.slip-card figcaption { display: grid; gap: 4px; }
.slip-review { display: grid; gap: 6px; margin-top: 6px; }
.slip-review label { display: grid; gap: 2px; }
.bad-text { color: var(--bad); font-weight: 600; }

/* ---------- storefront: way in to Seller Center ---------- */
.seller-link { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 10px; height: 36px; display: inline-flex; align-items: center; border-radius: 999px; }
.seller-link:hover { background: var(--bg); color: var(--ink); }

/* ---------- product options (colour / flavour / model ...) with photos ---------- */
.option-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 4px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; }
.option-chip:not(:has(img, .swatch-dot)) { padding-left: 12px; }
.option-chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.option-chip .swatch-dot { margin-left: 8px; }
.option-chip[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); color: var(--gold-ink); font-weight: 600; }
.option-chip.out { opacity: .45; text-decoration: line-through; }
.swatch-row:has(.option-chip) { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- checkout: currency and several accounts ---------- */
.currency-chips { justify-content: center; margin: 6px 0; }
.currency-chips .chip[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.account-box { display: grid; gap: 6px; justify-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.account-box:first-of-type { border-top: 0; }

/* ---------- themes: dark pages ---------- */
.theme-dark body, html.theme-dark { color-scheme: dark; }
.theme-dark .site-header, .theme-dark .tabbar { background: rgba(28,28,32,.94); }
.theme-dark img { opacity: .97; }

/* ---------- a shop's own page ---------- */
.shop-hero { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; align-items: start; padding: 0 0 16px; }
.shop-hero-cover { grid-column: 1 / -1; height: 120px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft)); }
.shop-hero.has-banner .shop-hero-cover { height: clamp(140px, 26vw, 280px); }
.shop-hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-hero .partner-logo { width: 96px; height: 96px; margin: -56px 0 0 20px; border: 4px solid var(--surface); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); object-fit: cover; }
.shop-hero .partner-info { align-self: start; }
@media (max-width: 640px) { .shop-hero { grid-template-columns: 1fr; } .shop-hero .partner-logo { margin: -48px auto 0; width: 84px; height: 84px; } .shop-hero .partner-info { text-align: center; } .shop-hero .actions-row { justify-content: center; } }
.shop-stats { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
@media (max-width: 640px) { .shop-stats { justify-content: center; } }
.verified-chip { color: var(--ok); font-weight: 600; }
.shop-tagline { color: var(--gold-ink); font-weight: 600; margin: 0; }
.shop-cats { margin: 8px 0; }
.shop-cats .chip[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
@media (min-width: 900px) { .grid.grid-large { grid-template-columns: repeat(3, 1fr); } }
/* home: shops on SBUY */
.shop-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 220px); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.shop-tile { display: grid; justify-items: center; gap: 4px; padding: 0 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; overflow: hidden; text-align: center; }
.shop-tile:hover { box-shadow: var(--shadow); }
.shop-tile-cover { width: calc(100% + 24px); height: 70px; background: linear-gradient(135deg, var(--tile-accent, var(--gold)), var(--gold-soft)); }
.shop-tile-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-tile-logo { width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; border: 3px solid var(--surface); background: var(--surface); object-fit: cover; display: grid; place-items: center; }

/* ---------- chat with a shop ---------- */
.chat-drawer .chat-body { display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chat-product { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.chat-product img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.chat-msg { display: grid; gap: 4px; max-width: 85%; }
.chat-msg.me { margin-left: auto; justify-items: end; }
.chat-msg.them { margin-right: auto; justify-items: start; }
.chat-bubble { padding: 9px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-msg.me .chat-bubble { background: var(--ink); color: #fff; border-color: var(--ink); }
.chat-time { font-size: 11px; color: var(--ink-3); }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; width: 100%; }
.chat-compose .chat-input { flex: 1; min-height: 44px; resize: vertical; }
.offer-card { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--gold-soft); border: 1px solid var(--gold); font-size: 14px; }
.offer-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.offer-card.off { opacity: .6; background: var(--surface); border-color: var(--line); }
.chat-fab { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); cursor: pointer; }
.chat-fab .count-badge { position: absolute; top: -2px; right: -2px; }
.chat-fab[hidden] { display: none; }
.pd-ask { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }


/* ---------- Seller Center: chats ---------- */
.chat-layout { display: grid; gap: 16px; grid-template-columns: minmax(240px, 340px) 1fr; align-items: start; }
@media (max-width: 860px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-list .notif.current { outline: 2px solid var(--gold); }
.chat-thread { display: grid; gap: 10px; }
.chat-thread .chat-body { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 10px; background: var(--bg); border-radius: var(--radius-sm); }
.count-badge.inline { position: static; margin-left: 6px; display: inline-grid; }
.chat-drawer .modal-foot { flex-direction: column; align-items: stretch; gap: 6px; }
.chat-drawer .modal-foot .link-btn { align-self: flex-start; }

/* ---------- theme picker ---------- */
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-card { display: grid; gap: 6px; padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: center; color: var(--ink); }
.theme-card[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.theme-swatch { display: grid; gap: 5px; padding: 10px; height: 70px; border-radius: 8px; background: var(--sw-bg); align-content: start; }
.sw-bar { height: 14px; border-radius: 4px; background: var(--sw-accent); }
.sw-line { height: 6px; border-radius: 3px; background: var(--sw-ink); opacity: .55; }
.sw-line.short { width: 60%; }

/* ---------- Seller Center: accounts and currencies ---------- */
.account-row { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.qr-thumb { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.rate-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.rate-row.off { opacity: .6; }
.rate-input { width: 120px; }

/* ---------- platform: categories ---------- */
.cat-edit.off { opacity: .65; }
.rot90 { transform: rotate(90deg); }

.seller-link.hide-mobile { display: none; }
@media (min-width: 768px) { .seller-link.hide-mobile { display: inline-flex; } }
@media (max-width: 767px) { .chat-fab { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); } }

/* ---------- "a new version is available" bar ---------- */
.update-bar { position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%); top: 12px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; }

/* ---------- footer: tidy groups (fold on phones) ---------- */
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.5fr repeat(4, 1fr); } }
.footer-group summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 6px 0; }
.footer-group summary::-webkit-details-marker { display: none; }
.footer-group summary strong { margin: 0; }
.footer-group[open] summary .icon { transform: rotate(180deg); }
.footer-links-list { display: grid; gap: 8px; padding: 4px 0 8px; }
@media (max-width: 767px) { .footer-group { border-bottom: 1px solid var(--line); } }
@media (min-width: 768px) { .footer-group summary { cursor: default; pointer-events: none; } .footer-group summary .icon { display: none; } }

/* ---------- catalogue: categories as a side menu on wide screens ---------- */
.cat-side { display: none; }
@media (min-width: 1024px) {
  .shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
  .cat-side { display: grid; gap: 2px; position: sticky; top: 96px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .cat-side .label { padding: 6px 10px; }
  .cat-side-link { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-size: 14px; }
  .cat-side-link:hover { background: var(--bg); color: var(--ink); }
  .cat-side-link[aria-current="page"] { background: var(--ink); color: #fff; font-weight: 600; }
  .cat-side-link[aria-current="page"] .muted { color: rgba(255,255,255,.75); }
  .shop-main [data-category-chips] { display: none; }
}

/* ---------- stock left under each option ---------- */
.option-text { display: grid; line-height: 1.2; text-align: left; }
.option-left { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.size-btn { display: inline-grid; justify-items: center; line-height: 1.15; }
.size-btn .option-left { font-size: 10px; }
.cat-tile.no-img { background: linear-gradient(135deg, var(--gold), var(--ink)); }
.shop-tile-logo.brand-mark { background: var(--tile-accent, var(--gold)); color: #fff; font-weight: 700; font-size: 22px; }


/* ---------- shop page: trust panel and reports ---------- */
.trust-panel { display: grid; gap: 14px; padding: 18px 20px; margin: 0 0 18px; }
.trust-held { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-weight: 600; }
.trust-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 32px; }
@media (max-width: 640px) { .trust-cols { grid-template-columns: 1fr; } }
.trust-title { font-size: 15px; margin: 0 0 8px; }
.trust-facts, .trust-checks { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.trust-facts li { display: flex; gap: 8px; align-items: flex-start; }
.trust-facts li .icon { color: var(--ink-3); margin-top: 2px; flex: none; }
.trust-facts .badge { margin-left: 6px; }
.trust-checks li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trust-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; flex: none;
  background: var(--surface-2); color: var(--ink-3); }
.trust-checks li.ok .trust-mark { background: var(--ok-soft); color: var(--ok); }
.trust-checks li.ok { color: var(--ink); }
.trust-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.trust-foot p { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--ink-2); flex: 1 1 260px; }
.trust-foot p .icon { color: var(--ok); flex: none; margin-top: 2px; }
.report-btn { color: var(--bad) !important; font-weight: 600; text-decoration: none; }
.report-btn:hover { text-decoration: underline; }
.radio-list { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.radio-list legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
/* checkout and chat warnings */
.acct-unchecked { color: var(--warn); font-size: 13px; font-weight: 600; }
.chat-warn { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; }
.chat-safety { font-size: 12px; text-align: center; color: var(--ink-3); margin: 0 0 8px; }
/* platform: trust checks on the shops page; Seller Center: account check status */
.trust-admin { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.trust-admin-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.trust-admin-accounts { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.link-badge { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.acct-ok { color: var(--ok); font-weight: 600; }
.acct-wait { color: var(--warn); font-weight: 600; }
.blocks-box { margin-top: 16px; }
.blocks-box summary { cursor: pointer; font-weight: 600; }
.blocks-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.trust-none { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.trust-none .icon { flex: none; margin-top: 2px; }

/* ---------- how a shop takes payment ---------- */
.pay-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.pay-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pay-badge.cod { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pay-badge.transfer { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pay-badge.deposit { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.cod-risk { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; }

/* ---------- shop badges ---------- */
.sbuy-verified { display: inline-flex; align-items: center; gap: 2px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  font-family: var(--font-sans, inherit); letter-spacing: .01em; vertical-align: middle; color: #6b4e12;
  background: linear-gradient(135deg, #f7e3a1, #e2b84f); border: 1px solid #d1a640; white-space: nowrap; }
.sbuy-verified.compact { font-size: 11px; padding: 1px 7px; }
.page-title .sbuy-verified { font-size: 14px; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.shop-chips span { padding: 3px 10px; border-radius: 6px; background: var(--info-soft); color: var(--info); font-size: 12px; font-weight: 600; }
/* ---------- product page: tabs, key attributes, details ---------- */
.pd-tabs { position: sticky; top: var(--header-h, 64px); z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: 0 0 12px;
  padding: 6px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.pd-tabs a { flex: none; padding: 8px 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.pd-tabs a[aria-current="true"] { background: var(--ink); color: var(--surface); }
.key-attrs { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.attr-grid { display: grid; grid-template-columns: minmax(110px, auto) 1fr; margin: 0; font-size: 14px; }
.attr-grid dt, .attr-grid dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.attr-grid dt { color: var(--ink-3); background: var(--surface-2); }
.key-attrs .attr-grid { grid-template-columns: repeat(2, minmax(0, auto) 1fr); }
@media (max-width: 640px) { .key-attrs .attr-grid { grid-template-columns: minmax(100px, auto) 1fr; } }
.pd-details-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); grid-auto-flow: dense; }
.pd-card { padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.pd-card h3 { font-size: 16px; margin: 0; }
.pd-card.wide { grid-column: 1 / -1; }
#pd-recommended .section, #pd-recommended > * { margin-top: 8px; }
/* ---------- share sheet ---------- */
.share-preview { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.share-preview img { width: 132px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 8px; }
.share-preview div { display: grid; gap: 4px; }
.share-apps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.share-app { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.share-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: var(--ink-3); }
.share-icon.whatsapp { background: #25d366; } .share-icon.messenger { background: #0084ff; } .share-icon.facebook { background: #1877f2; }
.share-icon.line { background: #06c755; } .share-icon.telegram { background: #229ed9; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Seller Center: key attributes and page sections ---------- */
.attr-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .attr-row { grid-template-columns: 1fr auto; } .attr-row input:nth-child(2) { grid-column: 1 / 2; } }
.custom-section { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.badge-note { display: grid; gap: 8px; }

/* ---------- shop-only mode ---------- */
.solo .main-nav, .solo .seller-link, .solo [data-announce] { display: none !important; }
/* ---------- Seller Center: the shop's link and QR ---------- */
.shop-link-card .shop-link-main { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
@media (max-width: 640px) { .shop-link-card .shop-link-main { grid-template-columns: 1fr; } }
.shop-link-card .copy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.shop-link { font-size: 16px; font-weight: 700; word-break: break-all; }
.shop-qr { margin: 0; display: grid; justify-items: center; gap: 6px; }
.shop-qr img { width: 140px; height: 140px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.form-grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.solo-check { align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gold-soft); }
/* dark backgrounds (the "dark" theme or a shop's own dark colour): the black button turns light, so its text turns dark */
.theme-dark .btn-primary { color: #1c1b19; }
.theme-dark .btn-primary:hover { background: var(--ink-2); }
.theme-dark .site-header { background: color-mix(in srgb, var(--bg) 92%, transparent); }

/* ---------- pre-order / made to order ---------- */
.badge-preorder { background: #ede7fb; color: #5b3fb0; }
.badge-preorder.big { font-size: 13px; padding: 4px 12px; justify-self: start; align-self: flex-start; width: fit-content; }
.theme-dark .announce:not(.announce-gold) { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); }
.copy-fallback { position: fixed; left: -9999px; top: 0; opacity: 0; }
.copy-manual { font-family: var(--mono, monospace); font-size: 14px; }

/* header: the menu shrinks and scrolls sideways, the search / cart buttons always stay on screen */
.site-header .brand, .header-actions { flex: none; }
.main-nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.main-nav::-webkit-scrollbar { display: none; }
/* "added to cart": a button in the message and a little bounce of the cart */
.toast { pointer-events: auto; }
.toast-action { margin-left: 10px; border: 0; border-radius: 999px; padding: 4px 12px; background: rgba(255,255,255,.18); color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.toast-action:hover { background: rgba(255,255,255,.3); }
@keyframes cart-bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25); } }
.bump { animation: cart-bump .45s ease; }
.theme-dark .toast:not(.error) { color: #1c1b19; }
.theme-dark .toast-action { background: rgba(0,0,0,.12); }

/* the menu fits by itself (shop.js fitNav): no sideways scroll; what doesn't fit is under "More" */
.main-nav { overflow: visible; }
.nav-more { position: relative; flex: none; }
.nav-more summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover, .nav-more[open] summary { color: var(--ink); background: var(--surface-2); }
.nav-more-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; display: grid; min-width: 220px; max-height: 70vh; overflow-y: auto;
  padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg); }
.nav-more-list a { display: block; padding: 9px 12px; border-radius: 8px; }

/* safety rules for every screen: media and tables never wider than the screen; long words, links, codes and
   addresses wrap instead of pushing the page sideways */
img, video, iframe, svg { max-width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.product-name, .pd-title, .page-title, .shop-link, .copy-row .mono, .kv dd, .chat-bubble, .account-box, .pre { overflow-wrap: anywhere; }
.container, main, .pd-info, .detail-grid, .form-grid > *, .card { min-width: 0; }
/* small phones (≤ 400 px): a smaller logo and buttons so search, orders and cart always fit beside it */
@media (max-width: 400px) {
  .site-header .container { gap: 8px; }
  .brand { gap: 6px; min-width: 0; }
  .brand-name { font-size: 16px; letter-spacing: .06em; }
  .brand-logo { height: 32px; max-width: 96px; }
  .brand .brand-sub { display: none; }
  .header-actions .icon-btn { width: 36px; height: 36px; }
  .brand-mark { width: 32px; height: 32px; }
}
/* lists of controls wrap onto a second line instead of running off the screen */
.toolbar-end { flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.toolbar .select { max-width: 100%; min-width: 0; }
.help-nav { flex-wrap: wrap; }
.product-tags { max-width: calc(100% - 12px); flex-wrap: wrap; }
.product-tags .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-details-grid > *, .pd-card, .pd-card .size-guide { min-width: 0; }
.toolbar > * { max-width: 100%; min-width: 0; }
.product-shop { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-width: 0; }
.product-shop .sbuy-verified { max-width: 100%; }
/* touch screens: text boxes use 16 px text, otherwise iPhones zoom the whole page in when you tap to type
   (the page then looks cut off at the edges) */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea { font-size: 16px; }
}
/* search on phones: the box and the close button always share one line inside the screen */
#search-dialog .modal-head { gap: 8px; padding: 12px 12px 10px 16px; }
#search-dialog .modal-head .input { flex: 1 1 auto; min-width: 0; }
#search-dialog .modal-head .icon-btn { flex: none; }
@media (max-width: 640px) { #search-dialog { width: 100%; max-width: 100%; margin: 0 auto auto; border-radius: 0 0 20px 20px; } }
/* phones: search is a full-screen page whose height follows the keyboard (shop.js fitSearch) */
@media (max-width: 640px) {
  #search-dialog { position: fixed; inset: 0 auto auto 0; margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  #search-dialog .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}
/* a pop-up window is open (common.js): the page behind can't move, and scrolling inside a list never carries on
   to the page when it reaches the end */
html.scroll-locked, html.scroll-locked body { overflow: hidden; }
html.scroll-locked body { position: fixed; left: 0; right: 0; width: 100%; }
dialog, dialog .modal-body, .nav-more-list, .chat-body { overscroll-behavior: contain; }

/* ---- getting-started guide (Seller Center home) ---- */
.start-guide { border: 2px solid var(--accent, var(--ink)); }
.start-guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.start-guide-head h2 { margin: 0; }
.start-guide-bar { width: 100%; height: 8px; margin: 12px 0 4px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); appearance: none; -webkit-appearance: none; }
.start-guide-bar::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.start-guide-bar::-webkit-progress-value { background: var(--ok); border-radius: 99px; }
.start-guide-bar::-moz-progress-bar { background: var(--ok); border-radius: 99px; }
.start-guide-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.start-guide-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.start-guide-steps li p { margin: 2px 0 0; }
.start-guide-steps li strong { overflow-wrap: anywhere; }
.start-guide-steps li.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); padding-block: 6px; }
.start-guide-steps li.next { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.start-guide-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; background: var(--line); }
.start-guide-steps li.done .start-guide-num { background: var(--ok); color: #fff; }
.start-guide-steps li.next .start-guide-num { background: var(--ink); color: var(--surface); }
@media (max-width: 400px) {
  .start-guide-steps li { grid-template-columns: 28px minmax(0, 1fr); }
  .start-guide-steps li > .btn { grid-column: 2; justify-self: start; }
}

/* ---- About page: parts built from live data, and a shop's own About ---- */
.about-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 18px 0; }
.about-stat { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
.about-stat strong { font-size: 1.5rem; line-height: 1.1; }
.about-stat span { font-size: 0.85rem; color: var(--muted); }
.about-auto { margin-top: 26px; }
.about-h { font-size: 1.15rem; margin: 0 0 10px; }
.about-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.about-list li { display: flex; gap: 8px; align-items: center; }
.about-shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; margin-bottom: 10px; }
.about-shop { display: flex; gap: 12px; align-items: center; padding: 12px; color: inherit; text-decoration: none; min-width: 0; }
.about-shop:hover { border-color: var(--ink); }
.about-shop-logo { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 700; }
.about-shop-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.about-shop-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.about-shop-head .about-shop-logo { width: 64px; height: 64px; }
.about-shop-head p { margin: 0; }
.about-shop-name { font-size: 1.3rem; overflow-wrap: anywhere; }
.about-sell { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---- shop link card (Seller Center): wears the shop's cover, logo and colour ---- */
.slc { --slc: var(--gold); padding: 0; overflow: hidden; border: 0; box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .45); }
.slc-cover { position: relative; min-height: 120px; display: flex; align-items: flex-end; padding: 18px;
  background: linear-gradient(135deg, var(--slc), color-mix(in srgb, var(--slc) 55%, #101012)); color: #fff; isolation: isolate; }
.slc-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: saturate(1.1); }
.slc-cover.has-photo::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05) 0%, color-mix(in srgb, var(--slc) 70%, rgba(0, 0, 0, .55)) 100%); }
.slc-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.slc-logo { width: 58px; height: 58px; flex: none; border-radius: 50%; object-fit: cover; background: #fff; border: 3px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); display: grid; place-items: center; font-size: 1.4rem; }
.slc-name { display: grid; min-width: 0; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.slc-name strong { font-size: 1.25rem; line-height: 1.25; overflow-wrap: anywhere; }
.slc-name span { font-size: .85rem; opacity: .92; }
.slc-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 18px; align-items: start;
  background: linear-gradient(180deg, color-mix(in srgb, var(--slc) 7%, var(--surface)), var(--surface)); }
.slc-main { display: grid; gap: 10px; min-width: 0; }
.slc-main .label { margin: 0; }
.slc-link { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 6px 6px 6px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--slc) 35%, var(--line)); background: var(--surface); color: var(--ink); font: inherit; text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .1s; }
.slc-link:hover { border-color: var(--slc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--slc) 14%, transparent); }
.slc-link:active { transform: scale(.99); }
.slc-link .mono { flex: 1; min-width: 0; font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slc-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--slc); color: #fff; font-weight: 600; font-size: .9rem; }
.slc-shares { display: flex; flex-wrap: wrap; gap: 8px; }
.slc-share { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-size: .88rem; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s; }
.slc-share:hover { border-color: var(--slc); background: color-mix(in srgb, var(--slc) 8%, var(--surface)); }
.slc-qr { margin: 0; display: grid; justify-items: center; gap: 8px; }
.slc-qr img { width: 150px; height: 150px; background: #fff; padding: 8px; border-radius: 18px; box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .35);
  border: 1px solid color-mix(in srgb, var(--slc) 25%, var(--line)); }
.slc-qr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) {
  .slc-body { grid-template-columns: 1fr; }
  .slc-qr { justify-self: center; }
}
@media (max-width: 400px) { .slc-share span { display: none; } .slc-share { padding: 8px; } }
@media (prefers-reduced-motion: reduce) { .slc-link { transition: none; } }

/* ---- automatic look: cover slideshow, festival header, written messages ---- */
.shop-hero-cover.showcase { position: relative; }
.shop-hero-cover.showcase .showcase-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transform: scale(1.04); transition: opacity 1.2s ease, transform 6s ease-out; }
.shop-hero-cover.showcase .showcase-img.on { opacity: 1; transform: scale(1); }
/* festival days: the header gets a thin band in the festival colour and the greeting stands out in the bar */
html[data-festival] .site-header { box-shadow: inset 0 3px 0 var(--gold); }
html[data-festival] .announce { background: linear-gradient(90deg, var(--gold-ink), var(--gold), var(--gold-ink)); color: #fff; }
.announce .announce-festival { font-weight: 600; letter-spacing: .01em; }
@media (prefers-reduced-motion: reduce) { .shop-hero-cover.showcase .showcase-img { transition: none; transform: none; } }
/* the header (and phone tab bar) take the page's own colours, so every theme — chosen, from a photo, dark or
   festival — reaches the top of the page too: frosted glass over the page colour with a hint of the accent */
.site-header, .tabbar { background: color-mix(in srgb, color-mix(in srgb, var(--bg) 94%, var(--gold)) 88%, transparent); }
.site-header { border-bottom-color: color-mix(in srgb, var(--line) 80%, var(--gold)); }

/* ---- settings: automatic look and festival calendar ---- */
.auto-look { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 6%, var(--surface)); border: 1px solid var(--line); }
.auto-look h3 { margin: 0; font-size: 1.05rem; }
.auto-look > p { margin: 0; }
.auto-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.auto-switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.auto-switch > span { display: grid; gap: 2px; min-width: 0; }
.auto-switch input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 99px; background: var(--line);
  position: relative; cursor: pointer; transition: background .2s; }
.auto-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.auto-switch input:checked { background: var(--ok); }
.auto-switch input:checked::after { transform: translateX(18px); }
.auto-switch input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fest-list { display: grid; gap: 8px; }
.fest-row { display: grid; grid-template-columns: auto minmax(110px, 1fr) 76px 76px 44px minmax(160px, 2fr) auto; gap: 8px; align-items: center; padding: 10px; }
.fest-row .fest-date { text-align: center; }
@media (max-width: 900px) {
  .fest-row { grid-template-columns: auto 1fr 1fr auto; }
  .fest-row > input:nth-of-type(1) { grid-column: 2 / -1; }
  .fest-row .fest-greet { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .auto-switch input, .auto-switch input::after { transition: none; } }
.slc-logo.brand-mark { background: linear-gradient(135deg, color-mix(in srgb, var(--slc) 80%, #fff), color-mix(in srgb, var(--slc) 70%, #000)); color: #fff; font-family: var(--font-display); }
@media (max-width: 400px) {
  .slc-link { flex-wrap: wrap; border-radius: 18px; padding: 10px; }
  .slc-link .mono { white-space: normal; overflow-wrap: anywhere; flex-basis: 100%; }
  .slc-copy { margin-left: auto; }
}

/* ---- admin tables: pictures never squeezed; cards when the space is narrow ---- */
.table img, .table .thumb { max-width: none; flex: none; }
.table .cell-thumb { width: 1%; }
.table .thumb { width: 52px; height: 64px; }
.table .cell-name { min-width: 180px; }
.table .cell-title { font-weight: 600; line-height: 1.35; }
.table .cell-actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; font-size: 20px; line-height: 1; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; padding: 6px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .3); }
.row-menu-list button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; background: none; border-radius: 6px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.row-menu-list button:hover { background: var(--surface-2); }
.table-wrap { container-type: inline-size; }
@container (max-width: 680px) {
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .table td { display: block; padding: 0; border: 0; min-width: 0; width: auto; }
  .table td[data-label]:not(.cell-thumb):not(.cell-name):not(.cell-actions)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); }
  .table td.cell-thumb { grid-row: span 4; }
  .table td:not(.cell-thumb) { grid-column: 2; }
  .table td.cell-actions { white-space: normal; }
  .table .row-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 6px; }
  .table .cell-name { min-width: 0; }
  .table td.num { text-align: left; }
}
@container (max-width: 680px) {
  .table tbody tr { grid-template-columns: auto repeat(2, minmax(0, 1fr)); align-items: start; }
  .table td.cell-thumb { grid-column: 1; grid-row: 1 / span 3; }
  .table td:not(.cell-thumb) { grid-column: auto; }
  .table td.cell-name, .table td.cell-actions { grid-column: 2 / -1; }
  .table .row-actions { flex-wrap: nowrap; }
}
@container (max-width: 360px) {
  .table tbody tr { grid-template-columns: auto minmax(0, 1fr); }
  .table td.cell-name, .table td.cell-actions, .table td:not(.cell-thumb) { grid-column: 2; }
}
.row-actions > * { flex: none; }
.row-actions .icon-btn { width: 36px; height: 36px; }
.row-menu-list { position: fixed; right: auto; top: 0; left: 0; }

/* ---- chat inbox: filters, search, waiting time, quick replies ---- */
.chat-tools { display: grid; gap: 8px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.chat-filters { flex-wrap: wrap; }
.chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 11px; font-weight: 700; }
.chip[aria-pressed="true"] .chip-count { background: rgba(255, 255, 255, .22); color: inherit; }
.wait-tag { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.wait-tag.late { color: #fff; background: var(--danger, #b23a3a); }
.notif.done { opacity: .7; }
.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.quick-replies .chip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ghost { background: transparent; border-style: dashed; }
.qr-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2.4fr) auto; gap: 8px; align-items: start; }
@media (max-width: 560px) { .qr-row { grid-template-columns: 1fr auto; } .qr-row textarea { grid-column: 1 / -1; grid-row: 2; } }
.chip.chip-alert .chip-count { background: var(--danger, #b23a3a); color: #fff; }
.date-range { gap: 6px; align-items: center; }
.date-range .input { width: auto; }

/* ---- chat assistant: its messages, the team's suggestion card; membership plans ---- */
.bot-tag { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.chat-msg.bot .chat-bubble { background: var(--gold-soft, #f3ecdc); color: var(--ink); }
.assist-box:empty { display: none; }
.assist-card { display: grid; gap: 6px; margin: 8px 0; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px dashed color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
.assist-card.handoff { border-color: var(--danger, #b23a3a); }
.assist-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.assist-head .btn { margin-left: auto; }
.assist-card p { margin: 0; }
.assist-read { color: var(--ink); font-weight: 600; }
.assist-draft { display: grid; gap: 6px; }
.assist-draft .chat-bubble { background: var(--surface); border: 1px solid var(--line); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.plan-card { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plan-card.current { border: 2px solid var(--gold); }
.plan-name { font-weight: 700; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plan-price { font-size: 1.2rem; font-weight: 700; color: var(--gold-ink, var(--ink)); }
.plan-card ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.steps-list li { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.steps-list li.ok { color: var(--ok); background: var(--ok-soft); }

/* ---- costs, price calculator, teaching the assistant ---- */
.calc-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.calc-result > div { display: grid; gap: 2px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.calc-result strong { font-size: 1.05rem; }
.quota-input { width: 90px; margin-top: 4px; }
.gap-list { padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.gap-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gap-row:last-child { border-bottom: 0; }

/* ---- membership ---- */
.plan-price small { font-size: .8rem; font-weight: 500; color: var(--ink-3); }
.usage { display: grid; gap: 6px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.usage-head { display: flex; justify-content: space-between; gap: 8px; }
.usage p { margin: 0; }
.usage-bar { width: 100%; height: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); appearance: none; -webkit-appearance: none; }
.usage-bar::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.usage-bar::-webkit-progress-value { background: var(--ok); border-radius: 99px; }
.usage-bar::-moz-progress-bar { background: var(--ok); border-radius: 99px; }
.usage-bar.high::-webkit-progress-value { background: var(--danger, #b23a3a); }
.usage-bar.high::-moz-progress-bar { background: var(--danger, #b23a3a); }
.pay-box { display: grid; gap: 6px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.pay-box p { margin: 0; overflow-wrap: anywhere; }
.pay-qr { width: 180px; max-width: 100%; border-radius: var(--radius-sm); background: #fff; }

/* ---- membership: terms, usage history, receipt ---- */
.terms-body { max-height: 55vh; overflow: auto; font-size: .92rem; line-height: 1.6; }
.usage-chart { margin-top: 10px; }
.usage-bars { display: flex; gap: 4px; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.usage-col { flex: 1 0 34px; display: grid; grid-template-rows: auto 90px auto; gap: 2px; justify-items: center; font-size: 11px; }
.usage-col-track { width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.usage-col-bar { display: block; width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--gold); }
.usage-col-label { color: var(--ink-3); white-space: nowrap; }
.receipt-sheet { display: none; }
@media print {
  body.printing-receipt > *:not(.receipt-sheet) { display: none !important; }
  body.printing-receipt .receipt-sheet { display: grid; gap: 14px; color: #000; font-size: 11pt; padding: 10mm; }
  .receipt-sheet header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #000; padding-bottom: 8px; }
  .receipt-sheet h1 { margin: 0; font-size: 18pt; }
  .receipt-sheet p { margin: 2px 0; }
  .receipt-title { text-align: right; }
  .receipt-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid #999; }
}
