:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: #0b0f14;
  --panel-2: #111820;
  --line: #26313d;
  --line-strong: #384655;
  --text: #f6f8fb;
  --muted: #8f9baa;
  --muted-2: #657386;
  --purple: #a970ff;
  --purple-strong: #8b5cf6;
  --violet: #d8c4ff;
  --yellow: #f4bf75;
  --red: #ff7b8a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.12), transparent 340px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.92);
  backdrop-filter: blur(24px);
}

.brand,
.session,
.listing-meta,
.toolbar,
.price-row,
.user-chip,
.modal-actions {
  display: flex;
  align-items: center;
}

.brand {
  width: 100%;
  gap: 12px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  margin-bottom: 30px;
}

.brand-mark,
.avatar,
.listing-art {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, #101820, #172232);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  color: var(--purple);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.lede,
.section-title p,
.card p,
.rail-panel span,
small,
.muted {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item,
.ghost,
.mono,
.chip,
.icon-button {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
}

.nav-item {
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active,
.ghost:hover,
.mono:hover,
.chip:hover,
.chip.active {
  border-color: var(--line);
  background: var(--panel-2);
}

.rail-panel {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mono {
  min-height: 38px;
  padding: 0 10px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(24px);
}

.search {
  position: relative;
  flex: 1;
  max-width: 780px;
}

.search span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 20px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #090d12;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(169, 112, 255, 0.14);
}

#searchInput {
  padding-left: 44px;
}

.session {
  gap: 10px;
  justify-content: flex-end;
}

.view {
  display: none;
  padding: 28px 24px 50px;
}

.view.active {
  display: block;
}

.market-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

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

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

h1 {
  margin-bottom: 10px;
  font-size: 58px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 34px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
}

.lede {
  max-width: 820px;
  font-size: 17px;
  line-height: 1.65;
}

.status-console,
.workbench,
.auth-panel,
.card,
.feed-item,
.admin-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 15, 20, 0.9);
  box-shadow: var(--shadow);
}

.status-console {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #c6d0dc;
}

.status-console div {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070a0e;
}

.status-console span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 16px rgba(169, 112, 255, 0.7);
}

.toolbar {
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.chip {
  min-height: 34px;
  padding: 0 11px;
}

.primary,
.ghost,
.danger {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  font-weight: 750;
}

.primary {
  border: 0;
  color: #ffffff;
  background: var(--purple-strong);
}

.ghost {
  border-color: var(--line);
}

.danger {
  border: 1px solid rgba(255, 123, 138, 0.5);
  color: #ffd4d9;
  background: rgba(255, 123, 138, 0.1);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
}

.card {
  overflow: hidden;
  min-height: 360px;
}

.listing-art {
  height: 126px;
  border-width: 0 0 1px;
  border-radius: 0;
  color: var(--violet);
  font-size: 34px;
  font-weight: 900;
}

.card-body {
  display: grid;
  gap: 11px;
  padding: 16px;
}

.listing-meta {
  gap: 7px;
  flex-wrap: wrap;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  font-weight: 750;
}

.badge.purple,
.badge.verified {
  color: #eadfff;
  border-color: rgba(169, 112, 255, 0.5);
  background: rgba(139, 92, 246, 0.16);
}

.badge.violet {
  color: #e8ddff;
  border-color: rgba(216, 196, 255, 0.35);
  background: rgba(216, 196, 255, 0.08);
}

.price-row {
  gap: 12px;
  justify-content: space-between;
  margin-top: auto;
}

.price-row strong {
  display: block;
  font-size: 22px;
}

.workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.wide {
  grid-column: 1 / -1;
}

.switch {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.switch input {
  width: auto;
}

.section-title {
  margin-bottom: 18px;
}

.account-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 430px));
  gap: 16px;
}

