@import url('https://fonts.googleapis.com/css2?family=Mitr:wght@200;300;400;500;600;700&display=swap');

:root {
  --bg: #f4f9fc;
  --paper: #ffffff;
  --paper-soft: #eef7fb;
  --ink: #102033;
  --text: var(--ink);
  --muted: #637386;
  --line: #dce8ef;
  --blue: #177ddc;
  --blue-2: #46b6ee;
  --aqua: #dff6ff;
  --gold: #f0ad24;
  --green: #18a66a;
  --shadow: 0 18px 50px rgba(26, 83, 124, 0.13);
}

:root[data-theme="dark"] {
  --bg: #08111c;
  --paper: #101b2a;
  --paper-soft: #16263a;
  --ink: #f4f9ff;
  --text: var(--ink);
  --muted: #9fb3c8;
  --line: #263a50;
  --blue: #55b8ff;
  --blue-2: #238ce0;
  --aqua: #102c40;
  --gold: #f3b73a;
  --green: #45d695;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.95; }
}

@keyframes soft-glow {
  0%, 100% { filter: drop-shadow(0 0 2px currentColor); opacity: 0.8; }
  50% { filter: drop-shadow(0 0 6px currentColor); opacity: 1; }
}

@keyframes premium-shine {
  0% { transform: translateX(-150%) skewX(-25deg); }
  100% { transform: translateX(150%) skewX(-25deg); }
}

@keyframes floating-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 8%, rgba(70, 182, 238, 0.18), transparent 24rem),
    linear-gradient(180deg, #f8fcff 0%, var(--bg) 45%, #eef6fb 100%);
  color: var(--ink);
  font-family: 'Mitr', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ปรับความหนาของหัวข้อให้ไม่หนาเกินไป */
h1, h2, h3, strong {
  font-weight: 400;
  line-height: 1.4;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% 8%, rgba(85, 184, 255, 0.16), transparent 24rem),
    linear-gradient(180deg, #07101b 0%, var(--bg) 48%, #060c14 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 125, 220, 0.24);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  transition: background 0.3s ease;
}

:root[data-theme="dark"] .site-header {
  background: rgba(8, 17, 28, 0.86);
}

.nav {
  display: grid;
  grid-template-columns: minmax(178px, auto) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  min-width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--paper-soft);
  box-shadow: 0 10px 28px rgba(23, 125, 220, 0.2);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 6px;
  min-width: 0;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--paper-soft);
  color: var(--blue);
}

.nav-links a.is-nav-locked {
  position: relative;
  padding-right: 34px;
  opacity: 0.68;
}

.nav-links a.is-nav-locked.has-lock-bubble {
  min-height: 44px;
  padding-top: 17px;
}

.nav-links a.is-nav-locked::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 16px;
  height: 16px;
  background-image: var(--rooc-lock-icon-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  transform: translateY(-50%);
}

.nav-links a.has-lock-bubble::before,
.market-tabs button.has-lock-bubble::before,
.game-option.has-lock-bubble::after,
[data-category-card].has-lock-bubble::after {
  position: absolute;
  z-index: 12;
  content: attr(data-lock-bubble-text);
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(20, 26, 34, 0.92);
  color: #f4c86a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.nav-links a.has-lock-bubble::before {
  top: 2px;
  right: 8px;
  font-size: 8px;
  padding: 3px 6px;
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.game-switcher {
  display: flex;
  min-height: 54px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.game-switcher-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.game-switcher-options {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.game-option {
  display: inline-flex;
  min-height: 40px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 12px 5px 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.game-option strong,
.game-option small {
  display: block;
  white-space: nowrap;
}

.game-option strong {
  font-size: 12px;
}

.game-option.has-game-background {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.game-option.has-game-background small {
  color: rgba(255, 255, 255, 0.88);
}

.game-background-position {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.game-background-position label {
  display: grid;
  gap: 4px;
}

.game-background-position label > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.game-background-position input[type="range"] {
  width: 100%;
}

.clear-setting-image {
  margin-top: 10px;
  color: var(--expired);
}

.game-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.game-option-icon.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: none;
}

.game-option.is-active {
  border-color: rgba(23, 125, 220, 0.5);
  background: rgba(23, 125, 220, 0.08);
  box-shadow: inset 0 0 0 1px rgba(23, 125, 220, 0.08);
}

.game-option.is-locked {
  cursor: pointer;
  opacity: 0.58;
}

.game-option.is-locked:hover {
  opacity: 0.8;
}

.game-option.is-available {
  border-color: rgba(38, 166, 91, 0.5);
  background: rgba(38, 166, 91, 0.09);
  cursor: pointer;
}

.game-option.is-available:hover {
  border-color: rgba(38, 166, 91, 0.78);
  transform: translateY(-1px);
}

.game-option-lock {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--paper-soft);
  font-size: 13px;
}

.game-option.is-locked .game-option-lock {
  background-color: var(--paper-soft);
  background-image: var(--rooc-lock-icon-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 72%;
}

.game-option.has-lock-bubble::after {
  top: -10px;
  right: 12px;
}

.game-switcher-message {
  min-height: 16px;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.user-menu {
  position: relative;
}

.user-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mailbox-menu {
  position: relative;
}

.mailbox-trigger {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  color: var(--blue);
  box-shadow: 0 8px 24px rgba(26, 83, 124, 0.12);
}

.mailbox-trigger span {
  font-size: 18px;
  line-height: 1;
}

.mailbox-trigger b {
  position: absolute;
  top: -5px;
  right: -4px;
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: #ff4d67;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.mailbox-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 31;
  width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.mailbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.mailbox-head a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.mailbox-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
}

.mailbox-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.mailbox-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.mailbox-item:hover {
  background: var(--paper-soft);
}

.mailbox-item.is-new {
  background: color-mix(in srgb, var(--aqua) 55%, var(--paper));
}

.mailbox-item strong {
  color: #d89000;
}

.mailbox-item small,
.mailbox-item em {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.mailbox-item em {
  font-style: normal;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  padding: 5px 12px 5px 6px;
}

.user-menu-trigger img {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  object-fit: cover;
}

.user-menu-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-trigger strong {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
  background: rgba(247, 181, 0, 0.18);
  color: #f7b500;
  font-size: 14px;
  line-height: 1;
}

.user-menu-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  padding: 6px;
}

.user-menu-panel a,
.user-menu-panel button {
  display: flex;
  width: 100%;
  align-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 11px 12px;
  text-align: left;
  text-decoration: none;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: var(--paper-soft);
}

.user-menu-panel .premium-link {
  color: #f7b500;
}

.user-menu-panel button {
  color: #ff6f7d;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 12px 28px rgba(23, 125, 220, 0.22);
}

.btn-light {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  width: 58px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, #dff6ff, #ffffff);
  box-shadow: inset 0 1px 3px rgba(16, 32, 51, 0.1);
  transition: background 180ms ease, border-color 180ms ease;
}

.switch-ball {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, var(--gold));
  box-shadow: 0 6px 14px rgba(16, 32, 51, 0.18);
  transition: transform 180ms ease, background 180ms ease;
}

.theme-switch input:checked + .switch-track {
  background: linear-gradient(135deg, #102033, var(--blue));
}

.theme-switch input:checked + .switch-track .switch-ball {
  background: linear-gradient(145deg, #dff6ff, #55b8ff);
  transform: translateX(26px);
}

.theme-switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(23, 125, 220, 0.24);
  outline-offset: 3px;
}

.btn-secondary {
  width: 100%;
  background: #0d5fa7;
  color: #fff;
}

.btn-small {
  min-height: 36px;
  padding: 0 13px;
  background: var(--paper-soft);
  color: var(--blue);
}

.btn-sold {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.14);
  color: #ff8b8b;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 0 22px;
  background:
    linear-gradient(90deg, rgba(248, 252, 255, 0.98) 0%, rgba(248, 252, 255, 0.88) 43%, rgba(248, 252, 255, 0.2) 70%),
    linear-gradient(180deg, rgba(248, 252, 255, 0.18), rgba(248, 252, 255, 0.9)),
    url("assets/hero-rooc.png");
  background-position: center right;
  background-size: cover;
  border-bottom: 0;
}

:root[data-theme="dark"] .hero {
  background:
    linear-gradient(90deg, rgba(8, 17, 28, 0.96) 0%, rgba(8, 17, 28, 0.84) 43%, rgba(8, 17, 28, 0.24) 74%),
    linear-gradient(180deg, rgba(8, 17, 28, 0.2), rgba(8, 17, 28, 0.92)),
    url("assets/hero-rooc.png");
  background-position: center right;
  background-size: cover;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 40px;
  align-items: center;
  min-height: 400px;
}

.hero-announcement {
  position: relative;
  z-index: 3;
  margin-bottom: 10px;
}

.hero-announcement[hidden] {
  display: none;
}

.announcement-marquee {
  display: flex;
  gap: 44px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #b77900 46%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #f5b301 13%, var(--paper));
  color: #b77900;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 9px 0;
  white-space: nowrap;
}

.announcement-marquee span {
  flex: 0 0 auto;
  min-width: 100%;
  padding-inline: 22px;
  animation: announcementScroll 26s linear infinite;
}

:root[data-theme="dark"] .announcement-marquee {
  background: rgba(181, 119, 0, 0.14);
  color: #d99a00;
}

@keyframes announcementScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - 44px));
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 8px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(38px, 5.4vw, 70px);
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 610px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.search-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 12px;
  align-items: end;
  max-width: 560px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: var(--shadow);
}

.search-input {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 0 14px;
}

.search-input svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--blue);
}

.search-input input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.search-card label,
.filters label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-card select,
.filters select,
.section-head select {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin-top: 18px;
}

.trust-row div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  padding: 14px;
}

.trust-row strong,
.trust-row span {
  display: block;
}

.trust-row strong {
  color: var(--blue);
  font-size: 24px;
}

.trust-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-art {
  position: relative;
  display: grid;
  min-height: 330px;
  align-items: center;
  pointer-events: none;
}

.hero-sponsor-wrapper {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
}

.hero-sponsor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
  overflow: hidden;
  border-radius: 28px;
  background: #0c141f;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-sponsor-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(85, 184, 255, 0.5), transparent 40%, rgba(85, 184, 255, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

.hero-sponsor-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 40px 100px rgba(23, 125, 220, 0.2);
}

.hero-sponsor-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.4) 0%,
    transparent 50%
  );
  content: "";
  z-index: 1;
}

.hero-sponsor-card .sponsor-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 0;
}

.hero-sponsor-card .sponsor-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-sponsor-card .sponsor-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  opacity: 1;
}

.hero-sponsor-card:hover img {
  transform: scale(1.1);
  opacity: 1;
}

.hero-sponsor-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: transparent;
  pointer-events: none;
}

.hero-sponsor-content * {
  pointer-events: auto;
}

.hero-sponsor-content p {
  width: fit-content;
  margin: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  color: #fff;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(23, 125, 220, 0.4);
}

.hero-sponsor-content h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(15px, 1.8vw, 20px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 1), 0 0 4px rgba(0, 0, 0, 0.5);
}

.hero-sponsor-content span {
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 1), 0 0 3px rgba(0, 0, 0, 0.5);
}

.hero-sponsor-content .btn {
  width: fit-content;
  margin-top: 4px;
}

.hero-art:not(.has-sponsor) {
  pointer-events: none;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 24px;
}

.category-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(1.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border-radius: 12px;
  z-index: 10;
  cursor: not-allowed;
  pointer-events: auto;
  animation: lockFadeIn 0.3s ease-out;
}

[data-category-card].has-lock-bubble::after {
  top: 10px;
  right: 10px;
}

@keyframes lockFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.sold-strip[hidden] {
  display: none;
}

.sold-strip {
  margin-top: 14px;
  margin-bottom: 16px;
}

.sold-strip-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.sold-strip-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.sold-strip-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sold-scroller {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.sold-track {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 12px;
  animation: soldSlideLeft 32s linear infinite;
  will-change: transform;
}

.sold-scroller:hover .sold-track {
  animation-play-state: paused;
}

.sold-scroller.is-static .sold-track {
  animation: none;
}

@keyframes soldSlideLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 6px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sold-track {
    animation: none;
  }
}

.sold-scroller {
  overscroll-behavior-inline: contain;
  padding: 2px 2px 10px;
}

.sold-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 78px;
  width: 220px;
  flex: 0 0 220px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  box-shadow: 0 12px 28px rgba(26, 83, 124, 0.08);
  opacity: .78;
  padding: 10px;
  scroll-snap-align: start;
}

.sold-card img {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
  object-fit: cover;
  filter: grayscale(.22);
}

.sold-card h3 {
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sold-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sold-card strong {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  color: #ff8585;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
}

.sold-card strong.is-buy-completed {
  background: rgba(34, 197, 94, 0.16);
  color: #45d97a;
}

.category-row article,
.filters,
.listing-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 16px 40px rgba(26, 83, 124, 0.08);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}



