:root {
  --color-primary: #7c3aed;
  --color-primary-dark: #5b21b6;
  --color-accent: #15803d;
  --color-accent-dark: #166534;
  --color-background: #faf5ff;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f3ff;
  --color-foreground: #1f1635;
  --color-muted: #625b71;
  --color-border: #ddd6fe;
  --color-danger: #b91c1c;
  --shadow-sm: 0 4px 14px rgba(76, 29, 149, 0.08);
  --shadow-md: 0 14px 34px rgba(76, 29, 149, 0.12);
  --radius-md: 14px;
  --radius-lg: 20px;
  --focus-ring: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

* { box-sizing: border-box; }
[hidden], .is-filtered { display: none !important; }

.game-shell { display: grid; gap: 1rem; }
.game-shell > .game-intro { display: none; }
.game-intro, .game-player-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border: 1px solid var(--line, #ddd4ff); border-radius: 1.2rem; background: linear-gradient(135deg, #fff, #f7f3ff); }
.game-intro h1, .game-player-head h1 { margin: .2rem 0 .3rem; }
.game-intro p, .game-player-head p { margin: 0; color: var(--muted, #6b6680); }
.eyebrow { color: #7436df; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.game-mark { display: grid; width: 4rem; height: 4rem; place-items: center; border-radius: 1.2rem; background: #eee5ff; font-size: 2rem; }
.game-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.game-choice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; padding: 1.2rem; border: 1px solid var(--line, #ddd4ff); border-radius: 1.1rem; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 8px 24px rgba(57, 27, 113, .06); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.game-choice:hover, .game-choice:focus-visible { transform: translateY(-2px); border-color: #8b4ce9; box-shadow: 0 12px 30px rgba(94, 44, 185, .14); }
.game-choice-icon { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: .9rem; background: #f2ecff; font-size: 1.5rem; }
.game-choice strong, .game-choice small { display: block; }
.game-choice small { margin-top: .25rem; color: var(--muted, #6b6680); }
.game-choice-arrow { color: #6e2ed1; font-size: 1.5rem; font-weight: 800; }
.back-link { color: #6530c4; font-weight: 700; text-decoration: none; }
.game-frame-wrap { min-height: min(78vh, 900px); overflow: hidden; border: 1px solid var(--line, #ddd4ff); border-radius: 1.1rem; background: #050509; box-shadow: 0 12px 35px rgba(35, 18, 74, .16); }
.game-frame { display: block; width: 100%; height: min(78vh, 900px); min-height: 620px; border: 0; background: #000; }
@media (max-width: 700px) { .game-intro, .game-player-head { align-items: flex-start; flex-direction: column; padding: 1rem; } .game-choice-grid { grid-template-columns: 1fr; } .game-frame-wrap, .game-frame { min-height: 72vh; height: 72vh; border-radius: .8rem; } }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: "Be Vietnam Pro", "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 10% 0%, rgba(167, 139, 250, 0.24), transparent 32rem),
    linear-gradient(180deg, var(--color-background) 0%, #f8fafc 72%);
  color: var(--color-foreground);
}

a { color: var(--color-primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--color-foreground);
  color: #fff;
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(115deg, #241044 0%, #4c1d95 56%, #6d28d9 100%);
  color: #fff;
  padding: 8px max(18px, calc((100vw - 1200px) / 2));
  box-shadow: 0 8px 24px rgba(49, 20, 96, 0.18);
}
.topbar-main { display: flex; flex: 1; align-items: center; gap: 10px; }
.brand { color: #fff; font-size: .95rem; font-weight: 800; letter-spacing: 0.1px; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 6px; border-radius: 9px; background: rgba(255,255,255,.18); vertical-align: middle; }
.wallet-pill { display: inline-flex; align-items: baseline; gap: 6px; margin-left: 6px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; background: rgba(255,255,255,.13); color: #fff; white-space: nowrap; }
.wallet-pill span { font-size: .75rem; font-weight: 700; opacity: .8; }
.wallet-pill strong { color: #fff; font-size: 1rem; font-variant-numeric: tabular-nums; }
.primary-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 2px; }
.nav-toggle { display: none; width: auto; min-height: 42px; padding: 8px 13px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); }
.topbar a, .nav-link-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 9px;
  color: #f5f3ff;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-decoration: none;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.topbar a:hover, .nav-link-button:hover { color: #fff; background: rgba(255,255,255,.14); transform: translateY(-1px); }
.topbar form { margin: 0; }

.container { width: min(1200px, calc(100% - 32px)); margin: 16px auto 54px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); margin: 0 0 8px; }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 0 0 8px; }
h3 { font-size: 1.08rem; }
.eyebrow { color: var(--color-primary); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hint { color: var(--color-muted); font-size: .9rem; }

.card {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 24px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.panel { background: rgba(255,255,255,.94); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: clamp(16px, 2.5vw, 24px); box-shadow: var(--shadow-sm); }
.narrow { max-width: 540px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 14px; border-radius: 11px; background: var(--color-surface-muted); color: var(--color-primary-dark); font-weight: 750; text-decoration: none; }
.button-link:hover { background: var(--color-primary); color: #fff; }
.card:hover { box-shadow: var(--shadow-md); }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.panel-card { display: flex; flex-direction: column; min-height: 300px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.player-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: linear-gradient(135deg, #fff, #f5f3ff); }
.player-inline { padding: 9px 13px; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; font-size: .9rem; }
.player-inline .k { margin-right: 5px; color: var(--color-muted); font-weight: 700; }

label { display: block; margin: 12px 0 7px; font-weight: 700; }
input, select, button { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfc6e5; border-radius: 11px; background: #fff; color: var(--color-foreground); font: inherit; }
input::placeholder { color: #817992; }
button { border-color: transparent; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: #fff; cursor: pointer; font-weight: 750; transition: transform .2s ease, filter .2s ease, box-shadow .2s ease; }
button:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 7px 16px rgba(91, 33, 182, .22); }
button:disabled { cursor: wait; opacity: .58; transform: none; box-shadow: none; }
.btn, .btn.primary { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 120px; text-decoration: none; }
.btn-danger { background: linear-gradient(135deg, #dc2626, var(--color-danger)); }
.form-grid { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); gap: 12px 18px; align-items: end; }
.form-grid label { margin: 0; }
.form-grid button { grid-column: 1 / -1; justify-self: start; }
.login-wrap { width: min(460px, calc(100% - 28px)); margin: clamp(36px, 10vh, 90px) auto; }
.login-wrap > h1 { text-align: center; }
.login-wrap .card { padding: clamp(20px, 5vw, 34px); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin: 16px 2px 8px; font-weight: 700; }
.auth-links a { min-height: 44px; display: inline-flex; align-items: center; }
.auth-links a:last-child { color: var(--color-primary); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.tab { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface-muted); color: var(--color-foreground); text-decoration: none; font-weight: 700; transition: .2s ease; }
.tab:hover, .tab.active { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.shop-table-wrap { overflow-x: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 11px; border-bottom: 1px solid #ece8f5; text-align: left; vertical-align: middle; }
th { color: var(--color-muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:hover { background: #faf7ff; }
.item-icon { display: block; width: 42px; height: 42px; border: 1px solid var(--color-border); border-radius: 11px; background: #fff; object-fit: contain; }
.item-name { font-weight: 750; }
.item-id { color: var(--color-muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-products-card { padding-bottom: 22px; }
.admin-product-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.admin-product-panel { min-width: 0; padding: 14px; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; }
.admin-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.admin-panel-heading h3 { margin: 0 0 3px; font-size: 1.05rem; }
.admin-panel-heading p { margin: 0; color: var(--color-muted); font-size: .8rem; }
.admin-panel-heading .section-count { flex: 0 0 auto; }
.admin-panel-scroll { max-height: min(62vh, 680px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #a78bfa transparent; }
.admin-panel-scroll::-webkit-scrollbar { width: 7px; }
.admin-panel-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: #a78bfa; }
.admin-panel-scroll .admin-items-table { min-width: 620px; }
.admin-panel-scroll .admin-items-table th, .admin-panel-scroll .admin-items-table td { padding: 10px 7px; }
.admin-panel-scroll .item-icon { width: 38px; height: 38px; }
.admin-panel-scroll .inline-form { gap: 5px; }
.admin-panel-scroll input[type="text"], .admin-panel-scroll input[type="number"] { min-width: 76px; padding: 8px 9px; }
.admin-panel-scroll button { min-width: 58px; padding: 8px 9px; }
.admin-panel-check { text-align: center; }
.admin-catalog-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 10px 14px; border-radius: 14px; background: #f5f3ff; color: var(--color-muted); }
.admin-catalog-summary strong { color: var(--color-primary-dark); font-size: 1.25rem; line-height: 1; }
.admin-catalog-summary span { font-size: .78rem; font-weight: 700; }
.admin-product-search { margin: 12px 0 14px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 14px; background: #fbfaff; }
.admin-product-search label { margin: 0 0 6px; color: var(--color-muted); font-size: .82rem; font-weight: 800; }
.admin-product-search .search-row { align-items: center; }
.admin-product-search .search-row .btn { min-height: 44px; }
.admin-result-count, .admin-help { color: var(--color-muted); font-size: .88rem; }
.admin-items-table-wrap { overflow-x: auto; }
.admin-items-table { min-width: 820px; }
.admin-items-table input[type="text"], .admin-items-table input[type="number"] { width: 100%; min-width: 92px; margin: 0; }
.admin-items-table button { margin: 0; width: auto; min-width: 72px; }
.admin-check-label { display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--color-muted); font-size: .75rem; font-weight: 700; }
.admin-check-label input { width: 19px; height: 19px; accent-color: var(--color-primary); }
.admin-empty-state { padding: 32px 12px; text-align: center; color: var(--color-muted); }
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.admin-pagination .btn { min-width: 88px; min-height: 38px; padding: 7px 12px; }
.price { color: var(--color-primary-dark); font-weight: 800; font-variant-numeric: tabular-nums; }
.buy-qty { width: 92px; min-width: 76px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { min-width: 100px; }
.inline-form button { width: auto; margin-top: 0; }

.scroll-wrap { overflow: auto; max-height: 430px; border: 1px solid #ece8f5; border-radius: 13px; }
.simple-table thead th { position: sticky; top: 0; z-index: 1; background: #fbfaff; }
.search-input { max-width: 260px; margin: 0; background: #fbfaff; }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.status-pending, .status-purchase_pending, .status-sold_pending_credit, .status-cancel_pending_return, .status-expired_pending_return { background: #fef3c7; color: #92400e; }
.status-approved, .status-sold, .status-cancelled, .status-expired { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-active { background: #dbeafe; color: #1d4ed8; }
.flash-wrap { margin-bottom: 16px; }
.flash { padding: 12px 14px; border: 1px solid #fcd34d; border-radius: 11px; background: #fffbeb; color: #78350f; }
.stack-form { display: flex; flex-direction: column; gap: 8px; }
.stack-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-actions button { width: auto; margin: 0; }
.market-box { min-height: 0; }
.market-toolbar { display: flex; align-items: end; justify-content: stretch; gap: 12px; min-height: 0; padding: 12px 16px; }
.wallet-highlight { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 14px; background: linear-gradient(135deg, #f5f3ff, #fff); }
.wallet-highlight span { color: var(--color-muted); font-size: .82rem; font-weight: 700; }
.wallet-highlight strong { color: var(--color-primary-dark); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.search-bar { flex: 1; width: 100%; max-width: none; }
.search-bar label { margin: 0 0 6px; color: var(--color-muted); font-size: .82rem; }
.search-row { display: flex; width: 100%; gap: 8px; }
.search-row input { min-width: 0; flex: 1; }
.search-row button { width: auto; min-width: 120px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 3px; }
.section-heading p { margin: 0; }
.section-count { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: var(--color-surface-muted); color: var(--color-primary-dark); font-size: .82rem; font-weight: 800; }
.listing-grid, .sell-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sell-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trade-scroll-panel { max-height: 540px; overflow-y: auto; overflow-x: hidden; padding: 2px 8px 8px 2px; scrollbar-width: thin; scrollbar-color: #a78bfa transparent; }
.trade-scroll-panel::-webkit-scrollbar { width: 7px; }
.trade-scroll-panel::-webkit-scrollbar-track { background: transparent; }
.trade-scroll-panel::-webkit-scrollbar-thumb { min-height: 42px; border: 2px solid transparent; border-radius: 999px; background: #a78bfa; background-clip: padding-box; }
.trade-scroll-panel::-webkit-scrollbar-thumb:hover { background: #7c3aed; background-clip: padding-box; }
.listing-card, .sell-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 16px; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.listing-card:hover, .sell-card:hover { box-shadow: var(--shadow-md); }
.listing-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.listing-main h3 { margin: 0 0 3px; overflow-wrap: anywhere; }
.listing-main .hint { margin: 0; }
.item-icon-lg { width: 56px; height: 56px; flex: 0 0 56px; }
.listing-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.listing-meta div { min-width: 0; padding: 9px 10px; border-radius: 10px; background: #faf8ff; }
.listing-meta dt { color: var(--color-muted); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.listing-meta dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.listing-cta, .sell-card > form > button { width: 100%; }
.sell-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.sell-form .form-field label { margin: 0 0 5px; font-size: .78rem; }
.sell-form button { grid-column: 1 / -1; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 130px; padding: 22px; border: 1px dashed var(--color-border); border-radius: 14px; color: var(--color-muted); text-align: center; }
.empty-state strong { color: var(--color-foreground); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid #ece8f5; border-radius: 12px; }
.history-card > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.history-card strong { overflow-wrap: anywhere; }
.history-value { white-space: nowrap; color: var(--color-primary-dark); font-weight: 800; font-variant-numeric: tabular-nums; }
.trade-page { max-height: none; overflow: visible; padding: 0 10px 20px 4px; }
.trade-page .market-scroll { height: auto; min-height: 0; max-height: none; overflow: visible; scrollbar-gutter: auto; }
.trade-page-spacer { height: 8px; }
.compact-listing { flex-direction: row; align-items: center; justify-content: space-between; }
.compact-listing form { flex: 0 0 auto; }
.compact-listing form button { width: auto; min-width: 100px; }
.market-scroll {
  height: min(560px, calc(100vh - 330px));
  min-height: 260px;
  max-height: 560px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#buyConfirmModal { padding: 18px; background: rgba(31, 22, 53, .62) !important; backdrop-filter: blur(5px); }
#buyConfirmModal > div { width: min(460px, 100%); margin: 12vh auto !important; border: 1px solid var(--color-border); border-radius: var(--radius-lg) !important; padding: 22px !important; box-shadow: var(--shadow-md); }
#buyConfirmModal button { width: auto; min-width: 100px; }
.admin-topbar { background: linear-gradient(115deg, #14532d, #166534); padding-top: 4px; padding-bottom: 4px; }
.admin-topbar .admin-nav { flex: 1; flex-wrap: nowrap; gap: 1px; }
.admin-topbar .admin-nav a, .admin-topbar .admin-nav .nav-link-button { min-height: 32px; padding: 4px 8px; font-size: .9rem; white-space: nowrap; }

@media (max-width: 900px) {
  .topbar { align-items: stretch; flex-direction: column; padding: 12px 16px; }
  .topbar-main { justify-content: space-between; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .primary-nav { display: none; width: 100%; padding-top: 8px; }
  .primary-nav.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primary-nav a, .primary-nav .nav-link-button { width: 100%; justify-content: flex-start; }
  .grid.two { grid-template-columns: 1fr; }
  .listing-grid, .sell-grid { grid-template-columns: 1fr; }
  .admin-topbar { flex-direction: row; align-items: center; overflow-x: auto; }
  .admin-topbar .admin-nav { display: flex; width: auto; padding-top: 0; overflow-x: auto; }
  .admin-product-columns { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { width: min(100% - 20px, 1200px); margin-top: 18px; }
  .page-heading { display: block; }
  .card { border-radius: 16px; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid button { grid-column: auto; width: 100%; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .wallet-pill { margin-left: auto; }
  .market-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .trade-page { max-height: none; overflow: visible; padding-right: 4px; }
  .search-bar { max-width: none; }
  .search-row button { min-width: 108px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .listing-grid, .sell-grid { grid-template-columns: 1fr; }
  .sell-form { grid-template-columns: 1fr 1fr; }
  .sell-form .form-field:last-of-type { grid-column: 1 / -1; }
  .compact-listing { align-items: stretch; flex-direction: column; }
  .compact-listing form button { width: 100%; }
  .history-card { grid-template-columns: 1fr auto; }
  .history-value { grid-column: 1 / -1; }
  .search-input { width: 100%; max-width: none; }
  .shop-table-wrap { margin: 0 -4px; }
  .admin-panel-scroll .admin-items-table { min-width: 0; }
  th, td { padding: 11px 8px; }
  .shop-table-wrap table { min-width: 0; }
  .shop-table-wrap table, .shop-table-wrap thead, .shop-table-wrap tbody, .shop-table-wrap tr, .shop-table-wrap td { display: block; width: 100%; }
  .shop-table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .shop-table-wrap tr { margin-bottom: 12px; padding: 12px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
  .shop-table-wrap td { display: grid; grid-template-columns: minmax(92px, 34%) minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #f0edf7; }
  .shop-table-wrap td:last-child { border-bottom: 0; }
  .shop-table-wrap td::before { content: attr(data-label); color: var(--color-muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
  .shop-table-wrap td form { width: 100%; }
  .market-scroll {
    height: min(560px, calc(100vh - 260px));
    min-height: 260px;
    max-height: 560px;
    overflow-y: auto;
    border: 0;
    scrollbar-gutter: stable;
  }
  .market-scroll table, .market-scroll thead, .market-scroll tbody, .market-scroll tr, .market-scroll td { display: block; width: 100%; }
  .market-scroll thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .market-scroll tr { margin-bottom: 12px; padding: 12px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
  .market-scroll td { display: grid; grid-template-columns: minmax(92px, 34%) minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #f0edf7; }
  .market-scroll td:last-child { border-bottom: 0; }
  .market-scroll td::before { content: attr(data-label); color: var(--color-muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
  .market-scroll td[colspan] { display: block; }
  .market-scroll td[colspan]::before { content: none; }
  .market-scroll td form { width: 100%; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