.auth-panel {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.feed,
.admin-grid {
  display: grid;
  gap: 12px;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feed-item,
.admin-tile {
  padding: 16px;
}

.user-chip {
  gap: 9px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080c11;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--purple);
  font-weight: 900;
}

.modal {
  width: min(680px, calc(100vw - 30px));
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #080c11;
  box-shadow: var(--shadow);
}

.modal-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0b1118;
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.seller-link {
  display: inline;
  padding: 0;
  border: 0;
  color: var(--violet);
  background: transparent;
  font-weight: 750;
}

.seller-link:hover {
  color: #ffffff;
}

.profile-panel,
.profile-listings,
.support-panel,
.admin-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 15, 20, 0.9);
}

.profile-panel,
.profile-listings,
.support-panel,
.admin-block {
  padding: 18px;
}

.profile-head,
.title-line,
.support-panel,
.admin-row,
.row-actions {
  display: flex;
  align-items: center;
}

.profile-head,
.title-line,
.row-actions {
  gap: 10px;
}

.profile-head h2,
.profile-head h3,
.title-line h2,
.title-line h3 {
  margin: 0;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.profile-stats div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.profile-stats span,
.admin-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.profile-listings h3,
.admin-block h3 {
  margin-bottom: 14px;
}

.mini-row,
.admin-row {
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.mini-row {
  display: flex;
}

.support-panel {
  max-width: 780px;
  gap: 16px;
}

.support-panel > div {
  flex: 1;
}

.support-panel h3,
.support-panel p {
  margin-bottom: 4px;
}

.support-avatar {
  width: 42px;
  height: 42px;
}

.admin-sections {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.status-select {
  width: 150px;
  padding: 7px 9px;
  font-size: 13px;
}

.ban-notice {
  padding: 12px;
  border: 1px solid rgba(255, 123, 138, 0.45);
  border-radius: 7px;
  color: #ffd4d9;
  background: rgba(255, 123, 138, 0.08);
}

.ban-notice p {
  margin: 5px 0 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

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

.profile-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  text-align: left;
}

.profile-card:hover {
  border-color: var(--purple);
  background: var(--panel-2);
}

.profile-card strong,
.profile-card small {
  display: block;
}

.profile-card .verified {
  display: inline-grid;
  margin-left: 7px;
}

.badge.trusted {
  color: #f2eaff;
  border-color: rgba(216, 196, 255, 0.55);
  background: rgba(169, 112, 255, 0.18);
}

.badge.normal {
  color: #d9dce3;
  border-color: #4c5562;
  background: rgba(143, 155, 170, 0.1);
}

.badge.risk {
  color: #ffd7dc;
  border-color: rgba(255, 123, 138, 0.46);
  background: rgba(255, 123, 138, 0.1);
}

.badge.hot {
  color: #ffe3bd;
  border-color: rgba(244, 191, 117, 0.45);
  background: rgba(244, 191, 117, 0.09);
}

.badge.escrow {
  color: #e8ddff;
  border-color: rgba(169, 112, 255, 0.55);
  background: rgba(139, 92, 246, 0.13);
}

.deal-option {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.deal-option p {
  margin: 5px 0;
  color: var(--muted);
}

.warning-box {
  border-color: rgba(255, 123, 138, 0.42);
  background: rgba(255, 123, 138, 0.06);
}

.escrow-box {
  border-color: rgba(169, 112, 255, 0.48);
  background: rgba(139, 92, 246, 0.08);
}

.reputation-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reputation-strip span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.terms-panel {
  max-width: 880px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.terms-panel h3 {
  margin: 22px 0 7px;
  font-size: 17px;
}

.terms-panel h3:first-child {
  margin-top: 0;
}

.terms-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.terms-panel a {
  color: var(--violet);
}

.terms-accept {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(169, 112, 255, 0.45);
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.08);
}

.terms-accept p {
  margin: 0;
}

@media (max-width: 920px) {
  .app {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
  }

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

  .rail-panel {
    position: static;
    margin-top: 16px;
  }

  .topbar,
  .market-head,
  .toolbar,
  .account-layout,
  .workbench {
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar {
    display: grid;
  }

  h1 {
    font-size: 42px;
  }

  .support-panel,
  .admin-row,
  .deal-option,
  .terms-accept {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }
}