.category-row article {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 96px;
  padding: 16px;
  transition: all 250ms ease;
  cursor: pointer;
}

.category-row article:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: 0 12px 30px rgba(26, 83, 124, 0.12);
}

.category-row h2 {
  margin-bottom: 4px;
  font-size: 17px;
}

.category-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.category-icon {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  transition: all 250ms ease;
}

:root[data-theme="dark"] .category-icon {
  background: transparent;
}

.category-row article:hover .category-icon {
  transform: scale(1.05);
}

.category-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.market-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 48px;
}

.index-chat-sidebar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 25;
  display: block;
  width: min(340px, calc(100vw - 28px));
}

.chat-notification-bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid color-mix(in srgb, #ffb020 52%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #ffb020 10%, var(--paper));
  box-shadow: 0 14px 36px rgba(3, 17, 29, 0.28);
  padding: 10px;
  color: var(--ink);
  animation: chatNotificationBubbleIn 180ms ease-out;
}

.chat-notification-bubble[hidden] {
  display: none;
}

.chat-notification-bubble::after {
  position: absolute;
  right: 25px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid color-mix(in srgb, #ffb020 52%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, #ffb020 52%, var(--line));
  background: color-mix(in srgb, #ffb020 10%, var(--paper));
  content: "";
  transform: rotate(45deg);
}

.chat-notification-bubble-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, #ffb020 18%, var(--paper));
  color: #e19200;
}

.chat-notification-bubble-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.chat-notification-bubble span:nth-child(2) {
  min-width: 0;
}

.chat-notification-bubble strong,
.chat-notification-bubble small {
  display: block;
}

.chat-notification-bubble strong {
  font-size: 12px;
}

.chat-notification-bubble small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.chat-notification-bubble button {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 6px;
  background: #ffb020;
  padding: 7px 9px;
  color: #17202b;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.chat-notification-bubble.is-denied {
  border-color: color-mix(in srgb, #ff5c70 52%, var(--line));
  background: color-mix(in srgb, #ff5c70 9%, var(--paper));
}

.chat-notification-bubble.is-denied::after {
  border-color: color-mix(in srgb, #ff5c70 52%, var(--line));
  background: color-mix(in srgb, #ff5c70 9%, var(--paper));
}

.chat-notification-bubble.is-denied .chat-notification-bubble-icon {
  background: color-mix(in srgb, #ff5c70 16%, var(--paper));
  color: #ff5c70;
}

@keyframes chatNotificationBubbleIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.index-chat-panel {
  overflow: hidden;
  max-height: min(520px, calc(100vh - 100px));
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 98%, transparent);
  box-shadow: 0 22px 60px rgba(3, 17, 29, 0.34);
  transform-origin: bottom right;
  animation: indexChatExpand 160ms ease-out;
}

@keyframes indexChatExpand {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.index-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 17px;
  background: color-mix(in srgb, var(--paper-soft) 74%, var(--paper));
}

.index-chat-head .eyebrow {
  margin-bottom: 3px;
}

.index-chat-head h2 {
  margin: 0;
  font-size: 18px;
}

.index-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.index-chat-minimize,
.index-chat-notification {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--ink);
}

.index-chat-minimize:hover,
.index-chat-notification:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  color: var(--blue);
}

.index-chat-minimize svg,
.index-chat-notification svg,
.index-chat-launcher svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.index-chat-notification .bell-off {
  display: none;
}

.index-chat-notification.is-enabled {
  border-color: color-mix(in srgb, #20c997 48%, var(--line));
  background: color-mix(in srgb, #20c997 13%, var(--paper));
  color: #20a77f;
}

.index-chat-notification.is-denied {
  color: #ff5c70;
}

.index-chat-notification.is-denied .bell-on {
  display: none;
}

.index-chat-notification.is-denied .bell-off {
  display: block;
}

.index-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.index-chat-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.index-chat-status.is-online i {
  background: #20c997;
  box-shadow: 0 0 0 3px color-mix(in srgb, #20c997 18%, transparent);
}

.index-chat-list {
  max-height: min(430px, calc(100vh - 188px));
  overflow-y: auto;
  background: color-mix(in srgb, var(--paper-soft) 34%, var(--paper));
  scrollbar-width: thin;
}

.index-chat-launcher {
  position: relative;
  display: none;
  width: 54px;
  height: 54px;
  margin-left: auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 48%, var(--line));
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 14px 34px rgba(23, 125, 220, 0.34);
}

.index-chat-launcher svg {
  width: 24px;
  height: 24px;
}

.index-chat-launcher b {
  position: absolute;
  top: -4px;
  right: -3px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: #ff4d67;
  padding-inline: 4px;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.index-chat-launcher b[hidden] {
  display: none;
}

.index-chat-sidebar.is-collapsed {
  width: 54px;
}

.index-chat-sidebar.is-collapsed .chat-notification-bubble {
  right: 0;
}

.index-chat-sidebar.is-collapsed .index-chat-panel {
  display: none;
}

.index-chat-sidebar.is-collapsed .index-chat-launcher {
  display: grid;
}

.index-chat-room {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 14px 16px;
  color: var(--ink);
  text-align: left;
}

.index-chat-room:hover {
  background: color-mix(in srgb, var(--blue) 6%, var(--paper));
}

.index-chat-room.is-unread {
  box-shadow: inset 3px 0 0 var(--blue);
  background: color-mix(in srgb, var(--blue) 9%, var(--paper));
}

.index-chat-room.is-unread .index-chat-copy em {
  color: var(--ink);
  font-weight: 800;
}

.index-chat-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 46%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 15%, var(--paper));
  color: var(--blue);
  font-size: 15px;
  font-weight: 950;
  overflow: hidden;
}

.index-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.index-chat-copy,
.index-chat-room-head {
  min-width: 0;
}

.index-chat-room-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.index-chat-room-head strong,
.index-chat-copy small,
.index-chat-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-chat-room-head strong {
  font-size: 13px;
  font-weight: 900;
}

.index-chat-room-head time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.index-chat-room-meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.index-chat-room-meta b,
.chat-room-preview b {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #ff4d67;
  color: #fff;
  padding-inline: 4px;
  font-size: 10px;
  line-height: 1;
}

.index-chat-copy small {
  margin-top: 1px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.index-chat-copy em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.index-chat-empty {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 22px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.index-chat-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.index-chat-empty .btn {
  margin-top: 6px;
}

@media (max-width: 700px) {
  .index-chat-sidebar {
    right: 12px;
    bottom: 12px;
    width: min(320px, calc(100vw - 24px));
  }

  .index-chat-sidebar.is-collapsed {
    width: 54px;
  }
}

.filters {
  align-self: start;
  padding: 18px;
}

.panel-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-head h2,
.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.panel-head button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--blue);
  font-weight: 900;
}

.filters label {
  margin-bottom: 14px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.check-list label {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 28px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.support-sidebar {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.support-sidebar[hidden] {
  display: none;
}

.support-sidebar-mobile {
  display: none;
  margin-top: 0;
}

.support-card {
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--blue-soft) 48%, var(--paper));
  padding: 16px;
}

.support-card h3 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.support-card p:not(.eyebrow) {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.support-qr {
  display: block;
  width: min(100%, 190px);
  aspect-ratio: 1;
  margin: 12px auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.donate-goal-card {
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--paper) 86%, #00101b), color-mix(in srgb, var(--blue-soft) 42%, var(--paper)));
  padding: 16px;
}

.donate-goal-card h3 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.donate-goal-card p:not(.eyebrow) {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.donate-goal-meter {
  height: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, #00101b 72%, var(--paper));
}

.donate-goal-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #ffb12a);
}

.donate-goal-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
  margin: 10px 0 12px;
}

.donate-goal-stats strong {
  color: #ffae00;
  font-size: 20px;
  font-weight: 1000;
}

.donate-goal-stats span {
  color: var(--blue);
  font-size: 14px;
  font-weight: 1000;
}

.donate-goal-stats small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.support-button {
  width: 100%;
}

.check-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.safe-card {
  margin-top: 18px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--aqua), var(--paper));
  padding: 18px;
}

.safe-card h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.safe-card p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-head select {
  width: auto;
  min-width: 150px;
  margin: 0;
}

.listing-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.refresh-listings-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--blue);
  cursor: pointer;
  padding: 0;
}

.refresh-listings-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.refresh-listings-button:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 12%, var(--paper));
}

.refresh-listings-button.is-loading svg {
  animation: refreshSpin 700ms linear infinite;
}

.refresh-listings-button:disabled,
.refresh-listings-button.is-cooling-down {
  cursor: not-allowed;
  opacity: 0.62;
}

@keyframes refreshSpin {
  to {
    transform: rotate(360deg);
  }
}

.market-tabs {
  display: flex;
  gap: 8px;
  margin: -2px 0 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.listing-type-tabs {
  margin: 0 0 10px;
}

.listing-type-tabs button {
  min-width: 116px;
}

.market-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.market-tabs button.is-active,
.market-tabs button:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 12%, var(--paper));
  color: var(--blue);
}

.market-tabs button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.market-tabs button.is-category-locked {
  position: relative;
  padding-right: 34px;
  opacity: 0.62;
}

.market-tabs button.is-category-locked.has-lock-bubble {
  min-height: 42px;
  padding-top: 16px;
}

.market-tabs button.is-category-locked::after {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 17px;
  height: 17px;
  background-image: var(--rooc-lock-icon-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  transform: translateY(-50%);
}

.market-tabs button.has-lock-bubble::before {
  top: 2px;
  right: 8px;
  font-size: 8px;
  padding: 3px 6px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.listing-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  padding: 12px;
}

.listing-pagination[hidden] {
  display: none;
}

.listing-pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.listing-pagination div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.listing-pagination button {
  min-width: 40px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.listing-pagination button:hover:not(:disabled),
.listing-pagination button.is-active {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background: var(--blue);
  color: #fff;
}

.listing-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.listing-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  padding: 32px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.listing-card {
  display: flex;
  min-height: 492px;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
}

.listing-seller {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 10px;
  flex-wrap: wrap; /* ให้ขึ้นบรรทัดใหม่ได้ถ้าที่ว่างไม่พอ */
}

.listing-seller img {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  object-fit: cover;
}

.listing-seller span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px; /* ปรับลดลงอีกนิดเพื่อเพิ่มพื้นที่ให้ส่วนอื่น */
}

.seller-trust-badge {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  margin-top: 2px;
  opacity: 0.8;
}

.seller-trust-badge svg {
  color: var(--gold);
}

.listing-seller strong {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 999px;
  background: rgba(247, 181, 0, 0.16);
  color: #f7b500;
  font-size: 12px;
  line-height: 1;
  order: 2; /* ย้ายมงกุฎไปไว้หลังชื่อ */
}

.item-media {
  display: grid;
  height: 156px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(223, 246, 255, 0.86), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at 50% 20%, rgba(70, 182, 238, 0.22), transparent 8rem);
  overflow: hidden;
}

:root[data-theme="dark"] .item-media {
  background:
    linear-gradient(135deg, rgba(16, 44, 64, 0.92), rgba(16, 27, 42, 0.88)),
    radial-gradient(circle at 50% 20%, rgba(85, 184, 255, 0.18), transparent 8rem);
}

.item-media img {
  display: block;
  width: min(78%, 148px);
  max-height: 142px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(16, 32, 51, 0.16));
}

.card-media {
  height: 190px;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.78), rgba(223, 246, 255, 0.86)),
    radial-gradient(circle at 50% 20%, rgba(240, 173, 36, 0.2), transparent 8rem);
}

.card-media img {
  width: auto;
  height: 174px;
  max-height: none;
  border-radius: 8px;
}

.account-media {
  min-height: 156px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.9) 0 2.8rem, transparent 2.9rem),
    linear-gradient(145deg, #dff6ff, #86cbf2);
}

.account-listing-media {
  position: relative;
  height: 220px;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(223, 246, 255, 0.72), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 50% 20%, rgba(70, 182, 238, 0.18), transparent 8rem);
}

:root[data-theme="dark"] .account-listing-media {
  background:
    linear-gradient(135deg, rgba(16, 44, 64, 0.94), rgba(16, 27, 42, 0.9)),
    radial-gradient(circle at 50% 20%, rgba(85, 184, 255, 0.14), transparent 8rem);
}

.account-listing-media[data-account-gallery] {
  cursor: zoom-in;
}

.account-listing-media[data-account-gallery]::after {
  position: absolute;
  left: 10px;
  bottom: 10px;
  content: "คลิกดูรูปใหญ่";
  border-radius: 999px;
  background: rgba(3, 12, 24, 0.68);
  color: white;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}

.account-listing-media > img {
  width: 100%;
  max-height: 218px;
  object-fit: contain;
}

