/* 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; }
/* the menu is longer than most screens: it scrolls on its own, the brand and the account stay in view */
.sidebar { overflow: hidden; }
.sidebar [data-side-nav] { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.sidebar .grow { display: none; }
.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-top-row h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-top-row .row { flex: none; flex-wrap: nowrap; }
@media (max-width: 959px) { .admin-top-row h1 { font-size: 20px; } }
.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); }
.notice.error { background: var(--bad-soft); color: var(--bad); }

@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-strip { padding: 0; gap: 0; overflow: hidden; }
.trust-strip .trust-held { margin: 12px 12px 0; }
.trust-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; width: 100%;
  padding: 14px 18px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.trust-open:hover .trust-more, .trust-open:focus-visible .trust-more { text-decoration: underline; }
.trust-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.trust-summary > .trust-mark { background: var(--ok-soft); color: var(--ok); }
.trust-summary .pay-badge { font-size: 12px; padding: 2px 10px; }
.trust-more { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.trust-sheet { padding: 0; margin: 0; }
.trust-sheet .trust-cols { grid-template-columns: 1fr; }
.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 .mono { display: block; min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; } }
@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; }
}

/* ------------------------------------------------------------ help desk (Ask SBUY) */
.hd { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.hd-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.hd-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; line-height: 1; background: var(--ink-2); color: #fff; }
.hd-avatar.ai { background: linear-gradient(135deg, var(--gold), var(--gold-ink)); }
.hd-avatar.team { background: var(--info); }
.hd-avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.hd-title { display: grid; line-height: 1.35; min-width: 0; }
.hd-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-title span { font-size: 12px; color: var(--ink-3); }
.hd-pill { margin-left: auto; flex: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.hd-pill.ai { background: var(--gold-soft); color: var(--gold-ink); }
.hd-pill.team { background: var(--info-soft); color: var(--info); }
.hd-pill.done { background: var(--ok-soft); color: var(--ok); }
.hd-pill.late { background: var(--bad-soft); color: var(--bad); }
.hd-thread { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--bg); min-height: 240px; max-height: min(62vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.hd-row { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.hd-row.me { margin-left: auto; }
.hd-col { display: grid; gap: 3px; min-width: 0; }
.hd-row.me .hd-col { justify-items: end; }
.hd-name { font-size: 11px; color: var(--ink-3); padding: 0 4px; }
.hd-bubble { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-row.ai .hd-bubble { background: var(--gold-soft); border-color: transparent; }
.hd-row.team .hd-bubble { background: var(--info-soft); border-color: transparent; }
.hd-row.me .hd-bubble { background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 18px 18px 6px 18px; }
.hd-typing { display: inline-flex; gap: 4px; align-items: center; padding: 14px 16px; }
.hd-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-ink); opacity: .35; animation: hd-dot 1.2s infinite ease-in-out; }
.hd-typing span:nth-child(2) { animation-delay: .15s; }
.hd-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hd-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .hd-typing span { animation: none; opacity: .7; } }
.hd-feedback { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-left: 36px; font-size: 13px; color: var(--ink-2); }
.hd-note { margin: 0; text-align: center; font-size: 12px; color: var(--ink-3); }
.hd-compose { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.hd-compose .textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; padding-top: 10px; padding-bottom: 10px; line-height: 1.5; border-radius: 22px; }
.hd-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.hd-send:disabled { opacity: .6; }
.hd-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px 0; background: var(--surface); border-top: 1px solid var(--line); }
.hd-tools + .hd-compose { border-top: 0; }
.hd-draft { margin: 0; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--gold-ink); font-size: 12px; }
.hd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; color: var(--ink); text-align: left; }
.hd-chip:hover { border-color: var(--gold); }
.hd-chip[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); font-weight: 600; }
.hd-start { padding: 18px 16px; display: grid; gap: 16px; background: var(--surface); }
.hd-start h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.hd-hint { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--ink-3); background: var(--surface); border-top: 1px solid var(--line); }
.hd-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--surface); font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.hd-list { display: grid; gap: 2px; }
.hd-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hd-item:hover { background: var(--surface-2); }
.hd-item.current { background: var(--gold-soft); }
.hd-item .hd-title strong { font-size: 14px; }
.hd-item .hd-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-item.unread .hd-title strong::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-left: 6px; vertical-align: middle; }
.hd-meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.hd-meta .hd-pill { margin: 0; font-size: 11px; padding: 2px 8px; }
.hd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.hd-stat { padding: 14px 16px; }
.hd-stat strong { display: block; font-size: 22px; line-height: 1.2; }
.hd-stat span { font-size: 12px; color: var(--ink-3); }
.hd-empty { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 300px; color: var(--ink-3); text-align: center; padding: 24px; }
.hd-empty .icon { width: 36px; height: 36px; }
.hd-side { padding: 12px; display: grid; gap: 10px; align-content: start; }
.hd-side .chips { flex-wrap: wrap; overflow: visible; }
.hd-tools .select { width: auto; flex: 0 1 auto; min-width: 0; }
@media (max-width: 767px) {
  .hd-thread { max-height: 58vh; padding: 12px; }
  .hd-row { max-width: 94%; }
  .hd-head { padding: 12px; }
}

/* ------------------------------------------------------------ health: update centre */
.hc-hero { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 20px; }
.hc-score { flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; text-align: center; line-height: 1.1;
  background: conic-gradient(var(--hc-color, var(--ok)) calc(var(--hc, 100) * 1%), var(--surface-2) 0); }
