/* Campus Market — base styles */

:root {
  --bg: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --border: #ebe6dc;
  --border-strong: #d9d2c5;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: #fff7ed;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --header-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glass-light: rgba(251, 248, 242, 0.75);
  --glass-border: rgba(255, 255, 255, 0.55);
  --menu-bg: rgba(255, 253, 249, 0.86);
  --grain-opacity: 0.1;
  --danger-border: #fecaca;
  --notice-text: #9a3412;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #1a2233;
  --border: #232d42;
  --border-strong: #33405a;
  --text: #e8ebf1;
  --text-2: #b7c0ce;
  --text-3: #8b95a8;
  --primary: #f97316;
  --primary-hover: #fb8a3c;
  --primary-soft: rgba(249, 115, 22, 0.14);
  --success: #4ade80;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --danger-border: rgba(248, 113, 113, 0.35);
  --notice-text: #fdba74;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);
  --glass-light: rgba(14, 19, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --menu-bg: rgba(22, 29, 44, 0.85);
  --grain-opacity: 0.05;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(249, 115, 22, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Very light paper grain behind the content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
}

[data-theme="dark"] body::before {
  mix-blend-mode: screen;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted {
  color: var(--text-3);
}

.hint {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
}

.center {
  text-align: center;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
  text-decoration: none !important;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary {
  box-shadow: 0 1px 2px rgba(154, 52, 18, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.26);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-btn:hover {
  text-decoration: underline;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--glass-light);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none !important;
}

.brand-emblem {
  height: 34px;
  width: auto;
  transition: transform 0.5s var(--ease-spring);
}

.brand:hover .brand-emblem {
  transform: scale(1.12) rotate(-6deg);
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none !important;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.92);
}

.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle .ti {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s;
}

.theme-toggle .ti-moon,
[data-theme="dark"] .theme-toggle .ti-sun {
  transform: translateY(120%) rotate(-90deg);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .ti-moon {
  transform: none;
  opacity: 1;
  color: #fdba74;
}

.account {
  position: relative;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.account-btn:hover {
  background: var(--surface-2);
}

.account-btn .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background: var(--menu-bg);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.18s, transform 0.22s var(--ease-out), visibility 0.22s;
}

.account-menu.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.account-menu-head {
  padding: 10px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.account-menu-head span {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu a,
.account-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none !important;
}

.account-menu a:hover,
.account-menu button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.account-menu .icon {
  width: 16px;
  height: 16px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 0;
  background: none;
  cursor: pointer;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Avatar ---------- */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.badge .icon {
  width: 13px;
  height: 13px;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-dark {
  background: var(--text);
  color: var(--surface);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 96px 0 104px;
  isolation: isolate;
}

.hero-compact {
  padding: 64px 0 72px;
}

.hero-media,
.hero-slide,
.hero-scrim {
  position: absolute;
  inset: 0;
}

.hero-media {
  z-index: -2;
  background: #431407;
}

.hero-slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s ease, transform 8s linear;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-scrim {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.35) 55%, rgba(15, 23, 42, 0.15) 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.45) 0%, transparent 40%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 40px;
  align-items: end;
}

.hero-compact .hero-inner {
  grid-template-columns: minmax(0, 720px);
}

.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 24px 60px rgba(2, 6, 23, 0.3);
}

.hero-card {
  padding: 36px 40px 40px;
  animation: rise 0.9s var(--ease-out) both;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.logo-tile {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.25);
  flex-shrink: 0;
}

.logo-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero h1 {
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 16ch;
  text-wrap: balance;
}

.lead {
  margin-top: 16px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.trust-list {
  list-style: none;
  margin: 0;
  padding: 24px;
  display: grid;
  gap: 18px;
  animation: rise 0.9s 0.15s var(--ease-out) both;
}

.trust-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.trust-list .icon {
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.trust-list strong {
  display: block;
  font-size: 15px;
}

.trust-list span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.hero-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.4s var(--ease-out), background 0.3s;
}

.hero-dot.active {
  width: 26px;
  background: #fff;
}

/* ---------- Listings toolbar ---------- */

.listings-section {
  padding-top: 32px;
  padding-bottom: 64px;
}

.toolbar {
  display: flex;
  gap: 12px;
}

.search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search .icon {
  position: absolute;
  left: 14px;
  color: var(--text-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}

.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.toolbar .select {
  width: auto;
  height: 44px;
  min-width: 190px;
}

.chips {
  display: flex;
  gap: 8px;
  margin: 16px 0 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}

.chip:active {
  transform: scale(0.96);
}

.chip .icon {
  width: 16px;
  height: 16px;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

.results-count {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 14px;
}

/* ---------- Cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out), border-color 0.35s;
}

.card:hover {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  border-color: transparent;
  transform: translateY(-4px);
}

.card-link {
  color: inherit;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-media {
  position: relative;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.card.is-sold .thumb {
  opacity: 0.55;
}

.card-body {
  padding: 14px 16px 16px;
}

.card-price {
  font-size: 18px;
  font-weight: 700;
}

.card-price small,
.detail-price small {
  font-size: 0.65em;
  font-weight: 500;
  color: var(--text-3);
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.card-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.card-actions .btn {
  flex: 1;
}

/* ---------- Thumbnails ---------- */

.thumb {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.card:hover .thumb img,
.card:hover .thumb-placeholder .icon {
  transform: scale(1.05);
}

.thumb-placeholder .icon {
  transition: transform 0.6s var(--ease-out);
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.thumb-placeholder .icon {
  width: 44px;
  height: 44px;
  stroke-width: 1.3;
}

.thumb-placeholder.cat-textbooks { background: #eff6ff; color: #2563eb; }
.thumb-placeholder.cat-electronics { background: #f5f3ff; color: #7c3aed; }
.thumb-placeholder.cat-furniture { background: #fff7ed; color: #c2410c; }
.thumb-placeholder.cat-clothing { background: #fdf2f8; color: #be185d; }
.thumb-placeholder.cat-services { background: #ecfdf5; color: #047857; }
.thumb-placeholder.cat-other { background: #f1f5f9; color: #475569; }

[data-theme="dark"] .thumb-placeholder.cat-textbooks { background: rgba(37, 99, 235, 0.14); color: #93c5fd; }
[data-theme="dark"] .thumb-placeholder.cat-electronics { background: rgba(124, 58, 237, 0.16); color: #c4b5fd; }
[data-theme="dark"] .thumb-placeholder.cat-furniture { background: rgba(234, 88, 12, 0.14); color: #fdba74; }
[data-theme="dark"] .thumb-placeholder.cat-clothing { background: rgba(219, 39, 119, 0.14); color: #f9a8d4; }
[data-theme="dark"] .thumb-placeholder.cat-services { background: rgba(5, 150, 105, 0.14); color: #6ee7b7; }
[data-theme="dark"] .thumb-placeholder.cat-other { background: rgba(148, 163, 184, 0.1); color: #cbd5e1; }

.thumb-lg {
  border-radius: var(--radius-lg);
  aspect-ratio: 1 / 1;
}

.thumb-lg.thumb-placeholder .icon {
  width: 96px;
  height: 96px;
  stroke-width: 1;
}

.thumb-sm {
  width: 64px;
  height: 64px;
  aspect-ratio: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.thumb-sm.thumb-placeholder .icon {
  width: 26px;
  height: 26px;
}

/* ---------- Empty states ---------- */

.empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty.compact {
  padding: 32px 24px;
}

.empty h3 {
  font-size: 17px;
}

.empty p {
  color: var(--text-3);
}

.empty .btn {
  margin-top: 8px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-3);
  margin-bottom: 4px;
}

/* ---------- Pages ---------- */

.page {
  padding-top: 32px;
  padding-bottom: 64px;
}

.page-narrow {
  max-width: 880px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
}

.page-header p {
  color: var(--text-3);
  margin-top: 4px;
}

.subheading {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel > .subheading:first-child {
  margin-top: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.back-link .icon {
  width: 16px;
  height: 16px;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--notice-text);
  font-size: 14px;
  margin: 16px 0 0;
}

/* ---------- Forms ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.field .hint {
  margin-top: 0;
}

.optional {
  font-weight: 400;
  color: var(--text-3);
}

.field-row {
  display: flex;
  gap: 16px;
}

.input,
.select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.input::placeholder {
  color: #94a3b8;
}

.otp-input {
  height: 52px;
  font-size: 22px;
  letter-spacing: 0.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
  font-weight: 400 !important;
}

.dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone .icon {
  width: 24px;
  height: 24px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.dropzone strong {
  color: var(--primary);
}

.upload-preview {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.upload-preview img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ---------- Auth ---------- */

.auth {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: calc(100vh - var(--header-h));
}

.auth-aside {
  position: relative;
  background-color: #431407;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 48px 40px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}

.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.65) 100%);
}

.auth-aside-inner {
  padding: 28px;
  animation: rise 0.8s var(--ease-out) both;
}

.auth-aside .logo-tile {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
}

.auth-aside h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-points {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.auth-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.auth-points .icon {
  margin-top: 1px;
  color: #fdba74;
}

.auth-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 64px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 700;
}

.auth-card > .muted {
  margin-top: 6px;
}

.auth-card .form {
  margin-top: 24px;
}

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}

.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  font-size: 13px;
  color: var(--text-3);
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.steps li:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.steps span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.steps span .icon {
  width: 14px;
  height: 14px;
}

.steps li.current {
  color: var(--text);
  font-weight: 500;
}

.steps li.current span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.steps li.done span {
  background: var(--primary-soft);
  border-color: var(--primary-soft);
  color: var(--primary);
}

.id-capture {
  margin: 24px 0 16px;
  display: grid;
  gap: 12px;
}

.id-video {
  display: none;
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

.id-video.visible {
  display: block;
}

.id-preview {
  aspect-ratio: 16 / 10;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-3);
  overflow: hidden;
  background: var(--surface);
}

.id-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-preview .icon {
  width: 28px;
  height: 28px;
}

/* ---------- Detail ---------- */

.detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: start;
}

.detail-media {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.detail-info h1 {
  font-size: 28px;
  font-weight: 700;
  margin-top: 14px;
}

.detail-price {
  font-size: 30px;
  font-weight: 700;
  margin-top: 8px;
}

.detail-posted {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 4px;
}

.actions-panel {
  margin-top: 24px;
  display: grid;
  gap: 10px;
  padding: 20px;
}

.detail-desc {
  color: var(--text-2);
  white-space: pre-line;
}

.seller {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
}

.verified .icon {
  width: 14px;
  height: 14px;
}

.share-btn {
  margin-top: 24px;
  font-size: 14px;
}

.share-btn .icon {
  width: 16px;
  height: 16px;
}

/* ---------- Profile ---------- */

.profile {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.profile-card h1 {
  font-size: 19px;
  font-weight: 600;
}

.profile-details {
  width: 100%;
  margin: 8px 0 4px;
  text-align: left;
  display: grid;
  gap: 10px;
}

.profile-details div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-details dt {
  font-size: 12px;
  color: var(--text-3);
}

.profile-details dd {
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

.profile-stats div {
  display: flex;
  flex-direction: column;
}

.profile-stats div + div {
  border-left: 1px solid var(--border);
}

.profile-stats strong {
  font-size: 22px;
}

.profile-stats span {
  font-size: 12px;
  color: var(--text-3);
}

.profile .page-header {
  margin-bottom: 0;
}

/* ---------- Messages ---------- */

.messages {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: min(640px, calc(100vh - 220px));
  min-height: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.conv-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.conv-list .empty {
  border: 0;
  background: none;
}

.conv {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none !important;
}

.conv:hover {
  background: var(--surface-2);
}

.conv.active {
  background: var(--primary-soft);
}

.conv-text {
  min-width: 0;
  flex: 1;
}

.conv-text strong {
  font-size: 14px;
}

.conv-listing {
  display: block;
  font-size: 12px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-text p {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.chat-header > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header a.muted {
  font-size: 13px;
}

.chat-back {
  display: none;
  color: var(--text-2);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
}

.bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.bubble time {
  display: block;
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.7;
}

.bubble.mine {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.theirs {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
}

.chat-empty .icon {
  width: 32px;
  height: 32px;
}

/* ---------- Checkout ---------- */

.checkout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.summary-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.summary-item > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-2);
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 14px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.summary .hint {
  margin-top: 16px;
}

/* ---------- Footer ---------- */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand p {
  color: var(--text-3);
  font-size: 14px;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-2);
  font-size: 14px;
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.4s var(--ease-spring);
  z-index: 100;
  max-width: calc(100% - 32px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Password fields ---------- */

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.pw-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.pw-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 2px;
}

.pw-meter span {
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  transition: background 0.3s;
}

.pw-meter[data-score="1"] span:nth-child(-n + 1) { background: #ef4444; }
.pw-meter[data-score="2"] span:nth-child(-n + 2) { background: #f59e0b; }
.pw-meter[data-score="3"] span:nth-child(-n + 3) { background: #22c55e; }
.pw-meter[data-score="4"] span { background: #16a34a; }

.forgot-link {
  align-self: flex-end;
  margin-top: -8px;
  font-size: 13px;
  font-weight: 500;
}

.link-plain {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* ---------- Motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.page-enter {
  animation: page-in 0.5s var(--ease-out) both;
}

.card {
  opacity: 0;
  transform: translateY(16px);
}

.card.revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.6s var(--ease-out) var(--delay, 0ms),
    transform 0.6s var(--ease-out) var(--delay, 0ms),
    box-shadow 0.35s var(--ease-out),
    border-color 0.35s;
}

.card.revealed:hover {
  transform: translateY(-4px);
  transition-delay: 0ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .card {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Theme transitions ---------- */

/* Ink bleed: the new theme spreads from the click point through an ink-blot mask. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.ink-transition::view-transition-new(root) {
  --ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='f' x='-25%25' y='-25%25' width='150%25' height='150%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.045' numOctaves='3' seed='7'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='26'/%3E%3C/filter%3E%3Cg filter='url(%23f)'%3E%3Ccircle cx='100' cy='100' r='58'/%3E%3Ccircle cx='153' cy='60' r='7'/%3E%3Ccircle cx='46' cy='150' r='5'/%3E%3Ccircle cx='160' cy='142' r='4'/%3E%3Ccircle cx='50' cy='54' r='6'/%3E%3Ccircle cx='100' cy='170' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: var(--ink);
  mask-image: var(--ink);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 0 0;
  mask-size: 0 0;
}

/* Fallback when View Transitions aren't available */
.theme-fade *,
.theme-fade *::before,
.theme-fade *::after {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease !important;
}

/* ---------- Opening splash ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 45%, rgba(249, 115, 22, 0.16), transparent 55%),
    var(--bg);
  cursor: pointer;
  animation: splash-out 0.7s 2.5s var(--ease-out) forwards;
}

.no-splash .splash {
  display: none;
}

.splash.skip {
  animation: splash-out 0.4s var(--ease-out) forwards;
}

.splash-stage {
  position: relative;
  width: min(260px, 62vw);
  aspect-ratio: 1;
}

.bloom {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: bloom-spin 9s linear infinite;
}

.petal {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(0);
  animation: petal-open 0.95s var(--d, 0ms) var(--ease-spring) forwards;
}

.petals-outer .petal {
  fill: url(#petal-orange);
  opacity: 0.55;
}

.petals-inner .petal {
  fill: url(#petal-blue);
  opacity: 0.5;
}

.bloom-core {
  fill: var(--surface);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation: core-open 0.7s 0.45s var(--ease-spring) forwards;
  filter: drop-shadow(0 6px 18px rgba(234, 88, 12, 0.35));
}

.splash-emblem {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  filter: blur(6px);
  animation: emblem-in 0.9s 0.65s var(--ease-spring) forwards;
}

.splash-title {
  display: flex;
  gap: 0.35em;
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.splash-title span {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s var(--ease-out) forwards;
}

.splash-title span:first-child {
  animation-delay: 1.15s;
}

.splash-title span:last-child {
  animation-delay: 1.3s;
  color: var(--primary);
}

@keyframes petal-open {
  to {
    transform: scale(1);
  }
}

@keyframes core-open {
  to {
    transform: scale(1);
  }
}

@keyframes emblem-in {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: none;
  }
}

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

@keyframes splash-out {
  to {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(6px);
    visibility: hidden;
    pointer-events: none;
  }
}

/* ==========================================================
   v2 features
   ========================================================== */

/* Unread badge in nav */
.nav-link {
  position: relative;
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
  animation: pop 0.4s var(--ease-spring);
}

.nav-badge[hidden] {
  display: none;
}

@keyframes pop {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}

/* Cards: save heart + tags */
.card {
  position: relative;
}

.save-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--menu-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), color 0.2s;
  z-index: 2;
}

.save-btn:hover {
  transform: scale(1.1);
  color: var(--danger);
}

.save-btn.on,
.save-toggle.on {
  color: #e11d48;
}

.save-btn.on .icon,
.save-toggle.on .icon {
  fill: currentColor;
}

.save-btn.on {
  animation: heart 0.45s var(--ease-spring);
}

@keyframes heart {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.neg {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 3px;
}

.code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-sale {
  background: var(--primary);
  color: #fff;
}

.badge-code {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.chip-sale:not(.active) {
  border-color: rgba(234, 88, 12, 0.35);
  color: var(--primary);
}

/* Stars + ratings */
.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--border-strong);
}

.stars .icon {
  width: 15px;
  height: 15px;
}

.stars .on {
  color: #f59e0b;
}

.stars .on .icon {
  fill: currentColor;
}

.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.rating-none {
  font-size: 13px;
}

/* Detail page additions */
.meetup {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 14px;
}

.meetup .icon {
  color: var(--primary);
}

.gallery-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: page-in 0.35s var(--ease-out);
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.gallery-thumb {
  width: 68px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  opacity: 0.7;
  transition: opacity 0.2s, border-color 0.2s;
}

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

.gallery-thumb.active,
.gallery-thumb:hover {
  opacity: 1;
  border-color: var(--primary);
}

.btn-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rate-panel {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  border-color: rgba(245, 158, 11, 0.4);
}

.rate-panel .subheading {
  margin: 0;
}

.star-input {
  display: flex;
  gap: 4px;
}

.star-input button {
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--border-strong);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), color 0.15s;
}

.star-input button .icon {
  width: 30px;
  height: 30px;
}

.star-input button:hover {
  transform: scale(1.15);
}

.star-input button.on {
  color: #f59e0b;
}

.star-input button.on .icon {
  fill: currentColor;
}

.rate-thanks {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--success);
  font-weight: 500;
}

.detail-links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
  font-size: 14px;
}

.detail-links .icon {
  width: 16px;
  height: 16px;
}

.link-muted {
  color: var(--text-3);
}

.notice-warn {
  margin: 0;
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .notice-warn,
[data-theme="dark"] .badge-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

/* Dialog (report) */
.dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.dialog[open] {
  animation: page-in 0.3s var(--ease-out);
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.dialog h2 {
  font-size: 19px;
}

.radio-list {
  display: grid;
  gap: 6px;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.radio:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.radio input {
  accent-color: var(--primary);
}

/* Sell form additions */
.promo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px dashed rgba(234, 88, 12, 0.45);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text);
  text-decoration: none !important;
  transition: transform 0.25s var(--ease-out);
}

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

.promo-link > .icon:first-child {
  color: var(--primary);
}

.promo-link > span {
  flex: 1;
  font-size: 14px;
}

.promo-link > .icon:last-child {
  transform: rotate(180deg);
  color: var(--text-3);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  user-select: none;
}

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

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease-spring);
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

.photo-slot,
.photo-add {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: page-in 0.35s var(--ease-out);
}

.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.photo-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.photo-cover {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  cursor: pointer;
}

.photo-remove .icon {
  width: 14px;
  height: 14px;
}

/* Moving-out bulk form */
.bulk-head,
.bulk-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 1.1fr) 36px;
  gap: 8px;
  align-items: center;
}

.bulk-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#bulk-rows {
  display: grid;
  gap: 8px;
}

.bulk-row {
  animation: page-in 0.3s var(--ease-out);
}

.bulk-add {
  justify-self: start;
}

.bulk-count {
  margin-right: auto;
  align-self: center;
  font-size: 13px;
}

/* Wanted */
.wanted-form-panel {
  margin-bottom: 20px;
  padding: 0;
}

.wanted-form-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.wanted-form-panel summary::-webkit-details-marker {
  display: none;
}

.wanted-form-panel summary .icon {
  color: var(--primary);
}

.wanted-form-panel form {
  padding: 0 24px 24px;
}

.wanted-list {
  display: grid;
  gap: 12px;
}

.wanted-card {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
}

.wanted-card:hover {
  transform: none;
}

.wanted-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.wanted-body {
  flex: 1;
  min-width: 0;
}

.wanted-body h3 {
  font-size: 16px;
  font-weight: 600;
}

.wanted-body p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 4px;
}

.wanted-body .card-meta {
  flex-wrap: wrap;
}

.wanted-budget {
  font-weight: 600;
  color: var(--text);
}

.wanted-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 14px;
}

.wanted-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wanted-contact .icon {
  width: 16px;
  height: 16px;
}

.wanted-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* Messages unread */
.conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conv-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Reviews */
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.review {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.review .muted {
  font-size: 12px;
}

.profile-card .rating-summary,
.profile-card .rating-none {
  margin-top: -4px;
}

@media (max-width: 760px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bulk-head {
    display: none;
  }

  .bulk-row {
    grid-template-columns: 1fr 1fr 36px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .bulk-row [name="title"] {
    grid-column: 1 / -1;
  }

  .bulk-row .bulk-remove {
    grid-row: 1;
    grid-column: 3;
  }

  .bulk-row [name="title"] {
    grid-column: 1 / 3;
  }

  .wanted-card {
    flex-wrap: wrap;
  }

  .wanted-actions {
    flex-direction: row;
    width: 100%;
  }

  .nav-badge {
    margin-left: auto;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-inner,
  .detail,
  .profile,
  .checkout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .detail-media,
  .profile-card {
    position: static;
  }

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

  .auth-aside {
    display: none;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    gap: 12px;
  }

  .menu-toggle {
    display: flex;
    order: 3;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .header-actions .btn-primary span,
  .account-name,
  .account-btn > .icon {
    display: none;
  }

  .header-actions .btn-primary:has(.icon) {
    width: 34px;
    padding: 0;
  }

  .account-btn {
    padding: 2px;
  }

  .brand-emblem {
    height: 28px;
  }

  .brand-name {
    font-size: 15px;
  }

  .hero {
    padding: 32px 0 56px;
  }

  .hero-card {
    padding: 24px;
  }

  .logo-tile {
    width: 52px;
    height: 52px;
  }

  .trust-list {
    display: none;
  }

  .toolbar,
  .field-row {
    flex-direction: column;
  }

  .toolbar .select {
    width: 100%;
  }

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

  .card-body {
    padding: 10px 12px 12px;
  }

  .card-price {
    font-size: 16px;
  }

  .card-actions {
    flex-direction: column;
    padding: 0 12px 12px;
  }

  .messages {
    grid-template-columns: 1fr;
    height: calc(100vh - 200px);
  }

  .messages.has-active .conv-list,
  .messages:not(.has-active) .chat {
    display: none;
  }

  .chat-back {
    display: block;
  }

  .bubble {
    max-width: 85%;
  }

  .steps li:not(.current) {
    font-size: 0;
    flex: 0 1 auto;
  }

  .steps li:not(.current)::after {
    display: none;
  }
}

@media (max-width: 359px) {
  .header .brand-name {
    display: none;
  }
}