.account-gallery-count {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: rgba(3, 12, 24, 0.68);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 9px;
}

.account-gallery-strip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.account-gallery-strip span {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(3, 12, 24, 0.44);
  overflow: hidden;
}

.account-gallery-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-media span {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue), var(--blue-2));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(23, 125, 220, 0.28);
}

.account-upload-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
}

.account-upload-preview:empty {
  display: none;
}

.account-upload-preview img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  object-fit: cover;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 4px;
}

.listing-meta span {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  border-radius: 4px;
  background: var(--paper-soft);
  color: var(--blue);
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .listing-meta span {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.listing-meta .verified {
  background: rgba(24, 166, 106, 0.08);
  color: var(--green);
  border-color: rgba(24, 166, 106, 0.2);
}

.listing-meta .fast {
  background: rgba(240, 173, 36, 0.08);
  color: var(--gold);
  border-color: rgba(240, 173, 36, 0.2);
}

.listing-meta .buy {
  background: rgba(55, 160, 236, 0.08);
  color: var(--blue);
  border-color: rgba(55, 160, 236, 0.2);
}

.listing-meta .mvp {
  background: rgba(240, 70, 70, 0.08);
  color: #ff5f5f;
  border-color: rgba(240, 70, 70, 0.2);
}

.listing-meta .time-left {
  background: rgba(55, 160, 236, 0.14);
  color: var(--blue);
}

.listing-meta .expired {
  background: rgba(239, 68, 68, 0.14);
  color: #ff8b8b;
}

.listing-card h3 {
  display: -webkit-box;
  min-height: 32px;
  margin: 6px 0 0px;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
}

.listing-detail-line,
.listing-character-name,
.listing-middleman-status {
  margin-top: 0px;
  margin-bottom: 0px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.1;
}

.listing-meta .fast.pulse {
  animation: soft-glow 3s ease-in-out infinite;
}

.listing-meta span {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.listing-meta span.shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: translateX(-150%) skewX(-25deg);
  animation: premium-shine 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.listing-meta .mvp.shine {
  animation: floating-subtle 4s ease-in-out infinite;
}

.listing-card p {
  display: -webkit-box;
  min-height: 36px;
  max-height: 36px;
  margin-bottom: 4px;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: break-word;
}

.listing-description {
  margin-bottom: 2px !important;
}

.description-toggle {
  display: inline-flex;
  width: fit-content;
  margin: -4px 0 12px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1;
  padding: 0;
}

.description-toggle:hover {
  text-decoration: underline;
}

.price-row {
  display: flex;
  flex-direction: column; /* เปลี่ยนเป็นแนวตั้งเพื่อกันปุ่มล้น */
  margin-top: auto;
  gap: 12px;
  align-items: stretch;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.price-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-display span {
  font-size: 18px;
  color: var(--gold);
  font-weight: 400;
}

.price-display strong {
  font-size: 24px;
  color: var(--gold);
  font-weight: 500;
}

.listing-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.listing-card-actions .btn {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding-inline: 5px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.listing-card-actions .chat-seller-button,
.chat-seller-button {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.listing-card-actions .contact-seller-button {
  flex-grow: 1.25;
}

.chat-seller-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.seller-facebook-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1877f2;
  color: #fff !important;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.seller-facebook-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.contact-modal[hidden] {
  display: none;
}

.modal-open {
  overflow: hidden;
}

.contact-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  width: 100dvw;
  min-height: 100dvh;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  font-family: 'Mitr', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 9, 18, 0.72);
  backdrop-filter: blur(10px);
  animation: modalBackdropIn 180ms ease-out both;
}

.contact-modal-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  overflow: auto;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
  padding: 24px;
  transform-origin: 50% 58%;
  animation: modalCardIn 260ms cubic-bezier(.18, .9, .28, 1.12) both;
}

.contact-modal-card .eyebrow,
.contact-modal-card h2,
.contact-modal-item,
#sellerContactNote {
  animation: modalContentIn 260ms ease-out both;
}

.contact-modal-card h2 {
  animation-delay: 35ms;
}

.contact-modal-item:nth-of-type(1) {
  animation-delay: 70ms;
}

.contact-modal-item:nth-of-type(2) {
  animation-delay: 105ms;
}

#sellerContactNote {
  animation-delay: 140ms;
}

.contact-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.contact-modal-card h2 {
  margin: 4px 0 18px;
  font-size: 28px;
  color: var(--ink);
}

.site-announcement-card {
  width: min(500px, 100%);
  text-align: center;
}

.site-announcement-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 62%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 15%, var(--paper));
  color: var(--gold);
  font-size: 26px;
  font-weight: 950;
}

.site-announcement-card .eyebrow {
  text-align: center;
}

.site-announcement-card h2 {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.site-announcement-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.site-announcement-actions {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.site-announcement-actions .btn {
  width: 100%;
}

.market-chat-card {
  display: grid;
  grid-template-rows: auto minmax(260px, 56vh) auto auto;
  width: min(620px, 100%);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: 8px;
  padding: 0;
}

.market-chat-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-soft) 78%, var(--paper));
  padding: 14px 58px 14px 18px;
}

.market-chat-listing-image {
  display: block;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
  border-radius: 8px;
  background: var(--paper);
}

.market-chat-listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.market-chat-heading {
  min-width: 0;
}

.market-chat-heading .eyebrow {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
}

.market-chat-head h2 {
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-chat-head small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-chat-card .contact-modal-close {
  top: 22px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 20px;
}

.market-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  margin: 0;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--paper-soft) 52%, var(--paper));
  padding: 20px;
  overscroll-behavior: contain;
}

.market-chat-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}

.market-chat-message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  align-self: flex-start;
  max-width: min(84%, 460px);
}

.market-chat-message-avatar {
  position: relative;
  display: block;
  width: 40px;
  height: 40px;
  margin-top: 18px;
  overflow: visible;
}

.market-chat-message-avatar-image {
  position: absolute;
  inset: 0;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 8px;
  background: var(--paper);
  object-fit: cover;
  z-index: 1;
}

.market-chat-message-avatar-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 56px;
  max-width: none;
  border: 0;
  background: transparent;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.market-chat-message-content {
  display: block;
  min-width: 0;
}

.market-chat-sender {
  display: block;
  overflow: hidden;
  margin: 0 0 4px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-chat-message p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px 8px 8px 3px;
  background: var(--paper);
  box-shadow: 0 4px 16px rgba(3, 17, 29, 0.06);
  padding: 10px 13px;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.market-chat-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 4px;
}

.market-chat-message time {
  color: var(--muted);
  font-size: 10px;
}

.market-chat-read-status {
  display: inline-block;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.market-chat-read-status.is-read {
  color: var(--blue);
}

.market-chat-message.is-own {
  grid-template-columns: minmax(0, 1fr) 40px;
  align-self: flex-end;
  text-align: right;
}

.market-chat-message.is-own > .market-chat-message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.market-chat-message.is-own .market-chat-message-content {
  grid-column: 1;
  grid-row: 1;
}

.market-chat-message.is-own .market-chat-sender {
  margin-right: 2px;
}

.market-chat-message.is-own p {
  border-color: color-mix(in srgb, var(--blue) 52%, var(--line));
  border-radius: 8px 8px 3px 8px;
  background: color-mix(in srgb, var(--blue) 18%, var(--paper));
  text-align: left;
}

.market-chat-message.is-own .market-chat-meta {
  justify-content: flex-end;
}

.market-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 14px 16px;
}

.market-chat-form textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  border-color: color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 11px 13px;
  color: var(--ink);
  caret-color: var(--blue);
  resize: vertical;
}

.market-chat-form textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.market-chat-form textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 62%, var(--line));
  outline: 3px solid color-mix(in srgb, var(--blue) 12%, transparent);
}

.market-chat-send {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--blue) 30%, transparent);
}

.market-chat-send:hover {
  background: var(--blue-2);
  transform: translateY(-1px);
}

.market-chat-send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.market-chat-card > .post-message {
  min-height: 0;
  margin: 0;
  background: var(--paper);
  padding: 0 16px 12px;
  font-size: 11px;
}

.chat-room-item em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-preview {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-room-preview em {
  min-width: 0;
}

.chat-room-preview b {
  flex: 0 0 auto;
}

.chat-menu-trigger svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.contact-modal-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
  padding: 14px;
}

.contact-modal-item + .contact-modal-item {
  margin-top: 12px;
}

.contact-modal-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contact-modal-item strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 17px;
}

.offer-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.offer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.offer-form input,
.offer-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 11px 12px;
  resize: vertical;
}

.offer-form input::placeholder,
.offer-form textarea::placeholder {
  color: var(--muted);
}

:root[data-theme="dark"] .contact-modal,
:root[data-theme="dark"] .contact-modal-card,
:root[data-theme="dark"] .contact-modal-card h2,
:root[data-theme="dark"] .contact-modal-item strong,
:root[data-theme="dark"] .offer-form,
:root[data-theme="dark"] .offer-form label,
:root[data-theme="dark"] .offer-form input,
:root[data-theme="dark"] .offer-form textarea {
  color: #f4f9ff;
}

:root[data-theme="dark"] .offer-form input::placeholder,
:root[data-theme="dark"] .offer-form textarea::placeholder {
  color: #9fb3c8;
}

.seller-profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 12px;
  background: linear-gradient(135deg, #5865f2, var(--accent));
  box-shadow: 0 12px 28px rgba(34, 156, 232, 0.28);
  color: white;
  font-weight: 900;
  padding: 10px 16px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.seller-profile-button:hover {
  box-shadow: 0 16px 34px rgba(34, 156, 232, 0.36);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.seller-profile-button[hidden] {
  display: none;
}

.seller-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  padding: 8px 8px 8px 12px;
}

.seller-name-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-copy-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--blue) 10%, var(--paper-soft));
  color: var(--blue);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.seller-copy-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.seller-copy-button:hover {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background: color-mix(in srgb, var(--blue) 18%, var(--paper-soft));
  transform: translateY(-1px);
}

.seller-copy-button.is-copied {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  background: rgba(24, 166, 106, 0.14);
  color: var(--green);
}

.seller-copy-button[hidden] {
  display: none;
}

.premium-page {
  padding: 48px 0 64px;
}

.premium-hero {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}

.premium-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, #f7b500 42%, var(--line));
  border-radius: 999px;
  background: rgba(247, 181, 0, 0.08);
  color: #f7b500;
  font-size: 12px;
  font-weight: 900;
  padding: 0 16px;
  text-transform: uppercase;
}

.premium-hero h1 {
  margin: 20px 0 12px;
  font-size: clamp(36px, 5vw, 56px);
}

.premium-hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.premium-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 900px;
  margin: 0 auto 28px;
}

.plan-card,
.upgrade-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  padding: 26px;
}

.plan-card.is-premium {
  border-color: #f7b500;
  box-shadow: 0 18px 50px rgba(247, 181, 0, 0.14);
}

.plan-card > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-card.is-premium > span {
  color: #f7b500;
}

.plan-card em {
  border-radius: 999px;
  background: #f7b500;
  color: #1a1300;
  font-size: 10px;
  font-style: normal;
  padding: 3px 7px;
}

.plan-card h2 {
  margin: 12px 0 4px;
  font-size: 36px;
}

.plan-card del {
  color: var(--muted);
  font-size: 17px;
}

.plan-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.plan-card ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-card li {
  color: var(--text);
  font-weight: 800;
}

.plan-card li::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(247, 181, 0, 0.16);
  color: #f7b500;
}

.plan-card li.is-muted {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  text-decoration: line-through;
}

.plan-card li.is-muted::before {
  content: "x";
  background: rgba(239, 68, 68, 0.14);
  color: #ff6f7d;
}

.upgrade-card {
  max-width: 900px;
  margin: 0 auto;
}

.upgrade-card h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.upgrade-card ol {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: upgrade-step;
}

.upgrade-card li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  counter-increment: upgrade-step;
}

.upgrade-card li::before {
  content: counter(upgrade-step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f7b500;
  color: #1a1300;
  font-weight: 900;
}

.upgrade-card strong,
.upgrade-card span {
  grid-column: 2;
}

.upgrade-card strong {
  color: var(--text);
}

.upgrade-card span {
  color: var(--muted);
  font-size: 13px;
}

.premium-cta {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.btn-premium {
  background: #f7b500;
  color: #1a1300;
  box-shadow: 0 16px 36px rgba(247, 181, 0, 0.24);
}

.premium-status-card {
  max-width: 900px;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  padding: 22px;
}

.premium-status-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.premium-status-card p {
  margin: 0;
  color: var(--muted);
}

.premium-id-box {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
  padding: 12px;
}

.premium-id-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.premium-id-box strong {
  overflow-wrap: anywhere;
}

.premium-user-card img {
  border-radius: 999px;
}

.premium-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.premium-search-results {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.premium-search-result {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  padding: 10px;
}

.premium-search-result img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  object-fit: cover;
}

.premium-search-result strong,
.premium-search-result span,
.premium-search-result small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-search-result span,
.premium-search-result small {
  color: var(--muted);
  font-size: 12px;
}

#sellerContactNote {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  width: 100dvw;
  min-height: 100dvh;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  font-family: 'Mitr', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.image-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  padding: 18px;
  animation: modalCardIn 260ms cubic-bezier(.18, .9, .28, 1.12) both;
}

.image-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 44px;
  padding-right: 42px;
}

