/* HB Market — monochrome Chinese ink wash theme (สีขาวดำ + ตราแดงชาด) */
:root {
  --paper: #f1efe9;
  --paper-2: #e7e4dc;
  --paper-3: #d8d4ca;
  --ink: #1d1c19;
  --ink-2: #45433d;
  --ink-3: #8a877e;
  --mist: #b9b6ad;
  --night: #15140f;
  --night-2: #23211b;
  --plum: #a8384a;      /* red accent — plum blossom / seal stamps */
  --plum-dark: #7e2a38;
  --danger: #9c3327;
  --ok: #3d5c44;
  --warn: #7d6a33;
  --serif: 'Noto Serif Thai', 'Noto Serif TC', serif;
  --brush: 'Zhi Mang Xing', 'Noto Serif TC', cursive;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(40,40,38,.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 5%, rgba(40,40,38,.06), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.25 0 0 0 0 0.23 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  min-height: 100vh;
}

/* ---------- ink intro (stamp splash on load) ---------- */
.ink-intro {
  position: fixed; inset: 0; z-index: 600; background: var(--paper);
  display: flex; align-items: center; justify-content: center; gap: 22px;
  pointer-events: none;
  animation: introHide .5s ease 1.35s forwards;
}
.ink-intro .ii-char {
  color: var(--ink); line-height: 0;
  animation: charIn .65s cubic-bezier(.2,.8,.2,1) both;
}
.ink-intro .ii-char svg { width: min(26vmin, 180px); height: min(26vmin, 180px); }
.ink-intro .ii-stamp {
  width: 66px; height: 66px; background: var(--plum); color: var(--paper);
  font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; box-shadow: inset 0 0 8px rgba(0,0,0,.4);
  transform: rotate(-6deg);
  animation: stampIn .35s ease .55s both;
}
@keyframes charIn { from { opacity: 0; transform: scale(1.5) rotate(-4deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes stampIn { from { opacity: 0; transform: scale(2.4) rotate(-22deg); } 70% { transform: scale(.92) rotate(-3deg); } to { opacity: 1; transform: scale(1) rotate(-6deg); } }
@keyframes introHide { to { opacity: 0; visibility: hidden; } }

/* ---------- night mode: แก้พื้นผิวที่ฝังสีขาวไว้ให้เป็นโทนมืด ---------- */
[data-mode="night"] header { background: rgba(23, 22, 15, .93); }
[data-mode="night"] .card,
[data-mode="night"] .order-card,
[data-mode="night"] .filter-side { background: rgba(255, 255, 255, .05); }
[data-mode="night"] .card .sold-tag { background: rgba(23, 22, 15, .8); }
[data-mode="night"] .field input,
[data-mode="night"] .field textarea,
[data-mode="night"] .search-wrap input,
[data-mode="night"] .fs-search input,
[data-mode="night"] .order-search input,
[data-mode="night"] .code-row input,
[data-mode="night"] .qty-ctrl input,
[data-mode="night"] .chat-input-row input,
[data-mode="night"] .chat-box { background: rgba(255, 255, 255, .07); color: var(--ink); }
/* select ต้องใช้พื้นทึบ ไม่งั้น popup ตัวเลือกจะเป็นพื้นขาว อ่านตัวอักษรสว่างไม่ออก */
[data-mode="night"] .field select { background: #26241d; color: var(--ink); }
[data-mode="night"] select option { background: #26241d; color: #ece7db; }
[data-mode="night"] .hero-stats { background: rgba(255, 255, 255, .06); }
[data-mode="night"] .chat-msg div { background: rgba(255, 255, 255, .08); }
/* กรอบในโหมดกลางคืน: เส้นขาวจ้าดูแข็ง → ใช้เส้นนุ่มโปร่งแทน */
[data-mode="night"] .card,
[data-mode="night"] .order-card,
[data-mode="night"] .filter-side,
[data-mode="night"] .modal,
[data-mode="night"] .brush-edge,
[data-mode="night"] .btn,
[data-mode="night"] .otab,
[data-mode="night"] .game-card,
[data-mode="night"] .game-header,
[data-mode="night"] .qty-ctrl,
[data-mode="night"] .qty-ctrl input,
[data-mode="night"] .detail-total,
[data-mode="night"] .field input,
[data-mode="night"] .field select,
[data-mode="night"] .field textarea,
[data-mode="night"] .search-wrap input { border-color: rgba(201, 166, 104, .34); }
[data-mode="night"] .step .dot { border-color: rgba(201, 166, 104, .5); }
[data-mode="night"] .qty-ctrl input { border-left-color: rgba(201, 166, 104, .34); border-right-color: rgba(201, 166, 104, .34); }
/* กรอบการ์ดออเดอร์ + เส้นเชื่อมขั้นตอน: เปลี่ยนจากเทาเป็นทองอุ่นชัดเจน */
[data-mode="night"] .order-card { border-color: rgba(201, 166, 104, .5); }
[data-mode="night"] .step-line { background: rgba(201, 166, 104, .55); opacity: 1; }
/* ปุ่ม/ตราหลักยังคงสีเน้นไว้ (ไม่ให้จาง) */
[data-mode="night"] .btn-seal,
[data-mode="night"] .search-wrap button { border-color: var(--plum-dark); }

/* ---------- brush utilities ---------- */
.brush-edge {
  border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}
.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  border-radius: 8px; transform: rotate(-3deg);
  box-shadow: inset 0 0 6px rgba(0,0,0,.5), 1px 2px 0 rgba(29,28,25,.25);
  flex-shrink: 0;
}
.icon-tile svg { width: 62%; height: 62%; }
.icon-tile.hanzi-tile { font-family: var(--brush); }
.brush-underline { position: relative; display: inline-block; }
.brush-underline::after {
  content: ''; position: absolute; left: -4%; right: -4%; bottom: -10px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 12 Q 40 4 80 10 T 160 9 T 240 12 T 298 8' stroke='%231d1c19' stroke-width='6' fill='none' stroke-linecap='round' opacity='0.8'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.brush-divider {
  max-width: 1200px; margin: 46px auto -22px; padding: 0 20px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 16' preserveAspectRatio='none'%3E%3Cpath d='M2 9 Q80 3 160 8 T320 7 T470 10 T598 6' stroke='%231d1c19' stroke-width='3' fill='none' stroke-linecap='round' opacity='0.45'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  background-origin: content-box; background-clip: content-box;
}

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 239, 233, .93);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; color: var(--ink); }
.logo .icon-tile { width: 44px; height: 44px; }
.logo-text { line-height: 1.1; }
.logo-text b { font-size: 20px; letter-spacing: 1px; }
.logo-text span { font-size: 11px; color: var(--ink-3); display: block; }
nav { display: flex; gap: 4px; margin-left: 8px; }
nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 8px 12px;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
nav a:hover { background: var(--paper-3); color: var(--ink); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wallet-chip {
  display: none; align-items: center; gap: 7px; font-size: 14px;
  padding: 6px 14px; cursor: pointer; background: var(--paper-2);
}
.wallet-chip svg { width: 17px; height: 17px; }
.wallet-chip b { color: var(--ink); }
.bell-btn {
  display: none; position: relative; align-items: center; justify-content: center;
  width: 38px; height: 38px; cursor: pointer; background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  color: var(--ink);
}
.bell-btn svg { width: 18px; height: 18px; }
.bell-btn:hover { background: var(--ink); color: var(--paper); }
.bell-badge {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px;
  background: var(--plum); color: #f6f3ec; font-size: 11px; font-weight: 700;
  border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.bell-badge:empty { display: none; }
/* กล่องแจ้งเตือน/คำสั่งซื้อสูงคงที่ — เลื่อนข้างในแทนที่จะยืดทั้งหน้า */
#notifArea, #ordersArea, #shopArea { max-height: 62vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.notif-item {
  padding: 11px 12px; border-bottom: 1px dashed var(--ink-3); font-size: 14px; line-height: 1.6;
}
.notif-item small { color: var(--ink-3); font-size: 11px; }
.notif-item.unread { background: rgba(168,56,74,.07); border-left: 3px solid var(--plum); }
.settings-block {
  border-top: 1px dashed var(--ink-3); padding-top: 16px; margin-top: 4px; margin-bottom: 14px; font-size: 14px;
}
.acct-info {
  background: var(--paper-2); border: 1.5px solid var(--ink-3); border-radius: 12px;
  padding: 6px 14px; margin: 4px 0 16px;
}
.ai-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--ink-3); font-size: 14px;
}
.ai-row:last-child { border-bottom: none; }
.ai-k { color: var(--ink-3); flex-shrink: 0; }
.ai-v { color: var(--ink); font-weight: 600; text-align: right; word-break: break-word; }
.ai-empty { color: var(--warn); font-weight: 500; }
.wallet-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 14px; }
@media (max-width: 640px) { .wallet-cols { grid-template-columns: 1fr; } }
.payment-info-box {
  background: var(--paper-2); border: 1.5px dashed var(--ink-3); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin: 8px 0 12px; white-space: pre-line;
}
.tax-note { font-size: 12px; color: var(--warn); margin: -4px 0 10px; min-height: 14px; }
.rating-badge { color: #d9930d; font-weight: 700; font-size: 12px; }
.star-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.star-btn {
  font-size: 34px; background: none; border: none; cursor: pointer;
  color: var(--paper-3); transition: color .12s, transform .12s, text-shadow .12s;
}
.star-btn.on {
  color: #ffc233; /* ทองสว่าง */
  text-shadow: 0 0 10px rgba(255, 194, 51, .55), 0 1px 2px rgba(0,0,0,.15);
}
.star-btn:hover { transform: scale(1.2); }
.mini-list { margin-top: 14px; font-size: 13px; }
.mini-list b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); }
.fin-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px dashed var(--ink-3);
}
.fin-row small { color: var(--ink-3); width: 100%; }
.chat-box {
  height: 260px; overflow-y: auto; background: rgba(255,255,255,.5);
  border: 1.5px solid var(--ink-2); border-radius: 10px; padding: 12px; margin-bottom: 10px;
}
.chat-msg { margin-bottom: 10px; max-width: 85%; }
.chat-msg small { color: var(--ink-3); font-size: 11px; display: block; margin-bottom: 2px; }
.chat-msg div {
  background: var(--paper-2); border-radius: 10px; padding: 7px 12px; font-size: 14px; display: inline-block;
}
.chat-msg.mine { margin-left: auto; text-align: right; }
.chat-msg.mine div { background: var(--ink); color: var(--paper); }
/* ข้อความจากแอดมิน — เด่นชัดว่าเจ้าหน้าที่เข้ามาในวงสนทนา */
.chat-msg.from-admin small { color: var(--plum); font-weight: 700; }
.chat-msg.from-admin div {
  background: var(--paper-2); border: 1.5px solid var(--plum);
}
.chat-msg.from-admin.mine div { background: var(--plum); color: #f6f3ec; border-color: var(--plum-dark); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
  flex: 1; font-family: var(--serif); font-size: 14px; padding: 9px 12px;
  border: 1.5px solid var(--ink-2); background: rgba(255,255,255,.7); border-radius: 8px; outline: none;
}
.chk-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 4px; cursor: pointer; }
.user-chip { display: none; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; padding: 6px 12px; }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--serif); font-size: 14px; cursor: pointer;
  padding: 9px 20px; border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  transition: all .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