.hc-score > div { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; }
.hc-score strong { font-size: 24px; }
.hc-score span { font-size: 11px; color: var(--ink-3); }
.hc-hero-text { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.hc-hero-text h2 { margin: 0; font-size: 18px; }
.hc-hero-text p { margin: 0; }
.hc-list { display: grid; gap: 10px; }
.hc-item { padding: 0; overflow: hidden; }
.hc-item > summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; }
.hc-item > summary::-webkit-details-marker { display: none; }
.hc-item > summary .muted { display: block; }
.hc-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); }
.hc-dot.warn { background: #d99a1e; }
.hc-dot.bad { background: var(--bad); }
.hc-body { display: grid; gap: 12px; padding: 0 16px 16px 40px; }
.hc-body ul { margin: 0; padding-left: 18px; }
.hc-body p { margin: 0; }
.hc-actions { display: grid; gap: 8px; }
.hc-action { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.hc-action .small { flex: 1; min-width: 180px; }
.hc-kind { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
.hc-kind.auto { background: var(--ok-soft); color: var(--ok); }
.hc-kind.draft { background: var(--gold-soft); color: var(--gold-ink); }
.hc-kind.manual { background: var(--info-soft); color: var(--info); }
.hc-history { display: grid; }
.hc-history > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hc-history > div:last-child { border-bottom: 0; }
.hc-section-title { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
@media (max-width: 767px) { .hc-body { padding-left: 16px; } }

/* ------------------------------------------------------------ shop finance */
.fin-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fin-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.fin-bar > span.ok { background: var(--ok); }
.fin-bar > span.loss { background: var(--bad); }
.fin-bar > span.rev { background: var(--ink-3); }
.fin-trend { display: grid; gap: 10px; }
.fin-trend-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.fin-trend-row > div { display: grid; gap: 4px; }
.fin-trend-row > span:last-child { text-align: right; line-height: 1.3; min-width: 92px; }
.fin-cost-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fin-cost-row > span { grid-column: 1 / -1; }
.fin-intro { max-width: 640px; }
.fin-notes { display: grid; gap: 0; border-top: 1px solid var(--line); }
.fin-note { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fin-note p { margin: 4px 0 0; }

/* ------------------------------------------------------------ month picker (Lao) */
.mp { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
.field .mp { display: flex; width: 100%; }
.mp-step { flex: none; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer; }
.mp-step:hover, .mp-toggle:hover { background: var(--surface-2); }
.mp-toggle { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 132px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mp-toggle[aria-expanded="true"] { background: var(--gold-soft); color: var(--gold-ink); }
.mp-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 272px; max-width: calc(100vw - 32px); padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.mp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mp-year strong { font-size: 16px; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-grid button { padding: 10px 4px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.mp-grid button:hover { border-color: var(--gold); }
.mp-grid button.now { border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.mp-grid button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.mp-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; }

.mp-yearbtn { border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 700; font-size: 16px; padding: 4px 10px; cursor: pointer; color: var(--ink); }
.mp-yearbtn:hover { background: var(--surface-2); }
.mp-grid button small { display: block; font-size: 10px; color: var(--ink-3); }
.mp-grid button[aria-pressed="true"] small { color: rgba(255,255,255,.75); }

/* ------------------------------------------------------------ shop calendar & diary */
.cal-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-be { color: var(--ink-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.cal-head.off, .cal-cell.off .cal-num, .off-text { color: var(--bad); }
.cal-cell { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 58px; padding: 6px 2px; border: 1px solid transparent;
  border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; }
.cal-cell:hover { border-color: var(--gold); }
.cal-cell.out { opacity: .45; }
.cal-cell.today { border-color: var(--gold); background: var(--gold-soft); }
.cal-cell[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cal-num { font-size: 16px; font-weight: 700; line-height: 1.2; }
.cal-mark { position: absolute; top: 3px; right: 5px; font-size: 11px; color: var(--gold-ink); }
.cal-dots { display: flex; gap: 3px; min-height: 6px; }
.cal-dots i, .cal-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
i.ev { background: var(--gold); } i.pay { background: var(--ok); } i.di { background: var(--info); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 4px; }
.cal-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.cal-list b { display: inline-block; min-width: 24px; }
.cal-day h2 { font-size: 17px; margin: 0; }
.cal-sub { margin: 8px 0 0; font-size: 14px; }
.cal-special { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 14px; }
.cal-special.buddhist, .cal-special.lunar { background: var(--gold-soft); color: var(--gold-ink); }
.cal-special.boun { background: var(--info-soft); color: var(--info); }
.cal-pay { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-size: 14px; }
.cal-event { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cal-event.done strong { text-decoration: line-through; color: var(--ink-3); }
.cal-diary { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cal-diary p { margin: 4px 0; }
@media (max-width: 767px) { .cal-cell { min-height: 48px; } .cal-num { font-size: 14px; } }
.fin-budget { display: grid; gap: 6px; padding: 6px 0; }
.fin-budget .actions-row { justify-content: space-between; }

/* ------------------------------------------------------------ steady scrolling on phones */
/* The announcement keeps one line and one height: a longer message used to wrap and push the whole page down. */
.announce { height: 34px; min-height: 34px; overflow: hidden; }
.announce > * { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.announce-in { animation: announce-fade .45s ease; }
@keyframes announce-fade { from { opacity: 0; } }
/* A blurred see-through bar is redrawn on every scrolled frame: phones get a solid one. */
@media (hover: none), (max-width: 767px) {
  .site-header, .tabbar, .admin-top { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header { background: var(--bg); }
  .tabbar { background: var(--surface); }
}
html.lite *, html.lite *::before, html.lite *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ------------------------------------------------------------ phones (2026-11): solid bars, safe areas, sheets */
/* Bars are solid in every theme: nothing shows through them. The header also covers the phone's status bar. */
.site-header { padding-top: env(safe-area-inset-top); background: var(--bg); }
.tabbar { background: var(--surface); }
.theme-dark .site-header { background: var(--bg); }
.theme-dark .tabbar { background: var(--surface); }
.pd-tabs { top: calc(var(--header-h, 64px) + env(safe-area-inset-top)); }
.edit-banner { top: calc(var(--header-h) + env(safe-area-inset-top)); }
/* A sheet sits on the bottom of what the person sees (above Safari's floating bar), never under it. */
@media (max-width: 639px) {
  .modal { position: fixed; inset: auto 0 0 0; margin: 0; max-height: calc(100dvh - env(safe-area-inset-top) - 16px);
    padding-bottom: env(safe-area-inset-bottom); }
  .modal .modal-foot { padding-bottom: 16px; }
}

/* Colours that follow the theme: soft status colours have dark versions, badges keep their contrast. */
.theme-dark { --ok: #74d29d; --ok-soft: #1e3a2b; --warn: #e8b85a; --warn-soft: #3a2f16; --bad: #f2928a; --bad-soft: #3e2020;
  --info: #93b8f5; --info-soft: #1f2c42; }
.badge-new { background: var(--ink); color: var(--bg); }
.shop-chips span { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
body { line-height: 1.65; }   /* Lao vowels above and below the line need the room */

/* A shop's header: logo, name with its badge, one line of facts, chips, then the buttons in one row. */
.shop-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-round .icon { flex: none; }
@media (max-width: 640px) {
  .shop-hero .partner-info { display: grid; justify-items: center; gap: 6px; }
  .shop-name { justify-content: center; font-size: 26px; }
  .shop-hero .shop-stats, .shop-hero .shop-chips { justify-content: center; }
  .shop-actions { justify-content: center; }
  .shop-hero .partner-info > * { max-width: 100%; min-width: 0; }
  .shop-about { text-align: center; width: 100%; overflow-wrap: anywhere; }
  .hide-phone { display: none; }
  .btn-round { width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; }
  .trust-open { flex-direction: column; align-items: stretch; gap: 6px; }
  .trust-more { align-self: flex-end; }
}
/* the shop's categories stay in reach while scrolling its products */
[data-partner-count] { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 6; background: var(--bg);
  margin: 0; padding: 8px 0; }
[data-partner-count] .shop-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
[data-partner-count] .shop-cats::-webkit-scrollbar { display: none; }
[data-partner-count] .chip { flex: none; }

/* ------------------------------------------------------------ reading text that follows the person's settings */
/* iPhone/iPad: the system text size (Dynamic Type) sets the root size; Android Chrome: the system font size (meta
   text-scale); computers: the browser's default size. Layout sizes stay in px; reading text uses the root size. */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
.pd-desc, .spec-list, .pd-card p, .attr-grid, .size-table, .review-item p, .review-text, .help-body p {
  font-size: calc(max(16px, 1rem) * var(--read-scale, 1)); line-height: 1.75; }
.pd-desc { color: var(--ink-2); }
.text-size-btn span { font-weight: 700; letter-spacing: -.02em; }

/* ------------------------------------------------------------ size tables: a real table on every screen */
.size-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.size-table { width: 100%; border-collapse: collapse; }
.size-table th, .size-table td { padding: 10px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.size-table thead th { background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: normal; min-width: 72px; }
.size-table tbody tr:last-child > * { border-bottom: 0; }
.size-table th[scope="row"], .size-table thead th:first-child { position: sticky; left: 0; background: var(--surface); font-weight: 700; color: var(--ink);
  box-shadow: 1px 0 0 var(--line); }
.size-table thead th:first-child { background: var(--surface-2); z-index: 1; }

/* ------------------------------------------------------------ the verified mark: calm, still easy to find */
.sbuy-verified { background: transparent; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold-ink);
  box-shadow: none; font-size: 12px; font-weight: 600; padding: 1px 8px; gap: 3px; text-shadow: none; }
.sbuy-verified::before { content: none; }
.page-title .sbuy-verified, .shop-name .sbuy-verified { font-size: 12px; font-family: var(--font); letter-spacing: 0; }
.vtick { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--gold); color: var(--bg);
  font-size: 10px; font-weight: 800; line-height: 1; vertical-align: 1px; margin-left: 2px; flex: none; }
.sold-by-text { display: grid; gap: 2px; min-width: 0; }
.sold-by-text .shop-chips { margin: 4px 0 0; }

/* ------------------------------------------------------------ the product's section bar: full width, solid */
.pd-tabs { background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: none; border-radius: 0; }
@media (max-width: 899px) { .pd-tabs { margin-left: -16px; margin-right: -16px; padding: 6px 16px; } }

/* ------------------------------------------------------------ dialogs on small screens: in the middle, clear of every bar */
/* Bottom sheets went under Safari's and Chrome's bottom bars; a centred card stays clear on any phone and any OS. */
@media (max-width: 639px) {
  .modal { position: fixed; inset: 0; margin: auto; width: calc(100vw - 24px); max-width: calc(100vw - 24px);
    max-height: min(82dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px));
    border-radius: 20px; padding-bottom: 0; }
  .modal[open] { animation: pop .2s ease-out; }
}
.size-edit th, .size-edit td { padding: 4px; }
.size-edit .size-cell { min-width: 84px; padding: 6px 8px; text-align: center; }
.size-edit .size-cell.head { font-weight: 600; }
.size-edit th { position: static; box-shadow: none; }
.size-edit th .icon-btn { margin-top: 2px; }

/* ------------------------------------------------------------ the reading size picker (Aa) and what it scales */
.ts-wrap { position: relative; }
.ts-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 220px; padding: 8px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); display: grid; gap: 2px; }
.ts-menu[hidden] { display: none; }
.ts-title { margin: 2px 8px 6px; font-size: 12px; color: var(--ink-3); }
.ts-menu button { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0;
  border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ts-menu button:hover { background: var(--surface-2); }
.ts-menu button[aria-checked="true"] { background: var(--gold-soft); color: var(--gold-ink); font-weight: 600; }
.ts-menu small { color: var(--ink-3); font-size: 12px; }
.ts-sample { font-weight: 700; text-align: center; line-height: 1; }
.ts-menu .ts-done { display: block; text-align: center; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--ink-2); }
/* everything people read on a product page grows with it, not only the description */
.pd-title { font-size: calc(clamp(24px, 3vw, 32px) * var(--read-scale, 1)); }
.price-block.big .price { font-size: calc(24px * var(--read-scale, 1)); }
.promo-list, .assurance, .attr-grid { font-size: calc(14px * var(--read-scale, 1)); }
.pd-card h3 { font-size: calc(16px * var(--read-scale, 1)); }
.sold-by-text strong { font-size: calc(15px * var(--read-scale, 1)); }
.size-table thead th { font-size: calc(13px * var(--read-scale, 1)); }

/* ------------------------------------------------------------ readability (found by the phone-check audit) */
/* grey text and gold buttons meet WCAG AA (4.5:1); nothing people read is under 12px; small links are easier to tap */
:root:not(.theme-dark) { --ink-3: #6b665e; }
.btn-gold { background: var(--gold-ink); color: #fff; }
.btn-gold:hover { background: color-mix(in srgb, var(--gold-ink) 85%, #000); }
.option-left, .size-btn .option-left { font-size: 12px; }
.tabbar a, .tabbar button { font-size: 12px; }
@media (pointer: coarse) {
  .link-btn, .product-cat, .crumbs a, .more-link { display: inline-flex; align-items: center; min-height: 32px; }
}


/* ------------------------------------------------------------ dialogs: content never squeezed, calm close, keyboard-aware */
/* Safari shrank a "flex: 1" body to nothing inside a fit-content dialog; an auto basis keeps the form visible. */
.modal-body { flex: 1 1 auto; min-height: 0; }
dialog:focus { outline: none; }
.modal-head .icon-btn { width: 40px; height: 40px; flex: none; background: var(--surface-2); color: var(--ink-2); }
.modal-head .icon-btn:hover { background: var(--line); color: var(--ink); }
@media (max-width: 639px) {
  /* stays in the part of the screen the keyboard leaves free (common.js sets --vv-*) */
  .modal { top: var(--vv-top, 0px); bottom: var(--vv-bottom, 0px);
    max-height: min(82dvh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px), calc(var(--vv-h, 100dvh) - 24px)); }
}

/* ------------------------------------------------------------ Seller Center / admin top bar: solid, clear of the status bar */
.admin-top { background: var(--bg); padding-top: env(safe-area-inset-top); -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.nav-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nav-tile { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.45;
  text-align: left; cursor: pointer; }
.nav-tile .icon { flex: none; color: var(--gold-ink); }
.nav-tile > span:not(.count-badge) { min-width: 0; overflow-wrap: anywhere; }
.nav-tile .count-badge { position: static; margin-left: auto; flex: none; }
.nav-tile[aria-current="page"] { border-color: var(--ink); background: var(--surface-2); font-weight: 600; }

/* ------------------------------------------------------------ touch: big knobs, no double-tap zoom, room for fingers */
a, button, input, select, label, summary { touch-action: manipulation; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 40px; margin: 0; padding: 0; background: transparent;
  touch-action: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--range-track, #d8d3c9); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--range-track, #d8d3c9); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border: 0;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .06); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--gold); }

/* ------------------------------------------------------------ photo editor (photo.js): dark, full screen on phones,
   one slider at a time with the tools underneath, filters as small previews */
.pe { position: fixed; inset: 0; width: min(980px, 100vw); height: min(760px, 100dvh); max-width: 100vw; max-height: 100dvh; margin: auto;
  padding: 0; border: 0; border-radius: 18px; background: #0e0e10; color: #f2f1ee; display: none; flex-direction: column; overflow: hidden;
  --pe-line: #2a2a2f; --pe-muted: #a19d96; --pe-gold: #d9b56e; --range-track: #3a3a41; }
.pe[open] { display: flex; }
.pe::backdrop { background: rgba(0, 0, 0, .75); }
@media (max-width: 767px) { .pe { width: 100vw; height: 100dvh; border-radius: 0; } }
.pe-head { display: flex; align-items: center; gap: 4px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
.pe-icon { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #d8d5cf; display: grid; place-items: center; cursor: pointer; }
.pe-title { flex: 1; min-width: 0; display: grid; line-height: 1.35; padding-left: 4px; }
.pe-title strong { font-size: 16px; font-weight: 600; }
.pe-title span { font-size: 12px; color: var(--pe-muted); }
.pe-link { flex: none; border: 0; background: none; color: #c9c6c0; font: inherit; font-size: 14px; padding: 10px 8px; cursor: pointer; }
.pe-done { flex: none; min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--pe-gold); color: #1a1408;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pe-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; touch-action: none; }
.pe-canvas { display: block; border-radius: 4px; cursor: grab; touch-action: none; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.pe-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0;
  padding: 6px 12px; border-radius: 999px; background: rgba(20, 20, 22, .85); color: #f0c46c; font-size: 12px; line-height: 1.5; text-align: center;
  pointer-events: none; }
.pe-compare { position: absolute; right: 16px; bottom: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(20, 20, 22, .8);
  color: #f2f1ee; display: grid; place-items: center; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pe-compare[aria-pressed="true"] { background: var(--pe-gold); color: #1a1408; }
.pe-bottom { padding: 0 0 calc(6px + env(safe-area-inset-bottom)); background: #141416; border-top: 1px solid var(--pe-line); }
.pe-panel { min-height: 160px; padding: 12px 0 6px; display: grid; align-content: start; gap: 2px; }
.pe-readout { display: flex; align-items: baseline; gap: 8px; min-height: 28px; padding: 0 20px; }
.pe-readout strong { font-size: 14px; font-weight: 600; }
.pe-value { font-size: 14px; color: var(--pe-gold); font-variant-numeric: tabular-nums; }
.pe-reset, .pe-readout .pe-note { margin-left: auto; }
.pe-reset { border: 0; background: none; color: var(--pe-muted); font: inherit; font-size: 13px; padding: 4px 0 4px 8px; cursor: pointer; }
.pe-reset[hidden] { display: none; }
.pe-note { margin: 0; font-size: 12px; color: var(--pe-muted); }
.pe-dial { position: relative; padding: 0 20px; }
.pe-dial.centred::before { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 12px; margin: -6px 0 0 -1px; border-radius: 1px; background: #66666e; }
.pe-range { position: relative; width: 100%; }
.pe .pe-range::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, var(--range-track) var(--lo, 0%), var(--pe-gold) var(--lo, 0%),
  var(--pe-gold) var(--hi, 0%), var(--range-track) var(--hi, 0%)); }
.pe .pe-range::-moz-range-track { height: 4px; background: linear-gradient(90deg, var(--range-track) var(--lo, 0%), var(--pe-gold) var(--lo, 0%),
  var(--pe-gold) var(--hi, 0%), var(--range-track) var(--hi, 0%)); }
.pe .pe-range::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.pe .pe-range::-moz-range-thumb { width: 24px; height: 24px; }
.pe-tools, .pe-filters { display: flex; gap: 4px; overflow-x: auto; padding: 6px 14px 2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.pe-tools::-webkit-scrollbar, .pe-filters::-webkit-scrollbar { display: none; }
.pe-tool { flex: none; width: 78px; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 2px 0; border: 0; background: none;
  color: var(--pe-muted); font: inherit; font-size: 12px; line-height: 1.35; text-align: center; cursor: pointer; scroll-snap-align: start; }
.pe-tool-icon { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--pe-line);
  background: #1d1d21; color: #e9e6e0; transition: border-color .15s, color .15s; }
.pe-tool[aria-pressed="true"] { color: #fff; font-weight: 600; }
.pe-tool[aria-pressed="true"] .pe-tool-icon { border-color: var(--pe-gold); box-shadow: inset 0 0 0 1px var(--pe-gold); color: var(--pe-gold); }
.pe-tool.edited .pe-tool-icon::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--pe-gold); }
.pe-auto .pe-tool-icon { background: linear-gradient(135deg, #3d321e, #1d1d21); border-color: #5e4c2a; color: var(--pe-gold); }
.pe-glyph { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pe-glyph .fill { fill: currentColor; stroke: none; }
.pe-shape { display: block; border: 1.6px solid currentColor; border-radius: 3px; }
.pe-filters { gap: 10px; padding-top: 2px; }
.pe-filter { flex: none; display: grid; justify-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--pe-muted);
  font: inherit; font-size: 12px; cursor: pointer; scroll-snap-align: start; }
.pe-filter canvas { display: block; width: 64px; height: 80px; object-fit: cover; border-radius: 10px; background: #222226; box-shadow: 0 0 0 1px var(--pe-line); }
.pe-filter[aria-pressed="true"] { color: #fff; font-weight: 600; }
.pe-filter[aria-pressed="true"] canvas { box-shadow: 0 0 0 2px var(--pe-gold); }
.pe-filters + .pe-note { padding: 6px 20px 0; }
.pe-tabs { display: flex; padding: 0 12px; border-top: 1px solid var(--pe-line); }
.pe-tabs button { flex: 1; position: relative; min-height: 46px; border: 0; background: none; color: var(--pe-muted); font: inherit; font-size: 14px; cursor: pointer; }
.pe-tabs button[aria-selected="true"] { color: #fff; font-weight: 600; }
.pe-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 32%; right: 32%; top: -1px; height: 2px; border-radius: 2px; background: var(--pe-gold); }
.pe-foot { display: flex; flex-wrap: wrap; gap: 0 20px; padding: 0 20px; }
.pe-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13px; color: #c9c6c0; cursor: pointer; }
.pe-switch input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 999px;
  background: #3a3a41; cursor: pointer; transition: background .15s; }
.pe-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pe-switch input:checked { background: var(--pe-gold); }
.pe-switch input:checked::after { transform: translateX(16px); }
.pe-switch input:focus-visible { outline: 2px solid var(--pe-gold); outline-offset: 2px; }

/* ------------------------------------------------------------ menus in groups: sidebar search, groups, crumb, phone bar */
.admin-tabs, .admin-tabs-row { display: none !important; }
.nav-search { position: relative; display: block; margin: 0 2px 10px; }
.nav-search input { width: 100%; height: 38px; padding: 0 64px 0 34px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px;
  background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: 13px; }
.nav-search input::placeholder { color: #a9a39a; }
.nav-search input:focus { outline: none; border-color: #cfae6a; }
.nav-search .icon { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: #a9a39a; pointer-events: none; }
.nav-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 2px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, .1); color: #a9a39a; font: 12px/1.4 ui-monospace, Menlo, monospace; pointer-events: none; }
.side-group + .side-group { margin-top: 6px; }
.side-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px 4px; border: 0; background: none; color: #a9a39a;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-align: left; cursor: pointer; }
.side-group-head > span:first-child { flex: 1; }
.side-group-head:hover { color: #fff; }
.side-group-head .icon { flex: none; transform: rotate(-90deg); transition: transform .15s; }
.side-group.open .side-group-head .icon { transform: none; }
.side-group-head .count-badge { position: static; }
.side-empty { margin: 0; padding: 8px 12px; font-size: 13px; color: #a9a39a; }
@media (min-width: 960px) {
  .admin-top-row h1[data-group]:not([data-group=""])::before { content: attr(data-group) "  ›  "; font-size: 15px; font-weight: 400; color: var(--ink-3); }
}
.nav-find-wrap { padding: 12px 24px 0; }
@media (max-width: 639px) { .nav-find-wrap { padding: 12px 16px 0; } }
.nav-find { width: 100%; }
.admin-bar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.admin-bar button { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; min-width: 0; border: 0; background: none;
  color: var(--ink-3); font: inherit; font-size: 12px; line-height: 1.25; cursor: pointer; }
.admin-bar button > span:not(.count-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.admin-bar button[aria-current="page"] { color: var(--ink); font-weight: 600; }
.admin-bar button[aria-current="page"] .icon { color: var(--gold-ink); }
.admin-bar .count-badge { top: 4px; right: calc(50% - 24px); }
@media (max-width: 959px) { .admin-main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); } }
@media (min-width: 960px) { .admin-bar { display: none; } }
.nav-sheet { height: min(640px, 82dvh); }

/* ------------------------------------------------------------ product photos: drag to order, cover, edit again */
.media-tile { touch-action: pan-y; transition: box-shadow .15s; }
.media-tile.dragging { position: relative; z-index: 5; box-shadow: var(--shadow-lg); opacity: .92; transition: none; }
.media-tile.drop-here { box-shadow: 0 0 0 3px var(--gold); }
.media-tile img { -webkit-user-drag: none; user-select: none; }
.media-grip { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 10px; display: grid; place-items: center;
  background: rgba(20, 19, 17, .62); color: #fff; cursor: grab; touch-action: none; }
.media-grip:active { cursor: grabbing; }
.media-actions { display: flex; justify-content: flex-start; gap: 2px; padding: 4px; }
.media-act { display: inline-grid; place-items: center; width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 8px; background: none;
  color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.media-act:hover { background: var(--surface-2); color: var(--ink); }
.media-act.danger { margin-left: auto; color: var(--bad); }

/* ------------------------------------------------------------ photo editor: tips and the shop page's frame */
.pe-tips { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; width: max-content;
  max-width: calc(100% - 32px); pointer-events: none; z-index: 2; }
.pe-tips .pe-hint { position: static; transform: none; max-width: 100%; }
.pe-frame { position: absolute; z-index: 1; overflow: hidden; border-radius: 4px; pointer-events: none; }
.pe-frame-logo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  outline: 1.5px dashed rgba(255, 255, 255, .8); }
.pe-zone { position: absolute; border: 1.5px dashed rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.pe-zone em { position: absolute; top: 4px; left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 12px; font-style: normal; }
/* the cover is 3:1 here; phones show about 2.45:1 of it (sides cut), wide computers about 4.3:1 (top and bottom cut) */
.pe-zone-phone { top: 0; bottom: 0; left: 9.2%; right: 9.2%; }
.pe-zone-wide { left: 0; right: 0; top: 15.1%; bottom: 15.1%; }
.pe-zone-wide em { left: auto; right: 6px; }
.pe-zone-logo { position: absolute; left: 50%; top: 65.7%; width: 20%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: rgba(255, 255, 255, .3); border: 2px solid #fff; }
@media (max-width: 639px) { .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* ------------------------------------------------------------ photo editor: background tab */
.pe-swatch { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.pe-swatch.none { background: linear-gradient(135deg, transparent 45%, #e46b5f 45%, #e46b5f 55%, transparent 55%), #2a2a2f; }
.pe-value.warn { color: #f0a35c; }
.pe-note-row { padding: 4px 20px 0; }

/* ------------------------------------------------------------ pinned menus (★) */
.side-row { position: relative; }
.side-row .side-link { padding-right: 38px; }
.side-pin { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: none; color: #a9a39a; font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.side-row:hover .side-pin, .side-pin:focus-visible, .side-pin.on { opacity: 1; }
.side-pin.on { color: #cfae6a; }
.side-pin:hover { color: #fff; background: rgba(255, 255, 255, .08); }
@media (hover: none) { .side-pin { opacity: 1; } }
.nav-tile-wrap { position: relative; min-width: 0; }
.nav-tile-wrap .nav-tile { width: 100%; height: 100%; padding-right: 36px; }
.nav-pin { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: none; color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer; }
.nav-pin.on { color: var(--gold-ink); }
.nav-tile-wrap .count-badge { margin-right: 2px; }

/* ------------------------------------------------------------ feature switches page */
.feature-list { display: grid; }
.feature-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.feature-row:first-child { border-top: 0; }
.feature-info { display: grid; gap: 4px; min-width: 0; }
.feature-info p { margin: 0; }
.feature-row .select { min-width: 150px; }
@media (max-width: 639px) { .feature-row { grid-template-columns: 1fr; } }
.pilot-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ------------------------------------------------------------ review queue: photos like another shop's */
.dupes { display: grid; gap: 8px; }
.dupe-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.dupe { flex: none; display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; width: 240px; padding: 6px;
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.4; }
.dupe img { width: 48px; height: 60px; object-fit: cover; border-radius: 6px; }
.media-borrowed { position: absolute; left: 6px; right: 6px; bottom: 54px; margin: 0; padding: 6px 8px; border-radius: 8px;
  background: var(--warn-soft); color: var(--ink); font-size: 12px; line-height: 1.45; }
.media-borrowed.sample { background: var(--info-soft); }

/* ------------------------------------------------------------ dense lists on phones: two facts per line, less padding */
/* Orders, coupons, staff, devices... were one fact per line under its label: a list took screens of scrolling. Rows
   without a photo now show their first fact as the title (no label) and the rest two by two. */
@media (max-width: 639px) {
  .admin-main { padding-left: 12px; padding-right: 12px; }
  .admin-main .panel { padding: 14px; }
  .admin-main .card.panel:has(> .table-wrap) { padding: 0 12px; }
  .filters { gap: 8px; margin-bottom: 12px; }
  .filters .chips { flex: 1 0 100%; flex-wrap: nowrap; margin: 0 -12px; padding: 2px 12px; }
  .filters .chip { flex: none; }
  .filters .input { flex: 1 1 100%; max-width: none; }
  .filters .select { flex: 1 1 140px; min-width: 0; }
}
@media (hover: none) { .table tbody tr:hover { background: none; } }
@container (max-width: 680px) {
  .table tbody tr:not(:has(.cell-thumb)) { position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 0; }
  .table tr:not(:has(.cell-thumb)) > td { grid-column: auto; }
  .table td[data-label]::before { font-size: 12px; margin-bottom: 1px; }
  .table tr:not(:has(.cell-thumb)) > td.check-col { position: absolute; top: 8px; right: 0; }
  .table tr:not(:has(.cell-thumb)) > td.check-col input { width: 22px; height: 22px; }
  .table tr:not(:has(.cell-thumb)) > td:first-child:not(.check-col), .table tr:not(:has(.cell-thumb)) > td.check-col + td,
  .table tr:not(:has(.cell-thumb)) > td.cell-actions, .table tr:not(:has(.cell-thumb)) > td.cell-name { grid-column: 1 / -1; padding-right: 40px; }
  .table tr:not(:has(.cell-thumb)) > td:first-child:not(.check-col)::before, .table tr:not(:has(.cell-thumb)) > td.check-col + td::before { display: none !important; }
  .table tr:not(:has(.cell-thumb)) > td.check-col + td .mono, .table tr:not(:has(.cell-thumb)) > td:first-child .mono { font-weight: 600; }
}
@container (max-width: 260px) { .table tbody tr:not(:has(.cell-thumb)) { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ orders: sticky search, list total, swipe actions */
@media (min-width: 960px) { .filters-sticky { display: contents; } }
@media (max-width: 959px) {
  .filters-sticky { position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 6; flex: 1 0 100%; display: grid; gap: 8px;
    margin: 0 -12px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .filters-sticky .input { max-width: none; }
}
.list-sum { margin: 0 0 8px; font-size: 14px; }
.table tr.swiped { background: var(--surface-2); }
.table td.swipe-bar { grid-column: 1 / -1 !important; padding: 8px 0 0 !important; }
.table td.swipe-bar::before { display: none !important; }
.swipe-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; animation: pop .15s ease-out; }
.swipe-actions .swipe-close { margin-left: auto; width: 36px; height: 36px; }

/* ------------------------------------------------------------ products & stock: compact rows, quick stock */
.stock-cell.editable { cursor: pointer; }
.stock-cell.editable:hover .badge { outline: 1px solid var(--line); }
.stock-edit { display: grid; gap: 8px; }
.stock-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px 92px 40px; gap: 8px; align-items: center; }
.stock-name { font-weight: 600; overflow-wrap: anywhere; }
.stock-row .input { text-align: center; font-variant-numeric: tabular-nums; }
.stock-step { width: 40px; height: 40px; background: var(--surface-2); }
@container (max-width: 680px) {
  .products-table tbody tr { grid-template-columns: 56px minmax(0, 1fr) auto !important; gap: 4px 10px; padding: 12px 0; align-items: start; }
  .products-table tr > td { grid-column: 2 / -1 !important; }
  .products-table tr > td::before { display: none !important; }
  .products-table tr > td.cell-thumb { grid-column: 1 !important; grid-row: 1 / span 4; }
  .products-table tr > td.cell-name { grid-row: 1; }
  .products-table tr > td:nth-child(3) { grid-column: 2 !important; grid-row: 2; }
  .products-table tr > td:nth-child(5) { grid-column: 3 !important; grid-row: 2; text-align: right; }
  .products-table tr > td:nth-child(5) .mt-6 { margin-top: 2px; }
  .products-table tr > td.stock-cell { grid-row: 3; }
  .products-table tr > td.cell-actions { grid-row: 4; }
  .products-table .thumb { width: 56px; height: 70px; }
}

/* ------------------------------------------------------------ chat inbox like a messaging app */
.chat-row { grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; width: 100%;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2);
  font-weight: 700; font-size: 16px; }
.chat-avatar.fb { background: #e7f0fd; color: #1a5fd0; }
.chat-row-main { display: grid; gap: 1px; min-width: 0; }
.chat-row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-row-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-last, .chat-row-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.chat-row-meta { font-size: 12px; color: var(--ink-3); }
.chat-row.unread .chat-row-last { color: var(--ink); font-weight: 600; }
.chat-row-side { display: grid; justify-items: end; gap: 4px; align-self: start; padding-top: 2px; }
.chat-row-time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.chat-list-items .notif-list { gap: 4px; }
.chat-back { display: none; flex: none; }
.chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }
.chat-head .chat-actions { flex: 1 0 100%; order: 3; justify-content: flex-start; }
.chat-head-who { flex: 1; min-width: 0; }
.chat-head-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chat-note { margin: 0; }
/* computer: list and conversation side by side, each scrolling on its own, the page itself does not */
@media (min-width: 861px) {
  .chat-layout { align-items: stretch; height: calc(100dvh - 150px); min-height: 480px; }
  .chat-list { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .chat-list .chat-list-items { flex: 1; min-height: 0; overflow-y: auto; }
  .chat-thread { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .chat-thread .chat-body { flex: 1; max-height: none; min-height: 0; }
}
/* phones and tablets: the list, or one conversation full height with ← back (like Messenger / WhatsApp) */
@media (max-width: 860px) {
  .chat-layout { gap: 0; }
  .chat-layout.thread-open .chat-list, .chat-layout:not(.thread-open) .chat-thread, .chat-layout.thread-open ~ .blocks-box { display: none; }
  .chat-layout .chat-list, .chat-layout .chat-thread { border-radius: 0; border-left: 0; border-right: 0; margin: 0 -12px; padding: 12px; }
  .chat-back { display: inline-grid; }
  .chat-thread { display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - 60px - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px); }
  .chat-thread .chat-body { flex: 1; max-height: none; min-height: 0; }
  .chat-thread .chat-note { display: none; }
  .chat-thread .assist-box:empty, .chat-thread .quick-replies:empty { display: none; }
  .chat-thread .quick-replies { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 860px) {
  .support-layout.thread-open .hd-side, .support-layout:not(.thread-open) > .hd { display: none; }
  .support-layout .chat-back { display: inline-grid; }
  /* one conversation fills the screen like Messenger: only the messages scroll, the page behind stays still */
  .support-layout.thread-open > .hd { display: flex; flex-direction: column; margin: 0 -12px; border-radius: 0; border-left: 0; border-right: 0;
    height: calc(100dvh - 60px - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 72px); min-height: 360px; }
  .support-layout.thread-open > .hd .hd-thread { flex: 1; min-height: 0; max-height: none; }
  .support-layout.thread-open > .hd .hd-hint { display: none; }
}

/* ------------------------------------------------------------ shop home: shorter guide, compact link card */
.start-guide-done { margin-top: 8px; }
.start-guide-done summary { cursor: pointer; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 14px; }
.start-guide-done ul { list-style: none; margin: 6px 0 0; padding: 0 12px; display: grid; gap: 4px; font-size: 13px; color: var(--ok); }
@media (max-width: 639px) {
  .start-guide { border-width: 1px; }
  .start-guide-steps li { padding: 10px; }
  .slc-cover { min-height: 84px; padding: 12px 14px; }
  .slc-logo { width: 46px; height: 46px; }
  .slc-name strong { font-size: 1.05rem; }
  .slc-body { grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; padding: 14px; }
  .slc-qr { justify-self: end; align-self: start; }
  .slc-qr img { width: 104px; height: 104px; padding: 4px; border-radius: 12px; }
  .slc-qr-actions { display: grid; gap: 4px; width: 100%; }
  .slc-qr-actions .btn { justify-content: center; padding: 6px 8px; }
  .slc-link { flex-wrap: nowrap !important; border-radius: 999px !important; padding: 4px 4px 4px 12px !important; }
  .slc-link .mono { white-space: nowrap !important; flex-basis: auto !important; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
  .slc-copy { padding: 6px 10px; font-size: .82rem; }
  .slc-copy svg { display: none; }
  .slc-main > .muted { display: none; }
  .slc-shares { gap: 6px; }
}

/* ------------------------------------------------------------ shop report: one-line dates, denser numbers */
.report-range { display: flex; align-items: center; gap: 6px; flex: 1 1 320px; }
.report-range .input { flex: 1; min-width: 0; }
.report-export { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 639px) {
  .report-bar .chips { flex: 1 0 100%; flex-wrap: nowrap; margin: 0 -12px; padding: 2px 12px; }
  .report-range { flex: 1 0 100%; }
  .report-export { flex: 1 0 100%; }
  .report-export .btn { flex: 1; justify-content: center; }
  .stats { gap: 8px; margin-bottom: 14px; }
  .stat { padding: 12px 12px; }
  .stat .value { font-size: 19px; }
  .stat .muted.small { font-size: 12px; line-height: 1.4; }
}

/* ------------------------------------------------------------ storefront "ຂອງຂ້ອຍ" (my page) and sign-in */
.me-page { max-width: 760px; display: grid; gap: 14px; padding-bottom: 32px; }
.me-page .page-title { margin-bottom: 0; }
.me-head { display: flex; align-items: center; gap: 12px; padding: 14px; }
.me-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft);
  color: var(--gold-ink); font-weight: 700; font-size: 20px; }
.me-who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.me-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.me-tile { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; cursor: pointer; }
.me-tile .icon { color: var(--gold-ink); }
.me-tile strong { font-size: 18px; }
.me-tile span { font-size: 12px; color: var(--ink-2); text-align: center; }
.me-section { display: grid; gap: 8px; }
.me-section h2 { margin: 6px 0 0; font-size: 16px; }
.me-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.me-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.me-row:first-child { border-top: 0; }
.me-row:hover { background: var(--surface-2); }
.me-row-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.me-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.me-row-text span { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-row-go { flex: none; color: var(--ink-3); font-size: 20px; }
.me-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 42%); gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity; scrollbar-width: none; }
.me-strip > * { scroll-snap-align: start; }
@media (min-width: 700px) { .me-strip { grid-auto-columns: 180px; } }
.fav-btn .heart { color: var(--bad); font-size: 16px; line-height: 1; }
.fav-btn[aria-pressed="true"] { color: var(--bad); }
.follow-btn[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.signin { gap: 12px; }
.signin-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin-wait { display: flex; align-items: center; gap: 6px; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; }
.card-heart { position: absolute; right: 8px; top: 8px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: var(--ink-2); font-size: 17px; line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15); cursor: pointer; }
.card-heart[aria-pressed="true"] { color: #d0342c; }
.check.attention { outline: 2px solid var(--bad); outline-offset: 4px; border-radius: 8px; animation: nudge .3s ease 2; }
@keyframes nudge { 50% { transform: translateX(4px); } }
dialog .toasts { z-index: 5; }
.signin-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.signin-tabs button { min-height: 38px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; }
.signin-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.pw-box { position: relative; display: block; }
.pw-box .input { width: 100%; padding-right: 46px; }
.pw-box .pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; }
.consent-hint { margin: -4px 0 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* membership: plan cards like other subscription pages */
.plans-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.plans-head h2 { margin: 0; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--surface); font-weight: 600; }
.seg-save { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #e3f4e8; color: #1e6b3a; }
.plan-card { position: relative; padding: 18px; gap: 10px; }
.plan-card.recommended { border: 2px solid var(--gold); box-shadow: 0 6px 24px rgba(0, 0, 0, .06); }
.plan-ribbon { position: absolute; top: -11px; left: 16px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; }
.plan-card .plan-price { font-size: 1.6rem; line-height: 1.2; }
.plan-sub { margin: -4px 0 0; min-height: 1.2em; }
.plan-actions { display: grid; gap: 6px; }
.plan-card ul.plan-features { list-style: none; padding: 0; gap: 7px; margin-top: 4px; }
.plan-features li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; font-size: 14px; }
.plan-features .icon-sm { color: var(--gold); margin-top: 2px; }
.compare-wrap { overflow-x: auto; margin: 0 -4px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.compare-table thead th { font-size: 13px; font-weight: 700; text-align: center; }
.compare-table th[scope="row"] { font-weight: 500; text-align: left; color: var(--ink-2); min-width: 120px; }
.compare-table td { text-align: center; white-space: nowrap; }
.compare-table .is-current { background: var(--surface-2); }
@media (max-width: 480px) { .compare-table { font-size: 13px; } .compare-table th[scope="row"] { min-width: 0; } }
.cmp-yes { color: #1e8a4c; font-weight: 700; }
.cmp-no { color: var(--ink-3); }
.pack-list { display: grid; gap: 8px; }
.pack-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-save { background: #1d3b29; color: #8fd6a8; } }
:root[data-theme="dark"] .seg-save { background: #1d3b29; color: #8fd6a8; }
.plan-hero .page-head { margin-bottom: 0; }
/* windows (dialogs) scroll up and down only: nothing inside may push them sideways (iPhones let them slide left-right) */
dialog .modal-body { overflow-x: hidden; touch-action: pan-y pinch-zoom; }
dialog .modal-body > *, .form-grid > *, .field { min-width: 0; max-width: 100%; }
/* iPhone date / time fields keep their own minimum width and stick out of the frame: make them follow the field */
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 44px; }
input[type="date"]::-webkit-date-and-time-value, input[type="datetime-local"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
/* ---------- calendar sheet (one date picker everywhere, like the ປະຕິທິນ page) */
.date-sheet { width: 420px; }
.dp-body { display: grid; gap: 12px; }
.dp-presets { flex-wrap: wrap; }
.dp-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.dp-month { font-size: 17px; }
.dp-month small { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: pan-y; }
.dp-head { text-align: center; font-size: 11px; white-space: nowrap; overflow: hidden; font-weight: 600; color: var(--ink-2); padding: 2px 0 4px; }
.dp-head.off, .dp-day.off { color: var(--bad); }
.dp-day { min-height: 44px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.dp-day.out { opacity: .4; }
.dp-day.picked, .dp-day.between { opacity: 1; }
.dp-day.today { border-color: var(--gold); }
.dp-day.between { background: var(--gold-soft); border-radius: 4px; }
.dp-day.picked { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.dp-day.first { border-radius: 10px 4px 4px 10px; }
.dp-day.last { border-radius: 4px 10px 10px 4px; }
.dp-day:disabled { opacity: .25; cursor: not-allowed; }
.dp-day:not(:disabled):not(.picked):hover { border-color: var(--gold); }
.dp-time { display: flex; align-items: center; gap: 8px; }
.dp-time .select { width: auto; min-width: 72px; }
.dp-summary { margin: 0; text-align: center; font-weight: 600; color: var(--ink-2); }
.date-sheet .modal-foot { align-items: center; }
.date-sheet .modal-foot .link-btn { margin-right: auto; }
.date-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.date-btn.is-empty { color: var(--ink-3); }
.date-btn .icon-sm { color: var(--gold); flex: none; }
.range-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.range-btn .icon-sm { color: var(--gold); flex: none; }
.range-words { display: grid; flex: 1; min-width: 0; }
.range-words strong { font-size: 15px; }
.range-words small { color: var(--ink-3); font-size: 12px; }
.range-caret { color: var(--ink-3); }
@media (min-width: 768px) { .report-bar .range-btn { width: auto; min-width: 300px; } }
@media (max-width: 767px) { .report-bar .range-btn { flex: 1 0 100%; } }
/* plans: the small "Pro" label and the upgrade sheet */
.pro-chip { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(135deg, #c9a24a, #8a6a1f); color: #fff; line-height: 1.5; vertical-align: middle; }
.pro-chip.big { font-size: 13px; padding: 3px 12px; margin: 0; }
.upgrade-sheet { width: 440px; }
.upgrade-hero { display: grid; gap: 10px; justify-items: start; padding: 14px; border-radius: var(--radius); background: var(--gold-soft); }
.upgrade-hero p { margin: 0; font-size: 15px; line-height: 1.55; }
.upgrade-sheet .plan-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
/* ---------- server readiness (capacity) */
.cap-hero { display: grid; gap: 8px; border-left: 6px solid var(--ok, #2f8a4f); }
.cap-hero.cap-plan { border-left-color: #c98a1a; }
.cap-hero.cap-urgent { border-left-color: var(--bad); }
.cap-hero h2 { font-size: 18px; margin: 0; line-height: 1.45; }
.cap-hero-head, .cap-metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cap-pill { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e3f4e8; color: #1e6b3a; }
.cap-pill.cap-plan { background: #fdf0d9; color: #8a5a00; }
.cap-pill.cap-urgent { background: var(--bad-soft); color: var(--bad); }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-top: 12px; }
.cap-metric { display: grid; gap: 4px; align-content: start; }
.cap-metric p { margin: 0; }
.cap-value { font-size: 26px; line-height: 1.2; }
.cap-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.cap-advice { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.cap-advice p { margin: 2px 0; }
:root[data-theme="dark"] .cap-pill { background: #1d3b29; color: #8fd6a8; }
:root[data-theme="dark"] .cap-pill.cap-plan { background: #3b2e12; color: #f0c56a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cap-pill { background: #1d3b29; color: #8fd6a8; }
  :root:not([data-theme="light"]) .cap-pill.cap-plan { background: #3b2e12; color: #f0c56a; } }
/* ---------- install as an app */
.install-card { display: grid; grid-template-columns: 48px 1fr; gap: 10px 12px; align-items: center; margin-bottom: 12px; }
.install-card img { border-radius: 12px; }
.install-card p { margin: 2px 0 0; }
.install-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@media (min-width: 768px) { .install-card { grid-template-columns: 48px 1fr auto; } .install-actions { grid-column: auto; } }
.install-steps { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; line-height: 1.5; }
.install-sheet { width: 440px; }
.nav-install { margin: 4px 16px 16px; width: calc(100% - 32px); }
/* iPhone / iPad: pointing at Safari's Share button */
.ios-pointer { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .45); display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 16px 16px calc(6px + env(safe-area-inset-bottom)); }
.ios-pointer.at-top { justify-content: flex-start; align-items: flex-end; padding-top: calc(6px + env(safe-area-inset-top)); flex-direction: column-reverse; }
.ios-card { width: min(100%, 360px); background: var(--surface); color: var(--ink); border-radius: 18px; padding: 16px 18px; display: grid; gap: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.ios-card ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.6; }
.ios-card .btn { justify-self: end; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #e8f0fe; color: #1a73e8; font-weight: 700; }
.ios-menu-item { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 8px; background: var(--surface-2); font-weight: 600; }
.ios-plus { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 5px; font-weight: 700; line-height: 1; }
.ios-hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.ios-arrow { font-size: 40px; line-height: 1; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); margin-top: 6px; animation: ios-bob 1s ease-in-out infinite; }
.ios-pointer.at-top .ios-arrow { margin: 0 8px 6px 0; animation-name: ios-bob-up; }
@keyframes ios-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes ios-bob-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .ios-arrow { animation: none; } }
/* ---------- order by code */
.co-board { display: grid; gap: 8px; margin-top: 10px; }
.co-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.co-row.held { border-left: 4px solid var(--gold); }
.co-row.paid { border-left: 4px solid #2f8a4f; }
.co-row.expired, .co-row.cancelled { opacity: .6; }
.co-code { font-weight: 800; font-size: 16px; text-align: center; padding: 6px 0; border-radius: 8px; background: var(--surface-2); }
.co-what { display: grid; min-width: 0; }
.co-what strong { overflow-wrap: anywhere; }
.co-side { display: grid; justify-items: end; gap: 3px; text-align: right; }
.co-codes { display: grid; gap: 6px; }
.co-code-row { display: grid; grid-template-columns: 44px 1fr 96px; gap: 10px; align-items: center; }
.co-code-row.off { opacity: .55; }
.co-code-row img, .co-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.co-code-row > div { display: grid; min-width: 0; }
.co-code-input { text-align: center; font-weight: 700; text-transform: uppercase; }
@media (max-width: 560px) { .co-row { grid-template-columns: 48px 1fr; } .co-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: end; align-items: center; } }
/* ---------- product picker (shared) and the coded list */
.picker-sheet { width: 560px; }
.picker-sheet[open] { display: flex; flex-direction: column; height: min(86dvh, 760px); }
.picker-tools { display: grid; gap: 8px; padding: 12px 16px 4px; }
.picker-search { margin: 0; }
.picker-filters { display: flex; gap: 10px; align-items: center; }
.picker-filters .select { flex: 1; min-width: 0; }
.picker-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: 8px; }
.picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 4px; }
.picker-row { display: grid; grid-template-columns: 22px 44px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.picker-row:hover { background: var(--surface-2); }
.picker-row input { width: 20px; height: 20px; }
.picker-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.picker-row.is-chosen { opacity: .55; cursor: default; }
.picker-row.off { opacity: .7; }
.picker-text { display: grid; min-width: 0; }
.picker-text strong { font-size: 14px; overflow-wrap: anywhere; }
.picker-empty { text-align: center; padding: 24px 0; }
.co-code-row { grid-template-columns: 22px 44px 1fr 84px 36px; }
.co-code-row input[type=checkbox] { width: 20px; height: 20px; }
.co-chip { text-align: center; font-weight: 800; min-height: 38px; border-radius: 999px; background: var(--gold-soft); border-color: transparent; }
.co-chip:focus { background: var(--surface); }
.co-remove { width: 36px; height: 36px; color: var(--ink-3); }
.co-remove:hover { color: var(--bad); background: var(--bad-soft); }
.co-empty { text-align: center; padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.co-empty p { margin: 4px 0; }
.co-bulk { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ink); color: var(--surface); }
.co-bulk span { flex: 1; font-weight: 600; }
.co-bulk .btn-ghost { color: var(--surface); }
@media (max-width: 480px) { .co-code-row { grid-template-columns: 22px 40px 1fr 72px 32px; gap: 8px; } .co-code-row img, .co-noimg { width: 40px; height: 40px; } }
/* ---------- live rounds */
.co-round { display: grid; gap: 10px; margin: 6px 0 12px; }
.co-live-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); }
.co-live-head > div { flex: 1; display: grid; min-width: 0; }
.co-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); flex: none; animation: co-pulse 1.4s ease-in-out infinite; }
@keyframes co-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .co-dot { animation: none; } }
.co-start { display: flex; gap: 8px; }
.co-start .input { flex: 1; min-width: 0; }
.co-summary { display: grid; gap: 10px; }
.co-best { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.co-row.queue { border-left: 4px dashed var(--ink-3); }
.co-past { border-top: 1px solid var(--line); padding: 10px 0; }
.co-past summary { cursor: pointer; }
.co-past .co-summary { margin-top: 10px; }
.co-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.co-nums > div { display: grid; gap: 2px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.co-nums span { font-size: 12px; color: var(--ink-3); }
.co-nums strong { font-size: 16px; overflow-wrap: anywhere; }
.co-nums small { font-size: 12px; color: var(--ink-2); }
.co-line { margin: 0; }
/* ---------- order by code: channels */
.co-ch { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.co-ch:first-of-type { border-top: 0; }
.co-ch-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.co-ch-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.co-ch p { margin: 4px 0 6px; }
.co-ch .form-grid { gap: 8px; margin-top: 4px; }