.image-modal-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.image-modal-head span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--blue);
  padding: 8px 12px;
  font-weight: 1000;
}

.guild-lock-mark {
  background-color: var(--paper-soft);
  background-image: var(--rooc-lock-icon-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 64%;
  color: transparent;
}

.image-modal-view {
  position: relative;
  display: grid;
  min-height: min(64vh, 640px);
  min-height: min(64dvh, 640px);
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(223, 246, 255, 0.52), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at 50% 12%, rgba(85, 184, 255, 0.14), transparent 18rem);
}

:root[data-theme="dark"] .image-modal-view {
  background:
    linear-gradient(135deg, rgba(7, 20, 33, 0.96), rgba(16, 27, 42, 0.94)),
    radial-gradient(circle at 50% 12%, rgba(85, 184, 255, 0.15), transparent 18rem);
}

.image-modal-view img {
  display: block;
  max-width: 100%;
  max-height: min(64vh, 640px);
  max-height: min(64dvh, 640px);
  object-fit: contain;
}

.image-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--text);
  cursor: pointer;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.image-prev {
  left: 14px;
}

.image-next {
  right: 14px;
}

.image-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.image-thumbs button {
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--paper-soft);
  cursor: pointer;
  padding: 0;
}

.image-thumbs button.is-active {
  border-color: var(--blue);
}

.image-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes modalBackdropIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }

  to {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
}

@keyframes modalCardIn {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(.94);
  }

  68% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalContentIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-modal-backdrop,
  .contact-modal-card,
  .contact-modal-card .eyebrow,
  .contact-modal-card h2,
  .contact-modal-item,
  #sellerContactNote {
    animation: none;
  }
}

/* Removed redundant category-icon img style */

.post-page {
  margin: 24px auto 52px;
}

.post-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.post-head h2 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 46px);
}

.post-head p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.post-status {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  padding: 14px;
  box-shadow: 0 16px 40px rgba(26, 83, 124, 0.08);
}

.post-status span,
.post-status strong {
  display: block;
}

.post-status span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.post-status strong {
  margin-top: 3px;
  font-size: 15px;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.post-panel,
.preview-panel,
.login-required {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 16px 40px rgba(26, 83, 124, 0.08);
}

.login-required {
  display: grid;
  min-height: 300px;
  place-items: center;
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
}

.login-required[hidden] {
  display: none;
}

.login-required h3 {
  margin-bottom: 8px;
  font-size: 26px;
}

.login-required p {
  max-width: 520px;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.post-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.form-block {
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  padding: 16px;
}

.form-block.is-hidden {
  display: none;
}

.form-block-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.form-block-head > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--blue), var(--blue-2));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.form-block-head h3 {
  margin-bottom: 3px;
  font-size: 18px;
}

.form-block-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.listing-type-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-picker button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 900;
}

.category-picker button.is-active,
.category-picker button:hover {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  background: color-mix(in srgb, var(--blue) 12%, var(--paper));
  color: var(--blue);
}

.category-picker button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.auto-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: stretch;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.post-field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.post-field input,
.post-field select,
.post-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

.post-field input,
.post-field select {
  height: 46px;
}

.post-field textarea {
  padding-top: 12px;
  resize: vertical;
  line-height: 1.55;
}

.auto-image-box,
.upload-drop {
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--blue) 42%, var(--line));
  border-radius: 16px;
  background: linear-gradient(145deg, var(--paper-soft), var(--paper));
  text-align: center;
}

.auto-image-box {
  min-height: 146px;
  padding: 10px;
}

.auto-image-box img {
  display: block;
  max-width: 108px;
  max-height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(16, 32, 51, 0.16));
}

.auto-image-box small,
.upload-drop small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-drop {
  min-height: 160px;
  cursor: pointer;
  padding: 18px;
}

.upload-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-drop span {
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
}

.post-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-checks label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.post-checks input {
  accent-color: var(--blue);
}

.post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.post-message {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.post-message.is-error {
  color: #d24646;
}

.preview-panel {
  padding: 16px;
}

.preview-sticky {
  position: sticky;
  top: 92px;
}

.preview-panel > h3,
.preview-sticky > h3 {
  margin-bottom: 14px;
  font-size: 24px;
}

.preview-card {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}

.preview-card .item-media {
  min-height: 210px;
}

.preview-card .card-media img {
  height: 188px;
}

.preview-card .account-media,
.preview-card .account-listing-media {
  min-height: 260px;
}

.preview-card .account-media img,
.preview-card .account-listing-media img {
  width: 100%;
  max-height: 258px;
  object-fit: contain;
}

.preview-safety {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  padding: 14px;
}

.preview-safety h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.preview-safety ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.admin-page {
  margin: 18px auto 42px;
}

.admin-tabs-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding: 0 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  margin: 0;
}

.admin-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--muted);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition: all 200ms ease;
}

.admin-tab:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 12%, var(--paper));
  color: var(--blue);
}

.admin-tab.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.is-active {
  display: block;
}

.admin-dashboard {
  margin-bottom: 32px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  gap: 16px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--blue-soft) 48%, var(--paper));
  padding: 18px;
  transition: all 200ms ease;
}

.stat-card:hover {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 68%, var(--paper));
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 32px;
  line-height: 1;
}

.stat-info strong {
  display: block;
  font-size: 28px;
  color: var(--blue);
  margin-bottom: 4px;
}

.stat-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-head h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 4.4vw, 56px);
}

.admin-head p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-status,
.admin-setup,
.admin-card,
.admin-editor,
.admin-list-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 16px 40px rgba(26, 83, 124, 0.08);
}

.admin-status {
  min-width: 190px;
  padding: 14px;
}

.admin-status span,
.admin-status strong,
.admin-status small {
  display: block;
}

.admin-status span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-status strong {
  margin-top: 3px;
  font-size: 15px;
}

.admin-status small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-setup,
.admin-card,
.admin-editor,
.admin-list-panel {
  padding: 16px;
}

.admin-setup {
  margin-bottom: 18px;
  border-color: color-mix(in srgb, var(--gold) 46%, var(--line));
}

.admin-setup h2,
.admin-card h2 {
  margin-bottom: 10px;
}

.admin-setup p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-login {
  display: grid;
  min-height: 220px;
  place-items: center;
}

.admin-card {
  width: min(420px, 100%);
}

.admin-card .btn {
  width: 100%;
}

.admin-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.admin-message.is-error {
  color: #d24646;
}

.admin-workspace {
  display: block;
}

.admin-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 992px) {
  .admin-grid-layout {
    grid-template-columns: 1fr;
  }
}

.admin-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: stretch;
}

.admin-image-preview {
  min-height: 160px;
}

.admin-image-file-size {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.admin-image-preview > img[hidden] {
  display: none;
}

.admin-image-preview > #itemImagePreviewEmpty,
.admin-image-preview > [data-empty-preview] {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.preview-box > img[hidden],
.profile-frame-admin-preview > img[hidden] {
  display: none;
}

.preview-box + .admin-image-file-size {
  max-width: 74px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.admin-image-preview img {
  max-width: 128px;
  max-height: 128px;
}

.admin-items {
  display: grid;
  gap: 10px;
}

.support-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.support-admin-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper-soft) 68%, transparent);
  padding: 12px;
}

.announcement-admin-card {
  grid-column: 1 / -1;
}

.admin-item-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  padding: 10px;
}

.admin-item-card img {
  display: block;
  width: 74px;
  height: 74px;
  border-radius: 14px;
  background: var(--paper-soft);
  object-fit: contain;
}

.admin-item-card strong,
.admin-item-card span,
.admin-item-card small {
  display: block;
}

.admin-item-card strong {
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.admin-item-card span,
.admin-item-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.admin-delete {
  color: #d24646;
}

.admin-ban {
  color: #ffbe3d;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.admin-pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.listing-admin-panel {
  margin-top: 0;
}

.admin-listing-card,
.banned-user-card {
  align-items: start;
}

.server-admin-form {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.server-item-card {
  grid-template-columns: 54px minmax(0, 1fr) auto;
}

.server-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 18%, var(--paper));
  color: var(--blue);
  font-size: 16px;
  font-weight: 1000;
}

.banned-user-list {
  margin-top: 18px;
}

.banned-user-list > .eyebrow {
  margin: 0 0 10px;
}

.admin-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.auth-page {
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
  padding: 36px 0 56px;
}

.auth-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-copy h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 52px);
}

.auth-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.auth-tabs button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.auth-tabs button.is-active,
.auth-tabs button:hover {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  background: color-mix(in srgb, var(--blue) 12%, var(--paper));
  color: var(--blue);
}

.auth-form {
  display: grid;
  gap: 4px;
}

.auth-form .btn {
  width: 100%;
}

.auth-notice {
  border: 1px solid color-mix(in srgb, #d89000 35%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, #d89000 11%, var(--paper));
  color: color-mix(in srgb, #d89000 86%, var(--ink));
  font-size: 13px;
  font-weight: 900;
  line-height: 1.55;
  padding: 12px 14px;
}

.discord-login {
  background: linear-gradient(135deg, #5865f2, #2f7cff);
}

.auth-session {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  padding: 16px;
}

.auth-session strong,
.auth-session span {
  display: block;
}

.auth-session span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.my-listings-page {
  margin: 28px auto 56px;
}

.my-listings-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 16px 40px rgba(26, 83, 124, 0.08);
  padding: 18px;
}

.listing-quota {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.listing-quota[hidden] {
  display: none;
}

.quota-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue-soft) 15%, var(--paper));
  padding: 16px;
  transition: all 0.2s;
}

.quota-item:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 25%, var(--paper));
  transform: translateY(-2px);
}

.quota-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: color-mix(in srgb, var(--blue) 10%, var(--paper-soft));
  border-radius: 12px;
  color: var(--blue);
  flex-shrink: 0;
}

.quota-icon-box svg {
  width: 28px;
  height: 28px;
}

.quota-details {
  display: flex;
  flex-direction: column;
}

.listing-quota span,
.listing-quota strong {
  display: block;
}

.listing-quota span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.listing-quota strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
}

.my-listing-grid {
  display: grid;
  gap: 12px;
}

.my-listing-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  padding: 12px;
}

.service-my-listing-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.my-listing-card > img {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-soft);
  object-fit: contain;
}

.my-listing-card h3 {
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.my-listing-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.my-listing-card strong {
  color: #d89000;
}

.offer-status {
  margin-top: 8px !important;
  font-weight: 800;
  color: var(--blue) !important;
}

.offer-mailbox {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}

.offer-mailbox > strong {
  color: var(--ink);
  font-size: 13px;
}

.offer-mailbox.is-empty p {
  margin: 0;
}

.offer-mail {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.offer-mail b {
  color: #d89000;
}

.offer-mail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.offer-mail p {
  margin-top: 4px;
}

.my-listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-delete {
  color: #d24646;
}

.action-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 22px;
  margin-bottom: 52px;
}

.sell-panel,
.deal-steps {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 16px 40px rgba(26, 83, 124, 0.08);
  padding: 22px;
}

.sell-panel h2,
.deal-steps h2 {
  margin-bottom: 10px;
  font-size: 26px;
}

.sell-panel p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;
}

.sell-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 150px auto;
  gap: 10px;
  margin-top: 18px;
}

.sell-form input,
.sell-form select {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

.deal-steps ol {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.deal-steps li {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: var(--paper-soft);
  padding: 12px 14px;
}

.deal-steps strong {
  font-size: 14px;
}

.deal-steps span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}


.footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
  padding: 34px 0;
}