/* primary CTA = red seal stamp */
.btn-seal { background: var(--plum); border-color: var(--plum-dark); color: #f6f3ec; }
.btn-seal:hover { background: var(--plum-dark); color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- hero (moonlit ink night) ---------- */
.hero {
  position: relative; overflow: hidden; border-bottom: 2px solid #0d0c0a;
  background:
    radial-gradient(ellipse 90% 70% at 78% 6%, rgba(224,221,209,.14), transparent 55%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, #2a2822 100%);
}
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 72px 20px 250px; position: relative; z-index: 2; text-align: center; }
/* ฉาก hero มืดเสมอ → ตัวอักษรใช้สีสว่างคงที่ (ไม่ผูกกับ --paper ที่เปลี่ยนตามธีม) */
.hero h1 { font-size: clamp(30px, 5vw, 54px); font-weight: 700; letter-spacing: 1px; color: #f6f1e7; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.hero .hanzi {
  font-family: var(--brush); color: #f6f1e7; font-weight: 400;
  font-size: clamp(36px, 6vw, 66px); margin: 0 6px;
  position: relative; display: inline-block;
}
.hero .hanzi::before {
  content: ''; position: absolute; inset: -12px -20px;
  background: radial-gradient(closest-side, rgba(224,221,209,.18), rgba(224,221,209,.06) 60%, transparent 75%);
  border-radius: 55% 45% 60% 40% / 50% 60% 40% 55%;
  z-index: -1; transform: rotate(-6deg);
}
.hero .brush-underline::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M2 12 Q 40 4 80 10 T 160 9 T 240 12 T 298 8' stroke='%23f1efe9' stroke-width='6' fill='none' stroke-linecap='round' opacity='0.75'/%3E%3C/svg%3E");
}
.hero p.sub { margin-top: 22px; color: #ded8ca; font-size: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.hero-scene { position: absolute; inset: auto 0 0 0; width: 100%; height: 430px; z-index: 1; pointer-events: none; }
.hero-branch { position: absolute; top: 0; left: 0; width: 280px; height: 160px; z-index: 1; pointer-events: none; opacity: .95; }

.hero-poem {
  position: absolute; top: 34px; right: 34px; z-index: 2;
  writing-mode: vertical-rl; text-orientation: upright;
  font-family: var(--brush); color: var(--paper);
  display: flex; gap: 10px; align-items: flex-start;
  pointer-events: none; user-select: none;
}
.hero-poem .big { font-size: 42px; letter-spacing: 10px; line-height: 1; }
.hero-poem .small { font-size: 15px; letter-spacing: 6px; color: var(--mist); opacity: .95; padding-top: 6px; }
.hero-poem .poem-seal {
  writing-mode: horizontal-tb; margin-top: 14px; align-self: center;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: var(--plum); color: var(--paper); font-size: 16px;
  border-radius: 4px; transform: rotate(-3deg);
  box-shadow: inset 0 0 5px rgba(0,0,0,.35), 0 0 10px rgba(168,56,74,.35);
}

/* falling plum petals */
.petals { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.petals i {
  position: absolute; top: -16px; width: 8px; height: 10px;
  background: var(--plum); opacity: 0;
  border-radius: 60% 40% 55% 45% / 45% 65% 35% 55%;
  animation: petalFall 12s linear infinite;
}
.petals i:nth-child(1) { left: 6%;  animation-duration: 11s; animation-delay: 0s; }
.petals i:nth-child(2) { left: 13%; animation-duration: 14s; animation-delay: 3s; width: 6px; height: 8px; }
.petals i:nth-child(3) { left: 20%; animation-duration: 12s; animation-delay: 6s; }
.petals i:nth-child(4) { left: 33%; animation-duration: 16s; animation-delay: 1.5s; width: 6px; height: 8px; }
.petals i:nth-child(5) { left: 55%; animation-duration: 15s; animation-delay: 8s; }
.petals i:nth-child(6) { left: 72%; animation-duration: 13s; animation-delay: 4.5s; width: 6px; height: 8px; }
.petals i:nth-child(7) { left: 85%; animation-duration: 17s; animation-delay: 10s; }
.petals i:nth-child(8) { left: 45%; animation-duration: 18s; animation-delay: 12s; width: 5px; height: 7px; }
@keyframes petalFall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: .9; }
  60%  { transform: translate(46px, 340px) rotate(160deg); opacity: .85; }
  100% { transform: translate(90px, 560px) rotate(280deg); opacity: 0; }
}

/* drifting mist + gliding birds + moon glow */
.mist-a { animation: mistDrift 26s ease-in-out infinite; }
.mist-b { animation: mistDrift 34s ease-in-out infinite reverse; }
.mist-c { animation: mistDrift 44s ease-in-out infinite; }
.birds  { animation: birdsGlide 36s ease-in-out infinite alternate; }
.moon-glow { animation: moonPulse 9s ease-in-out infinite; }
.lantern { animation: lanternFlicker 4s ease-in-out infinite; }
@keyframes mistDrift { 0%, 100% { transform: translateX(-46px); } 50% { transform: translateX(46px); } }
@keyframes birdsGlide { from { transform: translate(0, 0); } to { transform: translate(-150px, 14px); } }
@keyframes moonPulse { 0%, 100% { opacity: .18; } 50% { opacity: .3; } }
@keyframes lanternFlicker { 0%, 100% { opacity: .28; } 40% { opacity: .42; } 60% { opacity: .22; } }
/* parallax layers get transform from JS */
.px-far, .px-mid { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .petals i, .mist-a, .mist-b, .mist-c, .birds, .moon-glow, .lantern { animation: none; }
  .ink-intro { display: none; }
}

.search-wrap { margin: 30px auto 0; max-width: 560px; display: flex; gap: 0; }
.search-wrap input {
  flex: 1; font-family: var(--serif); font-size: 15px; padding: 12px 18px;
  border: 2px solid #0d0c0a; border-right: none; background: rgba(241,239,233,.94);
  border-radius: 255px 0 0 15px / 15px 0 0 255px; outline: none; color: var(--ink);
}
.search-wrap button {
  font-family: var(--serif); font-size: 15px; padding: 12px 22px; cursor: pointer;
  border: 2px solid var(--plum-dark); background: var(--plum); color: #f6f3ec;
  border-radius: 0 15px 225px 0 / 0 225px 15px 0;
}
.search-wrap button:hover { background: var(--plum-dark); }
.hero-stats {
  display: inline-flex; justify-content: center; gap: 40px; margin-top: 34px; flex-wrap: wrap;
  position: relative; z-index: 2;
  background: rgba(13,12,10,.5); backdrop-filter: blur(3px);
  padding: 14px 30px; border-radius: 14px; border: 1px solid rgba(241,239,233,.14);
}
.hero-stats div { text-align: center; }
.hero-stats b { font-size: 22px; display: block; color: #f6f1e7; }
.hero-stats span { font-size: 12px; color: #ded8ca; }

/* ---------- categories ---------- */
.cats { max-width: 1200px; margin: 34px auto 0; padding: 0 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.cat {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; cursor: pointer;
  background: var(--paper-2); font-size: 14px; user-select: none; transition: all .15s;
}
.cat .icon-tile { width: 30px; height: 30px; }
.cat.active, .cat:hover { background: var(--ink); color: var(--paper); }
.cat.active .icon-tile, .cat:hover .icon-tile { background: var(--paper); color: var(--ink); transform: rotate(3deg); }

/* ---------- xianxia scripture scroll headers (คัมภีร์วิถีเซียน) ---------- */
.scroll-title { display: inline-flex; align-items: center; }
.scroll-title .roller {
  width: 12px; height: 52px; flex-shrink: 0; position: relative; z-index: 1;
  background: linear-gradient(180deg, #4a463c 0%, #15140f 28%, #15140f 72%, #4a463c 100%);
  border-radius: 6px; box-shadow: inset 0 0 4px #000, 1px 2px 0 rgba(29,28,25,.25);
}
.scroll-title .roller::before, .scroll-title .roller::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 18px; height: 8px; background: #2a2822; border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.15);
}
.scroll-title .roller::before { top: -5px; }
.scroll-title .roller::after { bottom: -5px; }
.scroll-band {
  background:
    linear-gradient(90deg, rgba(29,28,25,.08), transparent 8%, transparent 92%, rgba(29,28,25,.08)),
    var(--paper-2);
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  padding: 9px 24px; font-size: 18px; font-weight: 700; letter-spacing: .5px;
  margin: 0 -4px; white-space: nowrap;
}
.scroll-band .hanzi { font-size: 20px; }
.hero-cloud { position: absolute; z-index: 1; pointer-events: none; }
.hero-cloud.c1 { top: 120px; right: 6%; width: 160px; animation: mistDrift 30s ease-in-out infinite; }
.hero-cloud.c2 { top: 230px; left: 5%; width: 120px; animation: mistDrift 40s ease-in-out infinite reverse; }
.rank-badge {
  font-size: 10px; color: var(--warn); border: 1.5px solid var(--warn);
  border-radius: 4px; padding: 0 5px; white-space: nowrap;
}
@media (max-width: 720px) {
  .scroll-band { font-size: 15px; padding: 8px 14px; white-space: normal; }
  .hero-cloud { display: none; }
}

/* ---------- game carousel (banner cards) ---------- */
.games-head {
  max-width: 1200px; margin: 40px auto 4px; padding: 0 20px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.games-head h2 { font-size: 22px; }
.games-head a { cursor: pointer; font-size: 14px; color: var(--ink-2); text-decoration: underline; user-select: none; }
.game-carousel-wrap { position: relative; max-width: 1200px; margin: 14px auto 0; padding: 0 20px; }
.game-carousel {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 4px;
}
.game-carousel::-webkit-scrollbar { display: none; }
/* การ์ดเกมแบบม้วนคัมภีร์แขวน (hanging scroll) */
.gc-card {
  position: relative; flex: 0 0 calc((100% - 32px) / 3); min-width: 250px;
  cursor: pointer; scroll-snap-align: start;
  display: flex; flex-direction: column; padding: 6px 8px;
  transition: transform .15s;
}
.gc-card:hover { transform: translateY(-4px); }
.gc-roller {
  height: 13px; position: relative; z-index: 2; margin: 0 -4px;
  background: linear-gradient(90deg, #4a463c, #15140f 12%, #15140f 88%, #4a463c);
  border-radius: 7px;
  box-shadow: inset 0 0 4px #000, 1px 2px 0 rgba(29,28,25,.25);
}
.gc-roller::before, .gc-roller::after {
  content: ''; position: absolute; top: 50%; transform: translateY(-50%);
  width: 9px; height: 19px; background: #2a2822; border-radius: 5px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.12);
}
.gc-roller::before { left: -7px; }
.gc-roller::after { right: -7px; }
.gc-paper {
  flex: 1; margin: 0 4px;
  background:
    linear-gradient(90deg, rgba(29,28,25,.06), transparent 10%, transparent 90%, rgba(29,28,25,.06)),
    linear-gradient(180deg, #f3eeda, #e9e2c9);
  border-left: 1.5px solid rgba(29,28,25,.35);
  border-right: 1.5px solid rgba(29,28,25,.35);
  box-shadow: inset 0 6px 10px -6px rgba(29,28,25,.4), inset 0 -6px 10px -6px rgba(29,28,25,.4);
  padding: 14px 14px 13px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
}
.gc-art {
  width: 100%; height: 104px; flex-shrink: 0;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--ink) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--paper);
  box-shadow: 2px 3px 0 rgba(29,28,25,.2);
}
.gc-art svg { width: 38px; height: 38px; }
.gc-paper b { font-size: 18px; color: var(--ink); margin-top: 3px; line-height: 1.3; }
.gc-paper small { font-size: 12px; color: var(--ink-2); }
.gc-btn {
  margin-top: 7px; background: var(--plum); color: #f6f3ec;
  border: 2px solid var(--plum-dark);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 5px 22px; font-size: 13px; transform: rotate(-2deg);
  box-shadow: inset 0 0 5px rgba(0,0,0,.3); transition: all .15s;
}
.gc-card:hover .gc-btn { background: var(--plum-dark); transform: rotate(-2deg) scale(1.07); }
/* ลูกศรแบบตราประทับหมึก (ink stamp) */
.car-arrow {
  position: absolute; top: 50%; z-index: 5;
  width: 44px; height: 44px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 6px rgba(0,0,0,.5), 2px 3px 0 rgba(29,28,25,.3);
  transition: background .15s, transform .15s, opacity .2s;
}
.car-arrow svg { width: 22px; height: 22px; }
.car-arrow.left { left: 2px; transform: translateY(-50%) rotate(-4deg); }
.car-arrow.right { right: 2px; transform: translateY(-50%) rotate(4deg); }
.car-arrow:hover { background: var(--plum); border-color: var(--plum-dark); }
.car-arrow.left:hover { transform: translateY(-50%) rotate(-4deg) scale(1.08); }
.car-arrow.right:hover { transform: translateY(-50%) rotate(4deg) scale(1.08); }
.car-arrow:active { box-shadow: inset 0 0 8px rgba(0,0,0,.6), 1px 1px 0 rgba(29,28,25,.3); }
.car-arrow.disabled { opacity: .3; pointer-events: none; }
.car-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.car-dots span { width: 8px; height: 8px; border-radius: 6px; background: var(--paper-3); transition: all .2s; }
.car-dots span.on { width: 24px; background: var(--warn); }
@media (max-width: 900px) { .gc-card { flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 600px) { .gc-card { flex-basis: 86%; } }

/* ---------- game pages ---------- */
.games-grid {
  max-width: 1200px; margin: 18px auto 8px; padding: 0 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.game-card {
  background: rgba(255,255,255,.55); padding: 18px 12px 14px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 4px 6px 0 rgba(29,28,25,.18); }
.game-card img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 2px solid var(--ink);
}
.game-card b { font-size: 14px; line-height: 1.3; }
.game-card small { color: var(--ink-3); font-size: 12px; }
.game-card-ph {
  width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); border-radius: 14px;
}
.game-card-ph svg { width: 30px; height: 30px; }
.game-header {
  display: flex; align-items: center; gap: 14px;
  width: calc(100% - 40px); max-width: 1160px; margin: 20px auto 0; padding: 14px 18px;
  background: var(--paper-2); border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}
.game-header b { font-size: 20px; }
.game-header small { color: var(--ink-3); }
.gh-icon { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; border: 2px solid var(--ink); }
.gh-ph { width: 52px; height: 52px; border-radius: 12px; }
.gh-ph svg { width: 24px; height: 24px; }

/* ---------- browse layout + filter sidebar ---------- */
.browse-wrap {
  max-width: 1200px; margin: 18px auto 60px; padding: 0 20px;
  display: flex; gap: 20px; align-items: flex-start;
}
.browse-wrap .grid { margin: 0; padding: 0; flex: 1; }
.filter-side {
  width: 250px; flex-shrink: 0; position: sticky; top: 84px;
  background: rgba(255,255,255,.5); border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 16px 16px 14px;
}
.fs-sec + .fs-sec { border-top: 1px dashed var(--ink-3); margin-top: 13px; padding-top: 13px; }
.fs-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; font-size: 15px; }
.fs-tgl { color: var(--ink-3); font-size: 20px; line-height: 1; }
.fs-body { margin-top: 10px; }
.fs-search { display: flex; gap: 6px; }
.fs-search input {
  flex: 1; min-width: 0; font-family: var(--serif); font-size: 13px; padding: 7px 10px;
  border: 1.5px solid var(--ink-2); border-radius: 8px; background: rgba(255,255,255,.7); outline: none;
}
.fs-search button {
  font-family: var(--serif); font-size: 13px; padding: 7px 12px; cursor: pointer;
  background: var(--warn); color: #f6f3ec; border: 2px solid #5f5126; border-radius: 8px;
}
.fs-search button:hover { background: #5f5126; }
.fs-games {
  max-height: 264px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; padding-right: 4px;
}
.fs-game {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 9px; font-size: 13px; color: var(--ink-2); border-radius: 8px; cursor: pointer;
}
.fs-game:hover { background: var(--paper-2); color: var(--ink); }
.fs-game.on { background: var(--ink); color: var(--paper); }
.fs-game .cnt { font-size: 11px; background: var(--paper-3); color: var(--ink-2); border-radius: 10px; padding: 0 7px; flex-shrink: 0; }
.fs-game.on .cnt { background: var(--warn); color: #f6f3ec; }
.range-wrap {
  position: relative; height: 8px; border-radius: 6px; background: var(--paper-3);
  margin: 16px 10px 12px;
}
.range-wrap input[type=range] {
  position: absolute; left: -10px; width: calc(100% + 20px); top: 50%; transform: translateY(-50%);
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
  height: 24px; margin: 0;
}
.range-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink);
  box-shadow: 1px 2px 0 rgba(29,28,25,.25); cursor: grab;
}
.range-wrap input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 15px; height: 15px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink); cursor: grab;
}
.fs-price-label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.fs-clear {
  border: 1.5px solid var(--ink-3); background: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 11px; cursor: pointer; color: var(--ink-3); line-height: 1;
}
.fs-clear:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 900px) {
  .browse-wrap { flex-direction: column; }
  .filter-side { width: 100%; position: static; }
  .fs-games { max-height: 180px; }
}

/* ---------- listings grid ---------- */
.section-title { max-width: 1200px; margin: 40px auto 6px; padding: 0 20px; font-size: 22px; position: relative; }
.section-title .hanzi { font-family: var(--brush); color: var(--ink); margin-right: 8px; font-size: 26px; }
.section-title .wm {
  position: absolute; left: 8px; top: -58px; font-family: var(--brush);
  font-size: 170px; line-height: 1; color: var(--ink); opacity: .05;
  pointer-events: none; user-select: none; z-index: -1;
}
.grid { max-width: 1200px; margin: 18px auto 60px; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: rgba(255,255,255,.55); padding: 18px; cursor: pointer; position: relative;
  transition: transform .15s, box-shadow .15s; overflow: hidden;
}
.card::after {
  content: ''; position: absolute; right: 8px; bottom: 6px; width: 112px; height: 46px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 50'%3E%3Cpath d='M0 50 L22 18 L34 34 L52 8 L70 36 L84 22 L102 42 L120 30 V50 Z' fill='%23b7b4aa' opacity='.3'/%3E%3Ccircle cx='103' cy='11' r='6' fill='%23b7b4aa' opacity='.28'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}
/* ink light sweep on hover */
.card::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(29,28,25,.08) 50%, transparent 60%);
  transform: translateX(-130%);
}
.card:hover::before { transform: translateX(130%); transition: transform .55s ease; }
.card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 4px 6px 0 rgba(29,28,25,.18); }
.card .type-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card .type-row .icon-tile { width: 34px; height: 34px; }
.card .type-row .game { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.game-ico { border-radius: 4px; object-fit: cover; border: 1px solid var(--ink-3); flex-shrink: 0; }
.card h3 { font-size: 16px; line-height: 1.45; min-height: 46px; }
.card .desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; height: 38px; overflow: hidden; }
.card .foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 14px; position: relative; z-index: 1; }
.card .price { font-size: 20px; font-weight: 700; color: var(--ink); }
.card .price small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.card .seller { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.verified-stamp {
  font-size: 10px; color: var(--plum); border: 1.5px solid var(--plum); border-radius: 4px;
  padding: 1px 5px; transform: rotate(-4deg); font-weight: 700; opacity: .9;
}
.card .sold-tag {
  position: absolute; top: 12px; right: 14px; font-size: 11px; color: var(--ink-2);
  background: rgba(241,239,233,.85); padding: 1px 8px; border-radius: 10px;
}
.card-img {
  display: block; width: calc(100% + 36px); height: 150px; object-fit: cover;
  margin: -18px -18px 14px; border-bottom: 2px solid var(--ink);
}
.detail-img {
  display: block; width: calc(100% + 56px); max-height: 260px; object-fit: cover;
  margin: -30px -28px 16px; border-bottom: 2px solid var(--ink);
  border-radius: 14px 14px 0 0;
}
.sell-img-preview {
  display: block; margin-top: 8px; max-width: 100%; max-height: 140px;
  border: 2px solid var(--ink); border-radius: 8px; object-fit: cover;
}
.empty { text-align: center; color: var(--ink-3); padding: 60px 0; grid-column: 1/-1; font-size: 15px; }

/* ---------- how it works (สโคปเป็น .steps .step ไม่ให้รั่วไปโดน stepper ในการ์ดออเดอร์) ---------- */
.steps { max-width: 1200px; margin: 0 auto 70px; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.steps .step { text-align: center; padding: 26px 18px; background: var(--paper-2); }
.steps .step .icon-tile { width: 52px; height: 52px; font-size: 30px; margin-bottom: 14px; }
.steps .step b { display: block; margin-bottom: 8px; font-size: 16px; }
.steps .step p { font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* ---------- footer ---------- */
footer { background: var(--paper-2); position: relative; }
.footer-scene { display: block; width: 100%; height: 96px; margin-bottom: -6px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 26px 20px 30px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); border-top: 2px solid var(--ink); }
footer .hanzi { font-family: var(--brush); color: var(--ink); }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(25, 24, 20, .58); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.overlay.show { display: flex; }
.modal {
  background: var(--paper); width: 100%; max-width: 460px; padding: 30px 28px;
  border: 2px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  position: relative; animation: pop .18s ease;
}
.modal.wide { max-width: 640px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal h2 { font-size: 21px; margin-bottom: 4px; }
.modal h2 .hanzi { font-family: var(--brush); color: var(--ink); margin-right: 6px; }
.modal .subtitle { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.modal .close {
  position: absolute; top: 14px; right: 18px; cursor: pointer; font-size: 22px;
  color: var(--ink-3); background: none; border: none;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 5px; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--serif); font-size: 14px; padding: 9px 12px;
  border: 1.5px solid var(--ink-2); background: rgba(255,255,255,.7); border-radius: 8px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(29,28,25,.12); }
.field textarea { resize: vertical; min-height: 70px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.form-ok { color: var(--ok); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.muted-note { color: var(--ink-3); font-size: 12px; }
.modal .switch-line { text-align: center; font-size: 13px; margin-top: 14px; color: var(--ink-2); }
.modal .switch-line a { color: var(--ink); cursor: pointer; text-decoration: underline; }
.file-drop {
  border: 2px dashed var(--ink-3); border-radius: 10px; padding: 14px; text-align: center;
  font-size: 13px; color: var(--ink-2); cursor: pointer; background: rgba(255,255,255,.45);
}
.file-drop.has-file { border-color: var(--ok); color: var(--ok); }
.kyc-status-box { padding: 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.kyc-none { background: var(--paper-3); }
.kyc-pending { background: #e9e2c9; color: var(--warn); }
.kyc-approved { background: #dde5da; color: var(--ok); }
.kyc-rejected { background: #ecd7d2; color: var(--danger); }

/* ---------- detail modal ---------- */
.detail-price { font-size: 30px; color: var(--ink); font-weight: 700; margin: 12px 0 4px; }
.detail-meta { font-size: 13px; color: var(--ink-2); line-height: 2; border-top: 1px dashed var(--ink-3); border-bottom: 1px dashed var(--ink-3); padding: 10px 0; margin: 14px 0; }

/* ---------- orders table ---------- */
table.orders { width: 100%; border-collapse: collapse; font-size: 13px; }
table.orders th { text-align: left; border-bottom: 2px solid var(--ink); padding: 8px 6px; font-size: 12px; }
table.orders td { padding: 9px 6px; border-bottom: 1px dashed var(--ink-3); vertical-align: top; }
.status-pill { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.st-paid { background: #e9e2c9; color: var(--warn); }
.st-delivered { background: #dde1e7; color: #3c4a5c; }
.st-completed { background: #dde5da; color: var(--ok); }
.st-disputed { background: #ecd7d2; color: var(--danger); }
.st-refunded { background: var(--paper-3); color: var(--ink-2); }

/* ---------- hint bar / order cards / stepper / my shop ---------- */
.hint-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper-2); border-bottom: 1.5px dashed var(--ink-3);
  padding: 9px 16px; font-size: 14px;
}
.order-card {
  border: 2px solid var(--ink); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
  background: rgba(255,255,255,.5);
}
.order-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.order-head small { color: var(--ink-3); }
.order-amount { text-align: right; font-size: 18px; font-weight: 700; white-space: nowrap; }
.order-amount small { font-weight: 400; font-size: 11px; color: var(--ink-3); }
.stepper { display: flex; align-items: center; margin: 6px 0 4px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; }
.step .dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink-3); color: var(--ink-3); font-size: 13px; background: var(--paper);
}
.step small { font-size: 11px; color: var(--ink-3); }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done small { color: var(--ok); }
.step-line { flex: 1; height: 2px; background: var(--ink-3); opacity: .4; margin: 0 4px 18px; min-width: 16px; }
.order-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.order-note { font-size: 13px; color: var(--ink-2); }
.btn-notrec { border-color: var(--danger); color: var(--danger); }
.btn-notrec:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.dispute-link { font-size: 12px; color: var(--danger); text-decoration: underline; cursor: pointer; margin-left: auto; }
.shop-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 4px; border-bottom: 1px dashed var(--ink-3); font-size: 14px;
}
.shop-info { flex: 1; min-width: 200px; }
.shop-info small { display: block; color: var(--ink-3); margin-top: 2px; }

/* ตัวดูรูปหลักฐาน — ต้องลอยทับ modal ออเดอร์เสมอ */
#proofViewer { z-index: 320; background: rgba(20, 17, 12, .88); align-items: center; }
.pv-close {
  position: fixed; top: 18px; right: 20px; z-index: 321;
  width: 44px; height: 44px; font-size: 20px; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 2px 3px 0 rgba(0,0,0,.4);
}
.pv-close:hover { background: var(--plum); border-color: var(--plum-dark); color: #fff; }

/* ---------- rich detail modal ---------- */
.detail-h { font-size: 14px; margin: 14px 0 6px; border-bottom: 1.5px solid var(--ink); padding-bottom: 4px; }
.detail-desc { font-size: 14px; color: var(--ink-2); line-height: 1.8; }
.detail-bullets { margin: 0; padding-left: 6px; list-style: none; }
.detail-bullets li { font-size: 14px; color: var(--ink-2); line-height: 1.9; padding-left: 18px; position: relative; }
.detail-bullets li::before { content: '◆'; position: absolute; left: 0; color: var(--plum); font-size: 10px; top: 4px; }
.auto-badge {
  display: inline-block; margin: 8px 0 2px; font-size: 12px; font-weight: 700;
  color: var(--plum); background: var(--paper-2); border: 1.5px solid var(--plum); border-radius: 20px; padding: 3px 12px;
}
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; font-size: 14px; }
.qty-ctrl { display: flex; align-items: center; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.qty-ctrl button {
  width: 40px; height: 40px; font-size: 20px; cursor: pointer; background: var(--paper-2);
  border: none; color: var(--ink);
}
.qty-ctrl button:hover { background: var(--ink); color: var(--paper); }
.qty-ctrl input {
  width: 60px; height: 40px; text-align: center; border: none; border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink); font-family: var(--serif); font-size: 16px; background: rgba(255,255,255,.7);
  outline: none; -moz-appearance: textfield;
}
.qty-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; }
.code-row { display: flex; gap: 8px; margin-bottom: 4px; }
.code-row input {
  flex: 1; font-family: var(--serif); font-size: 14px; padding: 9px 12px;
  border: 1.5px solid var(--ink-2); border-radius: 8px; background: rgba(255,255,255,.7); outline: none;
  text-transform: uppercase;
}
.detail-total {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper-2); border: 2px solid var(--ink); border-radius: 10px;
  padding: 12px 16px; margin: 10px 0 12px;
}
.detail-total b { font-size: 24px; color: var(--plum); }
.auto-content {
  background: var(--paper-2); border: 1.5px solid var(--plum); border-radius: 10px; padding: 10px 12px; margin: 8px 0;
}
.auto-content small { color: var(--plum); font-weight: 700; }
.auto-content pre {
  margin: 6px 0 0; font-family: monospace; font-size: 14px; white-space: pre-wrap; word-break: break-all;
  background: var(--paper-3); color: var(--ink); padding: 8px 10px; border-radius: 6px; user-select: all;
}
.ac-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.ac-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-actions .btn:disabled { opacity: .45; cursor: default; }
.ac-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ac-row {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--paper-3); border-radius: 6px; padding: 8px;
}
.ac-row input[type="checkbox"] { flex-shrink: 0; cursor: pointer; margin-top: 5px; }
.ac-fields { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ac-f { display: flex; align-items: center; gap: 8px; }
.ac-lab {
  font-size: 11px; color: var(--ink-3); flex-shrink: 0;
  min-width: 54px; text-align: right; letter-spacing: .3px;
}
.ac-text {
  flex: 1; font-family: monospace; font-size: 13px; color: var(--ink);
  word-break: break-all; user-select: all; min-width: 0;
}
.ac-copy { flex-shrink: 0; white-space: nowrap; padding: 3px 8px; font-size: 12px; }
@media (max-width: 560px) {
  .ac-f { flex-wrap: wrap; }
  .ac-lab { min-width: 0; text-align: left; }
  .ac-text { flex-basis: 100%; order: 3; }
}
.order-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.otab {
  font-family: var(--serif); font-size: 13px; padding: 7px 16px; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}
.otab.on { background: var(--ink); color: var(--paper); }
.order-search { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.order-search input {
  flex: 1; font-family: var(--serif); font-size: 13px; padding: 8px 12px;
  border: 1.5px solid var(--ink-2); border-radius: 8px; background: rgba(255,255,255,.7); outline: none;
}
.order-when { color: var(--ink-3); }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) rotate(-1deg);
  background: var(--ink); color: var(--paper); padding: 12px 26px; font-size: 14px;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 200;
}
#toast.show { opacity: 1; }

@media (max-width: 900px) {
  .hero-poem { display: none; }
  .section-title .wm { font-size: 120px; top: -40px; }
}
@media (max-width: 720px) {
  nav { display: none; }
  .hero-inner { padding: 44px 16px 180px; }
  .hero-scene { height: 320px; }
  .hero-branch { width: 190px; height: 110px; }
}