.footer p {
  max-width: 520px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.footer h2 {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer a:not(.brand) {
  display: block;
  margin: 10px 0;
  color: var(--muted);
  text-decoration: none;
}

@media (max-width: 1100px) {
  .market-layout {
    grid-template-columns: 1fr;
  }

  .filters > .support-sidebar {
    display: none;
  }

  .support-sidebar-mobile:not([hidden]) {
    display: grid;
    order: 3;
  }

  .hero {
    background:
      linear-gradient(90deg, rgba(248, 252, 255, 0.98) 0%, rgba(248, 252, 255, 0.88) 48%, rgba(248, 252, 255, 0.35) 86%),
      linear-gradient(180deg, rgba(248, 252, 255, 0.14), rgba(248, 252, 255, 0.92)),
      url("assets/hero-rooc.png");
    background-position: center right;
    background-size: cover;
  }

  :root[data-theme="dark"] .hero {
    background:
      linear-gradient(90deg, rgba(8, 17, 28, 0.98) 0%, rgba(8, 17, 28, 0.88) 48%, rgba(8, 17, 28, 0.38) 86%),
      linear-gradient(180deg, rgba(8, 17, 28, 0.14), rgba(8, 17, 28, 0.92)),
      url("assets/hero-rooc.png");
    background-position: center right;
    background-size: cover;
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-pagination div {
    justify-content: center;
  }

  .post-layout {
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }

  .action-layout,
  .sell-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 0;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .nav-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .nav-actions > .btn {
    flex: 0 0 auto;
  }

  .game-switcher {
    display: block;
    min-height: 0;
    overflow: hidden;
    padding: 8px 0;
  }

  .game-switcher-label {
    display: block;
    margin-bottom: 6px;
  }

  .game-switcher-options {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .game-switcher-message {
    margin-top: 5px;
    text-align: left;
  }

  .search-card {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: auto;
  }

  .hero-sponsor-card {
    min-height: 220px;
    border-radius: 20px;
  }

  .hero-sponsor-content {
    max-width: none;
    padding: 22px;
  }

  .trust-row,
  .category-row,
  .category-picker,
  .action-layout,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .post-status {
    min-width: 0;
  }

  .admin-status {
    min-width: 0;
  }

  .auto-item-row,
  .post-grid,
  .admin-upload-row {
    grid-template-columns: 1fr;
  }

  .support-admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 38px;
  }

  .hero {
    padding: 20px 0;
    background:
      linear-gradient(180deg, rgba(248, 252, 255, 0.94), rgba(248, 252, 255, 0.88)),
      url("assets/hero-rooc.png");
    background-position: center top;
    background-size: cover;
  }

  :root[data-theme="dark"] .hero {
    background:
      linear-gradient(180deg, rgba(8, 17, 28, 0.94), rgba(8, 17, 28, 0.88)),
      url("assets/hero-rooc.png");
    background-position: center top;
    background-size: cover;
  }

  .trust-row,
  .category-row,
  .category-picker,
  .listing-grid,
  .action-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-card .price-row {
    align-items: flex-end;
    flex-direction: row;
  }

  .section-head select,
  .btn-small {
    width: 100%;
  }

  .listing-tools {
    width: 100%;
    align-items: center;
  }

  .premium-plans {
    grid-template-columns: 1fr;
  }

  .user-tools {
    flex: 0 1 auto;
    width: auto;
  }

  .user-menu-trigger {
    justify-content: center;
    max-width: 190px;
  }

  .user-menu-panel,
  .mailbox-panel {
    left: auto;
    right: 0;
  }

  .post-panel,
  .preview-panel,
  .form-block {
    padding: 14px;
  }

  .post-actions {
    flex-direction: column;
  }

  .post-actions .btn {
    width: 100%;
  }

  .admin-item-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .my-listing-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .service-my-listing-card {
    grid-template-columns: 1fr;
  }

  .my-listing-card > img {
    width: 72px;
    height: 72px;
  }

  .my-listing-actions {
    grid-column: 1 / -1;
  }

  .my-listing-actions .btn {
    width: 100%;
  }

  .listing-quota {
    grid-template-columns: 1fr;
  }

  .admin-item-card img {
    width: 64px;
    height: 64px;
  }

  .admin-item-actions {
    grid-column: 1 / -1;
  }

  .admin-item-actions .btn {
    width: 100%;
  }
}

/* Facebook Icon Style */
.seller-facebook-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  border-radius: 50%;
  background-color: #1877f2;
  color: #ffffff;
  transition: transform 0.2s ease, background-color 0.2s ease;
  vertical-align: middle;
}

.seller-facebook-link:hover {
  background-color: #166fe5;
  transform: scale(1.1);
}

.seller-facebook-link svg {
  width: 14px;
  height: 14px;
}

.listing-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}

.listing-seller img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.listing-seller-avatar {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  overflow: visible !important;
  max-width: none !important;
}

.listing-seller .listing-seller-avatar-image {
  position: absolute;
  inset: 3px;
  width: 24px;
  height: 24px;
  border: 0 !important;
  border-radius: 999px;
  box-shadow: none !important;
  background: transparent !important;
  object-fit: cover;
  z-index: 1;
}

.listing-seller .listing-seller-avatar-frame {
  position: absolute;
  inset: -7px -6px -7px -6px;
  width: calc(100% + 12px);
  height: calc(100% + 14px);
  transform: translateY(-1px);
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

.listing-seller span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.listing-seller > .listing-seller-avatar {
  position: relative !important;
  display: block !important;
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  flex: 0 0 54px !important;
  overflow: visible !important;
  color: inherit !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.listing-seller > .listing-seller-avatar > .listing-seller-avatar-image {
  position: absolute !important;
  top: 52% !important;
  left: 50% !important;
  width: 46px !important;
  height: 43px !important;
  max-width: none !important;
  transform: translate(-50%, -50%);
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  background: transparent !important;
  object-fit: cover !important;
  z-index: 1;
}

.listing-seller > .listing-seller-avatar > .listing-seller-avatar-frame {
  position: absolute !important;
  inset: -5px -4px -5px -4px !important;
  width: calc(100% + 8px) !important;
  height: calc(100% + 10px) !important;
  max-width: none !important;
  transform: translateY(-1px);
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  object-fit: contain !important;
  pointer-events: none;
  z-index: 2;
}

/* --- Seller Storefront Styles --- */
.store-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--blue) 8%, transparent), transparent), linear-gradient(180deg, var(--paper-soft), var(--paper));
  margin-bottom: 24px;
}

.store-header-grid {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 20px;
}

@media (max-width: 768px) {
  .store-header-grid {
    flex-direction: column;
    text-align: center;
  }
}

.store-profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.store-avatar {
  position: relative;
  width: 64px;
  height: 64px;
}

.store-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--paper);
  background: var(--paper-soft);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.status-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--paper-soft);
}

.status-indicator.online { background: #10b981; }

.store-info h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--ink);
}

.verified-badge {
  color: var(--blue);
  width: 28px;
  height: 28px;
}

.store-tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.store-socials {
  display: flex;
  gap: 1rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  transition: all 0.2s;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.social-btn.facebook {
  background: #1877f2;
  color: #fff;
}

.social-btn.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
}

.social-btn.discord {
  background: #5865f2;
  color: white;
}

.social-btn svg {
  width: 24px;
  height: 24px;
  fill: white !important;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  filter: brightness(1.1);
}

.store-stats {
  display: flex;
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  min-width: 140px;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  padding: 16px 24px;
  backdrop-filter: blur(8px);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.store-content {
  padding-bottom: 5rem;
}

.store-header .store-profile {
  gap: 36px !important;
}

.store-header .store-info {
  min-width: 0;
}

/* Link in listing card to store */
.seller-store-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.seller-store-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .store-header-grid {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    align-items: flex-end;
  }
  
  .store-profile {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  
  .store-name-row {
    justify-content: flex-start;
  }
  
  .store-socials {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .store-stats {
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .stat-card {
    flex: 1 1 140px;
  }
}

/* =====================================================
   Visitor Stats Section (Admin Dashboard)
   ===================================================== */

/* =====================================================
   Visitor Stats Section (Admin Dashboard) - Improved UX
   ===================================================== */

.visitor-stats-section {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.visitor-stats-section h2 {
  font-size: 24px;
  font-weight: 900;
  margin: 0 0 28px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.visitor-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.visitor-stat-card {
  border: 2px solid color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: 20px;
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--aqua) 25%, var(--paper)) 0%,
    color-mix(in srgb, var(--blue-2) 8%, var(--paper)) 100%);
  padding: 24px 20px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.visitor-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
}

.visitor-stat-card:hover {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--line));
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(23, 125, 220, 0.15);
}

.visitor-stat-card .vs-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.visitor-stat-card .vs-value {
  display: block;
  font-size: 36px;
  font-weight: 900;
  color: var(--blue);
  line-height: 1.1;
  margin-bottom: 6px;
}

.visitor-stat-card .vs-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.visitor-stat-card.is-highlight {
  border-color: color-mix(in srgb, var(--green) 60%, var(--line));
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--green) 12%, var(--paper)) 0%,
    color-mix(in srgb, var(--green) 4%, var(--paper)) 100%);
}

.visitor-stat-card.is-highlight::before {
  background: linear-gradient(90deg, var(--green), #45d695);
}

.visitor-stat-card.is-highlight .vs-value {
  color: var(--green);
}

.visitor-stat-card.is-highlight:hover {
  border-color: color-mix(in srgb, var(--green) 80%, var(--line));
  box-shadow: 0 12px 32px rgba(24, 166, 106, 0.15);
}

.visitor-chart-block {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(26, 83, 124, 0.06);
}

.visitor-chart-block h3 {
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.visitor-chart-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  background: color-mix(in srgb, var(--paper-soft) 60%, transparent);
  padding: 6px;
  border-radius: 14px;
  width: fit-content;
}

.visitor-chart-tab {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 150ms ease;
}

.visitor-chart-tab:hover {
  background: color-mix(in srgb, var(--blue) 12%, var(--paper));
}

.visitor-chart-tab.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(23, 125, 220, 0.3);
}

.visitor-chart-canvas-wrap {
  position: relative;
  height: 280px;
  padding: 12px 0;
}

.visitor-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.visitor-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  color: var(--muted);
  font-size: 14px;
  background: color-mix(in srgb, var(--paper-soft) 50%, transparent);
  border-radius: 12px;
}

.visitor-stats-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  padding: 16px 0;
  font-weight: 600;
}

.visitor-stats-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .visitor-stats-section {
    margin-top: 32px;
    padding: 24px 0;
  }

  .visitor-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .visitor-stat-card {
    padding: 20px 16px;
  }

  .visitor-stat-card .vs-value {
    font-size: 28px;
  }

  .visitor-chart-block {
    padding: 20px;
  }

  .visitor-chart-canvas-wrap {
    height: 240px;
  }
}

@media (max-width: 600px) {
  .visitor-summary-grid {
    grid-template-columns: 1fr;
  }

  .visitor-stat-card {
    padding: 18px 14px;
  }

  .visitor-stat-card .vs-value {
    font-size: 24px;
  }

  .visitor-chart-block {
    padding: 16px;
  }

  .visitor-chart-tabs {
    flex-wrap: wrap;
  }

  .visitor-chart-canvas-wrap {
    height: 200px;
  }
}

/* Admin Multi Upload */
.admin-multi-upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.admin-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-upload-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.admin-url-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 12px;
}

.admin-url-input:focus {
  outline: none;
  border-color: var(--blue);
}
/* --- ส่วนแก้ไขระบบกราฟใหม่ (วางทับของเดิมทั้งหมด) --- */
.visitor-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 1024px) {
  .visitor-charts-grid {
    grid-template-columns: 1fr;
  }
}

.visitor-chart-container {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

:root[data-theme="light"] .visitor-chart-container {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.chart-title {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  text-align: center;
}

.visitor-chart-canvas-wrap {
  position: relative !important;
  height: 300px !important;
  width: 100% !important;
}

.visitor-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
/* ----------------------------------------------- */


/* Staggered Animation for Listing Cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.listing-card {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

/* Staggered Delay for first 20 cards (enough for a page) */
.listing-card:nth-child(1) { animation-delay: 0.1s; }
.listing-card:nth-child(2) { animation-delay: 0.2s; }
.listing-card:nth-child(3) { animation-delay: 0.3s; }
.listing-card:nth-child(4) { animation-delay: 0.4s; }
.listing-card:nth-child(5) { animation-delay: 0.5s; }
.listing-card:nth-child(6) { animation-delay: 0.6s; }
.listing-card:nth-child(7) { animation-delay: 0.7s; }
.listing-card:nth-child(8) { animation-delay: 0.8s; }
.listing-card:nth-child(9) { animation-delay: 0.9s; }
.listing-card:nth-child(10) { animation-delay: 1.0s; }
.listing-card:nth-child(11) { animation-delay: 1.1s; }
.listing-card:nth-child(12) { animation-delay: 1.2s; }

/* Seller Trust Badge Style */
.seller-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 400;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, transparent);
  padding: 1px 6px;
  border-radius: 99px;
  white-space: nowrap;
}

.seller-signal-row {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: wrap;
}

.seller-signal-row .seller-trust-badge {
  width: auto;
  margin-top: 0;
}

.seller-name-stack {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.seller-name-stack .seller-store-link,
.seller-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.seller-name-stack .seller-store-link > span,
.seller-name-line > span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-seller > .seller-name-stack {
  max-width: none;
}

.seller-name-stack .seller-presence-badge {
  width: 100%;
  max-width: 100%;
  margin-top: 1px;
  gap: 3px;
  font-size: 10px;
  font-weight: 200;
  line-height: 1.2;
  overflow: visible;
  white-space: normal;
}

.seller-name-stack .seller-presence-badge span {
  max-width: none;
  overflow: visible;
  font-size: 10px;
  font-weight: 200;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

.seller-name-stack .seller-presence-badge i {
  width: 5px;
  height: 5px;
  flex-basis: 5px;
}

.seller-push-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 1px 6px;
  border-radius: 99px;
  color: #28c98b;
  background: rgba(40, 201, 139, 0.12);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.seller-push-badge svg {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seller-presence-badge,
.store-presence,
.market-chat-partner-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.seller-presence-badge span,
.store-presence span,
.market-chat-partner-presence span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-presence-badge i,
.store-presence i,
.market-chat-partner-presence i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.seller-presence-badge.is-online,
.store-presence.is-online,
.market-chat-partner-presence.is-online {
  color: #28c98b;
}

.seller-presence-badge.is-online i,
.store-presence.is-online i,
.market-chat-partner-presence.is-online i {
  box-shadow: 0 0 0 3px rgba(40, 201, 139, 0.14);
}

.store-presence {
  margin-top: 2px;
  font-size: 11px;
}

.market-chat-head small {
  white-space: normal;
}

.market-chat-partner-presence {
  margin-left: 8px;
}

.store-seller-push-badge {
  margin-left: auto;
}

.store-seller-push-badge + .status-badge {
  margin-left: 0 !important;
}

.listing-seller {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 10px;
}

.seller-facebook-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1877f2;
  color: #fff !important;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.seller-facebook-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.listing-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

:root[data-theme="dark"] .seller-trust-badge {
  background: color-mix(in srgb, var(--green) 20%, transparent);
}

/* Live Activity Feed */
.live-activity-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 50px;
  margin-left: 20px;
  max-width: 400px;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.live-activity-container:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #4facfe;
  border-radius: 50%;
  box-shadow: 0 0 10px #4facfe;
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

.live-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4facfe;
  letter-spacing: 1px;
  margin-right: 4px;
  flex-shrink: 0;
}

.live-content {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.live-content.fade-out {
  opacity: 0;
  transform: translateY(-5px);
}

.live-content.fade-in {
  animation: slide-in-up 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.live-content strong {
  color: var(--text-main);
  font-weight: 600;
}

.live-content .highlight {
  color: #f6d365;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(246, 211, 101, 0.3);
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(79, 172, 254, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(79, 172, 254, 0); }
}

@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Unified Filter Row */
.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 0 8px;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 3px;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-row::-webkit-scrollbar {
    display: none;
  }
  .filter-divider {
    display: none; /* ซ่อนเส้นแบ่งบนมือถือเพื่อเพิ่มพื้นที่ */
  }
}

.market-tabs {
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 15px;
  }
  .live-activity-container {
    margin-left: 0;
    max-width: 100%;
    width: 100%;
  }
}


/* =====================================================
   MOBILE RESPONSIVE FIX — ป้องกัน UI เกินหน้าจอ
   ===================================================== */

/* ป้องกัน horizontal scroll ทั่วทั้งหน้า */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ===== NAVBAR ===== */
@media (max-width: 860px) {
  /* ซ่อนปุ่ม "ลงประกาศ" ใน nav-actions เพราะมีอยู่ใน nav-links แล้ว */
  .nav-actions > .btn-primary {
    display: inline-flex;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .nav-actions {
    gap: 8px;
  }

  /* user-menu-trigger ไม่ให้กว้างเกิน */
  .user-menu-trigger {
    max-width: 160px;
  }
}

@media (max-width: 560px) {
  /* ปรับ nav ให้แน่ใจว่าไม่ล้น */
  .nav {
    padding: 10px 0;
    gap: 8px;
  }

  /* nav-links เลื่อนได้แนวนอน */
  .nav-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    width: 100%;
  }
  .nav-actions::-webkit-scrollbar {
    display: none;
  }

  /* ลดขนาดปุ่มใน nav-actions บนมือถือ */
  .nav-actions .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* theme switch ไม่ให้หดตัว */
  .theme-switch {
    flex-shrink: 0;
  }
}

/* ===== HERO SEARCH CARD ===== */
@media (max-width: 560px) {
  .search-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-card > .btn {
    width: 100%;
  }
}

/* ===== SELL FORM (my-listings.html) ===== */
@media (max-width: 860px) {
  .sell-form {
    grid-template-columns: 1fr 1fr;
  }
  .sell-form .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .sell-form {
    grid-template-columns: 1fr;
  }
  .sell-form .btn {
    grid-column: 1;
    width: 100%;
  }
}

/* ===== LISTING QUOTA (my-listings.html) ===== */
@media (max-width: 860px) {
  .listing-quota {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== CATEGORY PICKER (post.html) ===== */
@media (max-width: 560px) {
  .category-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== LIVE ACTIVITY CONTAINER ===== */
@media (max-width: 860px) {
  .live-activity-container {
    margin-left: 0;
    max-width: 100%;
  }
}

/* ===== ADMIN UPLOAD ROW ===== */
@media (max-width: 860px) {
  .admin-upload-row {
    grid-template-columns: 1fr;
  }
  .admin-multi-upload {
    grid-template-columns: 1fr;
  }
}

/* ===== STORE PAGE ===== */
@media (max-width: 560px) {
  .store-header {
    padding: 32px 0 24px;
  }

  .store-info h1 {
    font-size: 1.8rem;
  }

  .store-stats {
    gap: 0.75rem;
  }

  .stat-card {
    min-width: 110px;
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.4rem;
  }
}

/* ===== FOOTER ===== */
@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0;
  }
}

/* ===== DASHBOARD ACTIONS ===== */
@media (max-width: 560px) {
  .dashboard-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .dashboard-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ===== SECTION HEAD ===== */
@media (max-width: 560px) {
  .section-head {
    gap: 10px;
  }
  .section-head h2 {
    font-size: 20px;
  }
}

/* ===== PANEL HEAD ===== */
@media (max-width: 560px) {
  .panel-head h2 {
    font-size: 20px;
  }
}

/* ===== POST HEAD / ADMIN HEAD ===== */
@media (max-width: 560px) {
  .post-head h2,
  .admin-head h1 {
    font-size: 28px;
  }
}

/* ===== TRUST ROW ===== */
@media (max-width: 400px) {
  .trust-row {
    grid-template-columns: 1fr;
  }
}

/* ===== LISTING PAGINATION ===== */
@media (max-width: 400px) {
  .listing-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .listing-pagination div {
    justify-content: center;
  }
}

/* ===== IMAGE MODAL ===== */
@media (max-width: 560px) {
  .image-modal {
    padding: 10px;
  }
  .image-modal-card {
    padding: 12px;
    border-radius: 14px;
  }
  .image-modal-head {
    gap: 12px;
    padding-right: 44px;
  }
  .image-modal-head h2 {
    font-size: 18px;
  }
  .image-modal-view {
    min-height: min(50vh, 300px);
    min-height: min(50dvh, 300px);
  }
  .image-modal-view img {
    max-height: min(50vh, 300px);
    max-height: min(50dvh, 300px);
  }
}

/* ===== CONTACT MODAL ===== */
@media (max-width: 560px) {
  .contact-modal {
    padding: 12px;
  }
  .contact-modal-card {
    padding: 18px;
    border-radius: 14px;
  }
  .contact-modal-card h2 {
    font-size: 22px;
  }

  .market-chat-card {
    grid-template-rows: auto minmax(260px, 1fr) auto auto;
    width: 100%;
    height: min(720px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
  }

  .market-chat-head {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 74px;
    padding: 12px 52px 12px 14px;
  }

  .market-chat-listing-image {
    width: 46px;
    height: 46px;
  }

  .market-chat-head h2 {
    font-size: 16px;
  }

  .market-chat-card .contact-modal-close {
    top: 19px;
    right: 12px;
  }

  .market-chat-messages {
    min-height: 0;
    padding: 16px 13px;
  }

  .market-chat-message {
    max-width: 86%;
  }

  .market-chat-form {
    padding: 12px;
  }

  .market-chat-card > .post-message {
    padding: 0 12px 10px;
  }
}

/* ===== MAILBOX PANEL ===== */
@media (max-width: 400px) {
  .mailbox-panel {
    width: calc(100vw - 16px);
    right: -8px;
  }
}

/* ===== USER MENU PANEL ===== */
@media (max-width: 400px) {
  .user-menu-panel {
    right: 0;
    min-width: 160px;
  }
}

/* ===== FILTER ROW ===== */
@media (max-width: 560px) {
  .filter-row {
    gap: 8px;
    padding: 6px 0;
  }
}

/* ===== MARKET TABS ===== */
@media (max-width: 560px) {
  .market-tabs {
    gap: 6px;
  }
  .market-tabs button {
    padding: 0 10px;
    font-size: 12px;
    min-height: 34px;
  }
}

/* ===== LISTING CARD ===== */
@media (max-width: 560px) {
  .listing-card {
    min-height: unset;
  }
}

/* ===== HERO H1 ===== */
@media (max-width: 400px) {
  h1 {
    font-size: 30px;
  }
}

/* ===== PREMIUM SEARCH BOX ===== */
@media (max-width: 560px) {
  .premium-search-box {
    grid-template-columns: 1fr;
  }
  .premium-search-box .btn {
    width: 100%;
  }
}

/* ===== PREMIUM SEARCH RESULT ===== */
@media (max-width: 560px) {
  .premium-search-result {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .premium-search-result img {
    width: 40px;
    height: 40px;
  }
}

/* ===== STORE STATS WRAP ===== */
@media (max-width: 400px) {
  .store-stats {
    flex-direction: column;
    align-items: stretch;
  }
  .stat-card {
    min-width: unset;
    width: 100%;
  }
}


/* =====================================================
   ADDITIONAL MOBILE FIXES (V2)
   ===================================================== */

@media (max-width: 560px) {
  /* 1. แยกราคากับปุ่มติดต่อคนละบรรทัด และชิดซ้าย */
  .listing-card .price-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding-top: 10px !important;
  }
  
  .listing-card .price-display {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  
  .listing-card .listing-card-actions {
    width: 100% !important;
    flex-direction: row !important;
  }

  /* 2. แก้ไขช่อง Live ตกจอ */
  .live-activity-container {
    margin-left: 0 !important;
    margin-top: 10px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }
  .live-content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 3. โปรไฟล์ที่ Login โดนบีบรูปให้แคบ */
  .user-menu-trigger {
    flex-shrink: 0 !important;
    min-width: max-content !important;
  }
  
  .user-menu-trigger img {
    flex-shrink: 0 !important; /* ป้องกันรูปโดนบีบ */
    width: 30px !important;
    height: 30px !important;
    object-fit: cover !important;
  }
  
  /* จัดการ nav-actions ให้ scroll ได้ถ้าปุ่มเยอะเกิน */
  .nav-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* ซ่อน scrollbar ของ nav-actions */
  .nav-actions::-webkit-scrollbar {
    display: none !important;
  }
}

/* เพิ่มเติมสำหรับหน้าจอเล็กมาก */
@media (max-width: 380px) {
  .user-menu-trigger span {
    display: none !important; /* ซ่อนชื่อถ้าจอเล็กมาก เหลือแต่รูปกับไอคอน */
  }
  
  .user-menu-trigger {
    padding: 5px 8px !important;
  }
}


/* =====================================================
   ADDITIONAL MOBILE FIXES (V3)
   ===================================================== */

@media (max-width: 560px) {
  /* 1. เอาราคาให้ชิดซ้ายมือ */
  .listing-card .price-display {
    justify-content: flex-start !important;
    text-align: left !important;
  }
  
  .listing-card .price-row {
    align-items: flex-start !important;
  }

  /* 2. แก้ไขช่อง Live ที่แสดงข้อมูลหลุดจอ */
  .live-activity-container {
    margin: 10px 0 !important;
    width: calc(100% - 4px) !important; /* กันขอบเล็กน้อย */
    box-sizing: border-box !important;
    display: flex !important;
    overflow: hidden !important; /* กันข้อความยาวล้น */
  }
  
  .live-content {
    flex: 1 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* จัดการ shell ให้ไม่ล้น */
  .shell {
    width: calc(100% - 20px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
  }
}




/* --- UI FOR THEME PICKER --- */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.theme-option {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  cursor: pointer !important;
  border: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  padding: 6px 4px;
  position: relative;
  overflow: hidden;
  min-height: 80px;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.theme-option:hover {
  transform: scale(1.05);
}

/* Label overlay at bottom of theme option */
.theme-option > span,
.theme-option:not(:empty) {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  backdrop-filter: blur(2px);
  pointer-events: none;
  white-space: nowrap;
}

/* Text node label inside theme-option (no wrapper span) */
.theme-option::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  z-index: 1;
  border-radius: 0 0 8px 8px;
  pointer-events: none;
}

.theme-option.active {
  border-color: #f0ad24 !important;
  box-shadow: 0 0 15px rgba(240, 173, 36, 0.6) !important;
  transform: scale(1.08);
  outline: 2px solid #f0ad24;
}

.theme-option * {
  pointer-events: none;
}

.theme-option.locked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0,0,0,0.45);
  background-image: var(--rooc-lock-icon-image);
  background-position: center;
  background-size: 42px 42px;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-customize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-customize:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-customize.premium-only {
  border-color: #f0ad24;
  color: #f0ad24;
}

/* --- MODAL SYSTEM --- */
.modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  width: 100dvw;
  min-height: 100dvh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  font-family: 'Mitr', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.modal-content {
  background: var(--paper);
  padding: 24px;
  border-radius: 16px;
  max-width: 450px;
  width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-content h3 {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.profile-frame-admin-preview,
.store-avatar-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 116px;
  height: 116px;
}

.profile-frame-admin-preview {
  margin: 12px 0;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--paper-soft);
}

.profile-frame-preview-avatar,
.store-avatar-frame > img:first-child {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  object-fit: cover;
}

.profile-frame-preview-frame,
.store-profile-frame-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

.profile-frame-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.profile-frame-option {
  position: relative;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px;
}

.profile-frame-option.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 50%, transparent);
}

.profile-frame-option img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.profile-frame-option span {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}

.profile-frame-option.is-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: rgba(0, 0, 0, 0.5);
  background-image: var(--rooc-lock-icon-image);
  background-position: center;
  background-size: 42px 42px;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* --- PREVIEW STYLES --- */
.post-preview-card {
  margin-top: 20px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.1);
}

.post-preview-card label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  opacity: 0.6;
}


/* ===== PREMIUM CARD BACKGROUNDS (PIXEL ART THEMES) ===== */

/* --- Base: card with pixel art background --- */
.listing-card[class*="theme-pixel-"],
.my-listing-card[class*="theme-pixel-"] {
  position: relative;
  overflow: hidden;
  border-color: transparent !important;
}

.listing-card[class*="theme-pixel-"]::before,
.my-listing-card[class*="theme-pixel-"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
  border-radius: inherit;
  opacity: 0.92;
}

/* Overlay to keep text readable - Darkened for better contrast */
.listing-card[class*="theme-pixel-"]::after,
.my-listing-card[class*="theme-pixel-"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
}

/* All children above the overlay */
.listing-card[class*="theme-pixel-"] > *,
.my-listing-card[class*="theme-pixel-"] > * {
  position: relative;
  z-index: 2;
}

/* Text color overrides for dark backgrounds */
.listing-card[class*="theme-pixel-"] h3,
.listing-card[class*="theme-pixel-"] p,
.listing-card[class*="theme-pixel-"] strong,
.listing-card[class*="theme-pixel-"] .price-row strong,
.my-listing-card[class*="theme-pixel-"] h3,
.my-listing-card[class*="theme-pixel-"] p,
.my-listing-card[class*="theme-pixel-"] strong {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Retheme Badges to be Frosted Glass */
.listing-card[class*="theme-pixel-"] .listing-meta span,
.my-listing-card[class*="theme-pixel-"] .listing-meta span {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Glassmorphism for Item Media and Buttons in Pixel Themes */
.listing-card[class*="theme-pixel-"] .item-media,
.listing-card[class*="theme-pixel-"] .card-media,
.listing-card[class*="theme-pixel-"] .account-listing-media {
  position: relative;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .listing-card[class*="theme-pixel-"] .item-media,
:root[data-theme="dark"] .listing-card[class*="theme-pixel-"] .card-media,
:root[data-theme="dark"] .listing-card[class*="theme-pixel-"] .account-listing-media {
  background: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Retheme Action Buttons to match Pixel Theme */
.listing-card[class*="theme-pixel-"] .listing-card-actions .btn {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: white !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.listing-card[class*="theme-pixel-"] .listing-card-actions .btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Facebook Button Adjustments in Pixel Themes */
.listing-card[class*="theme-pixel-"] .seller-facebook-btn {
  background: rgba(24, 119, 242, 0.6) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Price Row Divider in Pixel Themes */
.listing-card[class*="theme-pixel-"] .price-row {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* --- Premium badge glow for themed cards --- */
.listing-card[class*="theme-pixel-"] {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18), 0 16px 40px rgba(0,0,0,0.35) !important;
  transition: box-shadow 0.3s ease, transform 0.2s ease !important;
}

.listing-card[class*="theme-pixel-"]:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35), 0 24px 50px rgba(0,0,0,0.45) !important;
}

/* --- Individual themes --- */

/* 1. ทุ่งหญ้า (Grass) */
.theme-pixel-grass::before {
  background-image: url('assets/card-bg/theme-pixel-grass.png');
}
.theme-pixel-grass {
  box-shadow: 0 0 0 2px rgba(126, 200, 80, 0.5), 0 16px 40px rgba(90, 171, 58, 0.3) !important;
}
.theme-pixel-grass:hover {
  box-shadow: 0 0 0 2px rgba(126, 200, 80, 0.8), 0 24px 50px rgba(90, 171, 58, 0.5) !important;
}

/* 2. ท้องฟ้า (Sky) */
.theme-pixel-sky::before {
  background-image: url('assets/card-bg/theme-pixel-sky.png');
}
.theme-pixel-sky {
  box-shadow: 0 0 0 2px rgba(78, 192, 202, 0.5), 0 16px 40px rgba(42, 157, 143, 0.3) !important;
}
.theme-pixel-sky:hover {
  box-shadow: 0 0 0 2px rgba(78, 192, 202, 0.8), 0 24px 50px rgba(42, 157, 143, 0.5) !important;
}

/* 3. ทองพิกเซล (Gold) */
.theme-pixel-gold::before {
  background-image: url('assets/card-bg/theme-pixel-gold.png');
}
.theme-pixel-gold {
  box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.6), 0 16px 40px rgba(230, 126, 34, 0.35) !important;
}
.theme-pixel-gold:hover {
  box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.9), 0 24px 50px rgba(230, 126, 34, 0.55) !important;
}

/* 4. คืนดาว (Night) */
.theme-pixel-night::before {
  background-image: url('assets/card-bg/theme-pixel-night.png');
}
.theme-pixel-night {
  box-shadow: 0 0 0 2px rgba(106, 13, 173, 0.5), 0 16px 40px rgba(26, 26, 46, 0.5) !important;
}
.theme-pixel-night:hover {
  box-shadow: 0 0 0 2px rgba(150, 50, 220, 0.8), 0 24px 50px rgba(106, 13, 173, 0.6) !important;
}

/* 5. ชมพูพิกเซล (Pink) */
.theme-pixel-pink::before {
  background-image: url('assets/card-bg/theme-pixel-pink.png');
}
.theme-pixel-pink {
  box-shadow: 0 0 0 2px rgba(255, 133, 162, 0.5), 0 16px 40px rgba(255, 133, 162, 0.3) !important;
}
.theme-pixel-pink:hover {
  box-shadow: 0 0 0 2px rgba(255, 133, 162, 0.85), 0 24px 50px rgba(255, 133, 162, 0.5) !important;
}

/* --- Premium badge on themed cards --- */
.listing-card[class*="theme-pixel-"] .item-media::after {
  content: '✨ Premium';
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #f0ad24;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 20px;
  border: 1px solid rgba(240, 173, 36, 0.4);
  backdrop-filter: blur(4px);
  z-index: 3;
  pointer-events: none;
}

/* --- Theme picker preview thumbnails --- */
.theme-option[data-theme="theme-pixel-grass"] {
  background-image: url('assets/card-bg/theme-pixel-grass.png') !important;
  background-size: cover !important;
  background-position: center !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.theme-option[data-theme="theme-pixel-sky"] {
  background-image: url('assets/card-bg/theme-pixel-sky.png') !important;
  background-size: cover !important;
  background-position: center !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.theme-option[data-theme="theme-pixel-gold"] {
  background-image: url('assets/card-bg/theme-pixel-gold.png') !important;
  background-size: cover !important;
  background-position: center !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.theme-option[data-theme="theme-pixel-night"] {
  background-image: url('assets/card-bg/theme-pixel-night.png') !important;
  background-size: cover !important;
  background-position: center !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.theme-option[data-theme="theme-pixel-pink"] {
  background-image: url('assets/card-bg/theme-pixel-pink.png') !important;
  background-size: cover !important;
  background-position: center !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* --- Premium section label in post form --- */
.post-field .premium-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #f0ad24;
  margin-bottom: 6px;
}

.post-field .premium-label::before {
  content: '✨';
}

/* --- Theme picker in post form - improved --- */
#cardBackgroundField {
  background: rgba(240, 173, 36, 0.05);
  border: 1px solid rgba(240, 173, 36, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}

#cardBackgroundField > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #f0ad24;
  margin-bottom: 4px;
}

#cardBackgroundField > span::before {
  content: '✨ ';
}

/* --- Modal theme picker improvements --- */
.modal-content .theme-picker-grid {
  grid-template-columns: repeat(3, 1fr);
}

.theme-option {
  aspect-ratio: 2/3;
  min-height: 80px;
}

/* --- My listings card with theme --- */
.my-listing-card[class*="theme-pixel-"] {
  min-height: 200px;
}

.my-listing-card[class*="theme-pixel-"] img {
  position: relative;
  z-index: 2;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* ===== END PREMIUM CARD BACKGROUNDS ===== */


/* ===== Step Progress Indicator ===== */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  background: var(--paper-soft);
  border-radius: 12px;
  gap: 0.5rem;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.step-item.active .step-number {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 125, 220, 0.1);
  transform: scale(1.1);
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label {
  color: var(--blue);
  font-weight: 600;
}

.step-divider {
  flex: 0.5;
  height: 2px;
  background: var(--line);
  margin: 0 -0.25rem;
  transition: background 0.3s ease;
}

.step-item.active ~ .step-divider {
  background: var(--blue);
}

@media (max-width: 768px) {
  .step-progress {
    padding: 1rem;
    margin: 1.5rem 0 2rem;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .step-label {
    font-size: 11px;
  }
}

/* ===== Enhanced Category Picker ===== */
.category-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.category-picker button {
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.category-picker button:hover {
  border-color: var(--blue);
  background: var(--aqua);
  transform: translateY(-2px);
}

.category-picker button.is-active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(23, 125, 220, 0.25);
  transform: scale(1.05);
}

.category-picker button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.category-picker button:active::before {
  width: 300px;
  height: 300px;
}

/* ===== Form Block Improvements ===== */
.form-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.form-block:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(23, 125, 220, 0.1);
}

.form-block-head {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-block-head span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.form-block-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.form-block-head p {
  margin: 0.25rem 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Premium Card Background Section ===== */
#cardBackgroundField {
  background: linear-gradient(135deg, rgba(23, 125, 220, 0.05) 0%, rgba(240, 173, 36, 0.05) 100%);
  border: 2px dashed var(--blue);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

#cardBackgroundField span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--blue);
  font-size: 15px;
}

#cardBackgroundField p {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.theme-option {
  aspect-ratio: 2/3;
  border: 3px solid var(--line);
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.5rem;
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: all !important;
}

.theme-option::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.theme-option:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.theme-option.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold), 0 8px 24px rgba(240, 173, 36, 0.3);
  transform: scale(1.08);
}

.theme-option span {
  position: relative;
  z-index: 2;
}

/* ===== Post Actions ===== */
.post-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-actions button {
  flex: 1;
  padding: 0.875rem 1.5rem;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.post-actions .btn-light {
  background: var(--paper-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.post-actions .btn-light:hover {
  background: var(--line);
}

.post-actions .btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-2) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(23, 125, 220, 0.3);
}

.post-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 125, 220, 0.4);
}

.post-actions .btn-primary:active {
  transform: translateY(0);
}

/* ===== Preview Panel Improvements ===== */
.preview-panel {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.preview-sticky {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-sticky .eyebrow {
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.preview-sticky h3 {
  margin: 0 0 1rem;
  font-size: 18px;
}

.preview-card {
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.preview-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(23, 125, 220, 0.15);
}

@media (max-width: 1024px) {
  .post-layout {
    flex-direction: column;
  }

  .preview-panel {
    position: static;
    margin-top: 2rem;
  }

  .preview-sticky {
    position: static;
  }
}


/* ===== MY LISTINGS PAGE IMPROVEMENTS ===== */

/* Panel Head Improvements */
.my-listings-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.panel-title-group {
  flex: 1;
  min-width: 200px;
}

.panel-title-group h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  color: var(--ink);
}

.panel-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Search Input */
.search-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  min-width: 200px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 125, 220, 0.1);
}

.search-input::placeholder {
  color: var(--muted);
}

/* Dashboard Overview */
.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--paper-soft) 0%, var(--paper) 100%);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.quota-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--paper);
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: all 0.3s ease;
}

.quota-item:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(23, 125, 220, 0.15);
  transform: translateY(-2px);
}

.quota-icon {
  font-size: 1.75rem;
  min-width: 2.5rem;
  text-align: center;
}

.quota-item div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.quota-item span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.quota-item strong {
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 600;
}

/* My Listing Card Improvements */
.my-listing-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.my-listing-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(23, 125, 220, 0.15);
  transform: translateY(-4px);
}

.my-listing-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper-soft);
}

.my-listing-card > div:nth-child(2) {
  flex: 1;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.listing-meta span {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--paper-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  text-transform: uppercase;
}

.listing-meta span.fast {
  background: rgba(240, 173, 36, 0.1);
  color: var(--gold);
  border-color: var(--gold);
}

.listing-meta span.buy {
  background: rgba(24, 166, 106, 0.1);
  color: var(--green);
  border-color: var(--green);
}

.listing-meta span.verified {
  background: rgba(85, 184, 255, 0.1);
  color: var(--blue);
  border-color: var(--blue);
}

.listing-meta span.expired {
  background: rgba(255, 85, 85, 0.1);
  color: #ff5555;
  border-color: #ff5555;
}

.listing-meta span.time-left {
  background: rgba(85, 184, 255, 0.1);
  color: var(--blue);
  border-color: var(--blue);
}

.my-listing-card h3 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.4;
}

.my-listing-card p {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.my-listing-card strong {
  display: block;
  margin: 0.75rem 0;
  font-size: 1.25rem;
  color: var(--green);
}

.offer-status {
  font-size: 0.85rem !important;
  color: var(--blue) !important;
  font-weight: 600 !important;
  margin: 0.5rem 0 !important;
}

/* Offer Mailbox */
.offer-mailbox {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--paper-soft);
  border-radius: 8px;
  border-left: 3px solid var(--blue);
}

.offer-mailbox.is-empty {
  opacity: 0.6;
}

.offer-mailbox strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.offer-mailbox p {
  color: var(--muted);
  font-size: 0.85rem;
}

.offer-mail {
  padding: 0.9rem;
  margin: 0.5rem 0;
  background: var(--paper);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.offer-mailbox > .offer-mail:not(.offer-mail-detail) {
  display: none;
}

.offer-mail-detail {
  min-width: 0;
  overflow: hidden;
}

.offer-mail-head {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.offer-mail-head b {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.offer-mail-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-mail-message {
  display: none;
  margin-top: 8px;
}

.offer-mail-message-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-soft);
  margin-top: 8px;
  padding: 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.offer-mail-message-button:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 16%, var(--paper-soft));
}

.offer-mail-message p,
.offer-mail-empty {
  display: block;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.offer-message-popup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: grid !important;
  place-items: center !important;
  background: rgba(2, 8, 16, 0.72) !important;
  padding: 20px !important;
  backdrop-filter: blur(10px);
}

.offer-message-popup[hidden] {
  display: none !important;
}

.offer-message-popup-card {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.offer-message-popup-card h3 {
  color: var(--ink) !important;
}

.offer-message-popup-card .eyebrow {
  color: var(--blue) !important;
}

.offer-message-popup-card .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.offer-message-popup-meta {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 12px;
}

.offer-message-popup-meta strong {
  color: var(--green);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.offer-message-popup-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.offer-message-popup-text {
  min-height: 90px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.offer-mail div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.offer-mail b {
  color: var(--green);
  font-size: 0.95rem;
}

.offer-mail span {
  font-size: 0.8rem;
  color: var(--muted);
}

.offer-mail p {
  margin: 0.5rem 0 0 0;
  padding: 0.5rem;
  background: var(--paper-soft);
  border-radius: 4px;
  font-size: 0.85rem;
}

/* My Listing Actions */
.my-listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  flex: 1;
  min-width: 80px;
}

.btn-small:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  transform: translateY(-1px);
}

.btn-small.btn-customize {
  background: linear-gradient(135deg, rgba(240, 173, 36, 0.1), rgba(85, 184, 255, 0.1));
  border-color: var(--gold);
  color: var(--gold);
}

.btn-small.btn-customize:hover {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

.btn-small.btn-light {
  background: var(--paper);
  border-color: var(--line);
  color: var(--muted);
}

.btn-small.btn-light:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.btn-small.btn-sold {
  background: rgba(255, 85, 85, 0.1);
  border-color: #ff5555;
  color: #ff5555;
}

.btn-small.btn-sold:hover {
  background: #ff5555;
  border-color: #ff5555;
  color: white;
}

.my-delete {
  background: rgba(255, 85, 85, 0.1);
  border-color: #ff5555;
  color: #ff5555;
}

.my-delete:hover {
  background: #ff5555;
  border-color: #ff5555;
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--paper-soft);
  border-radius: 12px;
  border: 2px dashed var(--line);
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.empty-state p {
  margin: 0 0 1.5rem 0;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .my-listings-panel .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .panel-actions {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }

  .dashboard-overview {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }

  .quota-item {
    padding: 0.75rem;
  }

  .my-listing-actions {
    gap: 0.25rem;
  }

  .btn-small {
    min-width: 70px;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }
}


/* ===== STORE PAGE STYLES (NEW) ===== */

.store-profile-header {
  margin-bottom: 2.5rem;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.store-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--blue) 0%, #6366f1 100%);
  position: relative;
}

.store-info-container {
  padding: 0 2rem 2rem;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  margin-top: -50px;
  position: relative;
  flex-wrap: wrap;
}

.store-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  background: var(--paper);
  border-radius: 20px;
  padding: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border: 4px solid var(--paper);
}

.store-avatar {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.store-avatar #storeAvatar {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100% !important;
  height: 100% !important;
  transform: translate(-50%, -50%);
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  z-index: 1;
}

.store-avatar .store-profile-frame-image {
  inset: -22px -21px -22px -21px;
  width: calc(100% + 42px);
  height: calc(100% + 44px);
  transform: translateY(-3px);
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  z-index: 3;
}

.store-avatar .status-indicator {
  z-index: 4;
}

.premium-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 8px rgba(240, 173, 36, 0.3);
  z-index: 2;
}

.store-details {
  flex: 1;
  min-width: 300px;
  padding-bottom: 0.5rem;
}

.store-name-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.store-name-row h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--ink);
  font-weight: 800;
}

.trust-badge {
  background: rgba(24, 166, 106, 0.1);
  color: var(--green);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(24, 166, 106, 0.2);
}

.store-description {
  margin: 0 0 1rem 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.5;
}

.store-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.store-meta span {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.store-stats-grid {
  display: flex;
  gap: 1rem;
  min-width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.stat-card {
  flex: 1;
  background: var(--paper-soft);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--line);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Public View Adjustments */
.public-view .my-listing-actions,
.public-view .offer-mailbox,
.public-view #listingsBreadcrumb,
.public-view .panel-head .panel-actions,
.public-view .quota-item:not(:last-child) {
  display: none !important;
}

.public-view .my-listings-panel {
  background: transparent;
  border: none;
  padding: 0;
}

.public-view .panel-title-group h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Responsive Store */
@media (max-width: 768px) {
  .store-info-container {
    padding: 0 1.25rem 1.5rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .store-details {
    min-width: 100%;
  }
  
  .store-name-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .store-meta {
    justify-content: center;
    gap: 1rem;
  }
  
  .store-stats-grid {
    flex-wrap: wrap;
  }
  
  .stat-card {
    min-width: calc(50% - 0.5rem);
  }
}


/* Theme picker modal - no overlay/shadow for all pages */
.theme-picker-modal .theme-option::before,
.theme-picker-modal .theme-option:not(.locked)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent !important;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
}

.theme-picker-modal .theme-option.locked::after,
.theme-option.locked::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  background-image: var(--rooc-lock-icon-image) !important;
  background-position: center !important;
  background-size: 48px 48px !important;
  background-repeat: no-repeat !important;
  z-index: 10 !important;
  border-radius: inherit !important;
  pointer-events: none !important;
}

/* --- Smooth Transitions & Loading Effects --- */

/* Page Fade-in */
body {
  animation: pageFadeIn 0.6s ease-out forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--paper-soft) 25%, var(--line) 50%, var(--paper-soft) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 380px;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
}

/* Compact listing cards: reduce vertical gaps without changing content */
.listing-grid .listing-card {
  height: 100%;
  min-height: 420px;
  gap: 6px;
  padding: 10px;
}

.listing-grid .listing-seller {
  margin-top: 6px;
  gap: 5px;
}

.listing-grid .listing-meta {
  margin-top: 4px;
  margin-bottom: 0;
  gap: 4px;
}

.listing-grid .listing-card h3 {
  min-height: 0;
  margin: 2px 0 0;
  line-height: 1.18;
}

.listing-grid .listing-detail-line,
.listing-grid .listing-character-name,
.listing-grid .listing-middleman-status {
  min-height: 0;
  max-height: none;
  margin: 0;
  line-height: 1.2;
}

.listing-grid .listing-card p {
  min-height: 0;
}

.listing-grid .listing-detail-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-grid .listing-description {
  max-height: 1.3em;
  margin: 0 !important;
  -webkit-line-clamp: 1;
  line-height: 1.3;
}

.listing-grid .listing-description.is-expanded {
  max-height: 3.9em;
  -webkit-line-clamp: 3;
}

.listing-grid .description-toggle {
  margin: -1px 0 4px;
}

.listing-grid .price-row {
  margin-top: auto;
  padding-top: 8px;
}

.skeleton-text {
  height: 16px;
  width: 80%;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-btn {
  height: 36px;
  width: 100%;
  margin-top: auto;
}

/* Staggered Card Animation */
.listing-card {
  opacity: 0;
  transform: translateY(20px);
  animation: cardAppear 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes cardAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Delay for staggered effect (applied via JS) */
.listing-card:nth-child(1) { animation-delay: 0.05s; }
.listing-card:nth-child(2) { animation-delay: 0.1s; }
.listing-card:nth-child(3) { animation-delay: 0.15s; }
.listing-card:nth-child(4) { animation-delay: 0.2s; }
.listing-card:nth-child(5) { animation-delay: 0.25s; }
.listing-card:nth-child(6) { animation-delay: 0.3s; }

/* สไตล์สำหรับรายการที่ขายแล้ว (Sold Items) */
.listing-card.is-sold {
  position: relative;
}
.listing-card.is-sold .item-media {
  position: relative;
  filter: grayscale(0.4);
}
.sold-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 2px;
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 2;
  pointer-events: none;
}

.sold-overlay.is-buy-completed {
  background: rgba(22, 163, 74, 0.92);
  padding-inline: 9px;
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
}

.listing-card.is-closed {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.push-permission-prompt {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 28px));
  border: 1px solid rgba(87, 180, 255, 0.28);
  border-radius: 20px;
  background: rgba(12, 24, 38, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  color: var(--text);
  padding: 12px;
  backdrop-filter: blur(16px);
  animation: pushPromptIn 180ms ease-out;
}

.push-permission-prompt.is-denied {
  border-color: rgba(255, 191, 87, 0.38);
}

.push-permission-prompt.is-install {
  border-color: rgba(87, 180, 255, 0.42);
}

.push-permission-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: rgba(87, 180, 255, 0.13);
  color: var(--blue);
}

.push-permission-prompt.is-denied .push-permission-icon {
  background: rgba(255, 191, 87, 0.13);
  color: var(--gold);
}

.push-permission-prompt.is-install .push-permission-icon {
  background: rgba(87, 180, 255, 0.16);
  color: var(--blue);
}

.push-permission-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.push-permission-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.push-permission-copy strong,
.push-permission-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.push-permission-copy strong {
  font-weight: 900;
}

.push-permission-copy small {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
}

.push-permission-actions {
  display: inline-flex;
  gap: 8px;
}

@keyframes pushPromptIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (max-width: 560px) {
  .nav-actions {
    display: contents !important;
  }

  .nav {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .nav > .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .nav > .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav-actions > .theme-switch {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .nav-actions > .icon-button,
  .nav-actions > .mailbox-trigger {
    width: 36px;
    height: 36px;
  }

  .nav-actions > .user-tools {
    display: flex;
    grid-column: 1 / -1;
    grid-row: auto;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    min-width: 0;
  }

  .nav-actions > .user-tools::-webkit-scrollbar {
    display: none;
  }

  .nav-actions > .auth-link {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .nav-actions > .btn-primary {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
    min-height: 40px;
  }

  .push-permission-prompt {
    right: 10px;
    bottom: 10px;
    left: 10px;
    grid-template-columns: 38px minmax(0, 1fr);
    max-width: none;
  }

  .push-permission-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .push-permission-actions .btn {
    flex: 1 1 0;
  }
}
