@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600&family=Playfair+Display:wght@400;500;600&display=swap");

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --bg: #0f0f10;
  --bg-soft: #141417;
  --surface: #1b1b21;
  --surface-2: #21212a;
  --text: #f4f1ec;
  --muted: #b2aca4;
  --accent: #d2b47c;
  --accent-2: #7f6a43;
  --stroke: rgba(244, 241, 236, 0.12);
  --glass: rgba(27, 27, 33, 0.7);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --font-xs: 11px;
  --font-sm: 13px;
  --font-md: 15px;
  --font-lg: 18px;
  --focus: rgba(210, 180, 124, 0.5);
}

body[data-theme="light"] {
  --bg: #f7f2ea;
  --bg-soft: #fcf8f2;
  --surface: #ffffff;
  --surface-2: #f2ebe0;
  --text: #141414;
  --muted: #6c645b;
  --accent: #c79a5b;
  --accent-2: #0f7a6b;
  --stroke: rgba(20, 20, 20, 0.12);
  --glass: rgba(255, 255, 255, 0.85);
  --shadow: 0 24px 60px rgba(24, 16, 6, 0.12);
  --focus: rgba(199, 154, 91, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1c1c1f 0%, #0b0b0c 45%, #070708 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  font-size: var(--font-md);
}

body[data-theme="light"] {
  background: radial-gradient(circle at top, #fff6e8 0%, #f7efe1 40%, #f3eadb 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
button {
  font-family: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.18;
  pointer-events: none;
}

.orb--gold {
  background: radial-gradient(circle, rgba(210, 180, 124, 0.55), transparent 70%);
  top: -140px;
  left: -120px;
}

body[data-theme="light"] .orb--gold {
  background: radial-gradient(circle, rgba(255, 210, 170, 0.6), transparent 70%);
}

.orb--graphite {
  background: radial-gradient(circle, rgba(100, 100, 120, 0.35), transparent 70%);
  bottom: -220px;
  right: -160px;
}

body[data-theme="light"] .orb--graphite {
  background: radial-gradient(circle, rgba(170, 230, 220, 0.6), transparent 70%);
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.45;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

body[data-theme="light"] .grain {
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--space-6) 7vw;
}

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

.brand__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.brand__mark-img {
  width: 40px;
  height: 40px;
  display: block;
}

.brand__name {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar__nav {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.nav__link {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s ease;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link--disabled {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

.nav__link--account {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  cursor: pointer;
}

.nav__link--account.is-authenticated {
  width: 38px;
  height: 38px;
  padding: 0;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #16130f;
  background: linear-gradient(120deg, #dfc18c, #c79756);
  border: none;
}

.topbar__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  align-items: center;
  margin-right: clamp(72px, 6vw, 120px);
  position: relative;
}

.admin-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav__link--admin {
  border: 1px dashed rgba(210, 180, 124, 0.45);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(12, 14, 22, 0.45);
}

.nav__link--admin.is-active {
  border-style: solid;
  border-color: rgba(210, 180, 124, 0.75);
  color: var(--accent);
  background: rgba(210, 180, 124, 0.12);
}

.admin-inline__key {
  min-width: 76px;
}

.btn--compact {
  padding: 3px 6px;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-switch--floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 5;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.theme-switch__track {
  width: 58px;
  height: 16px;
  background: rgba(244, 241, 236, 0.12);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.theme-switch__thumb {
  width: 10px;
  height: 10px;
  background: #f5f0ea;
  border-radius: 50%;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  transform: translateX(0);
  transition: transform 0.3s ease, background 0.3s ease;
  position: relative;
  color: #c79a5b;
}

.theme-switch__label {
  position: absolute;
  font-size: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.7);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theme-switch__label--light {
  left: 7px;
  opacity: 0;
}

.theme-switch__label--dark {
  right: 7px;
  opacity: 1;
}

.theme-switch__icon {
  width: 7px;
  height: 7px;
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-switch__icon--sun {
  opacity: 0;
  color: #c79a5b;
}

.theme-switch__icon--moon {
  opacity: 1;
  color: #0f1117;
}

.theme-switch input:checked + .theme-switch__track {
  background: rgba(244, 241, 236, 0.28);
  border-color: rgba(244, 241, 236, 0.35);
}

.theme-switch input:checked + .theme-switch__track .theme-switch__thumb {
  transform: translateX(44px);
  background: #f5f0ea;
}

.theme-switch input:checked + .theme-switch__track .theme-switch__icon--sun {
  opacity: 1;
}

.theme-switch input:checked + .theme-switch__track .theme-switch__icon--moon {
  opacity: 0;
}

.theme-switch input:checked + .theme-switch__track .theme-switch__label--light {
  opacity: 1;
}

.theme-switch input:checked + .theme-switch__track .theme-switch__label--dark {
  opacity: 0;
}

body[data-theme="light"] .theme-switch__track {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(20, 20, 20, 0.35);
  box-shadow: 0 8px 16px rgba(24, 16, 6, 0.12);
}

body[data-theme="light"] .theme-switch__thumb {
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(24, 16, 6, 0.25);
  color: #c79a5b;
}

body[data-theme="light"] .theme-switch__label {
  color: rgba(20, 20, 20, 0.65);
}

.btn {
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn--solid {
  background: linear-gradient(120deg, #c7a86e, #9c7a43);
  border: none;
  color: #191512;
  box-shadow: 0 12px 30px rgba(210, 180, 124, 0.25);
}

body[data-theme="light"] .btn--solid {
  background: linear-gradient(120deg, #d9ad6b, #c88a52);
  color: #1b1207;
  box-shadow: 0 12px 30px rgba(199, 154, 91, 0.25);
}

.btn--ghost:hover {
  border-color: rgba(244, 241, 236, 0.4);
}

.btn--solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(210, 180, 124, 0.3);
}

.btn--wide {
  width: 100%;
  justify-content: center;
}

.btn:focus-visible,
.chip:focus-visible,
.select-trigger:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn--small {
  font-size: 11px;
  padding: 6px 12px;
}

.shell {
  position: relative;
  z-index: 1;
  padding: var(--space-2) 7vw 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.65fr);
  gap: var(--space-8);
  align-items: stretch;
  margin-top: var(--space-8);
}

.hero__copy {
  padding-right: var(--space-8);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: var(--font-xs);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  color: var(--text);
}

h1 {
  font-size: clamp(36px, 4vw, 62px);
  line-height: 1.05;
  margin-bottom: 18px;
}

.lead {
  font-size: var(--font-lg);
  color: var(--muted);
  max-width: 560px;
  margin-bottom: var(--space-6);
}

.hero__search {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-pill {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-pill__label {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.search-pill input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: var(--font-md);
}

.btn--search {
  padding: 12px 22px;
}

.hero__meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.hero__panel {
  display: flex;
  justify-content: flex-end;
}

.panel-card {
  background: rgba(27, 27, 33, 0.85);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  min-width: 280px;
}

body[data-theme="light"] .panel-card {
  background: rgba(255, 255, 255, 0.9);
}

.panel-card p {
  color: var(--muted);
}

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

.panel-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.delta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.delta--up {
  color: #c8dcb4;
}

.delta--down {
  color: #d9b4b4;
}

.marketplace {
  margin-top: 70px;
  display: grid;
  gap: 28px;
}

.insights {
  margin-top: var(--space-9);
  display: grid;
  gap: 18px;
}

.insights__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.insights__header p {
  color: var(--muted);
}

.insights__controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 220px)) auto;
  gap: 10px;
  align-items: end;
}

.insights__control {
  display: grid;
  gap: 6px;
}

.insights__control span {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: var(--font-xs);
  color: var(--muted);
}

.insights__control select {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-3);
  color: var(--text);
}

.insights__summary {
  color: var(--muted);
  font-size: 14px;
}

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

.insight-card {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: grid;
  gap: 8px;
}

.insight-card__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-2);
}

.insight-card h4 {
  font-size: 18px;
  line-height: 1.25;
}

.insight-card__score {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(210, 180, 124, 0.45);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

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

.insight-card__price {
  font-size: 18px;
  font-weight: 600;
}

.insight-card__link {
  justify-self: start;
}

.marketplace__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.marketplace__header p {
  color: var(--muted);
  max-width: 520px;
}

.marketplace__tools {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.marketplace__grid {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.filters {
  background: rgba(24, 24, 28, 0.9);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: grid;
  gap: 20px;
  height: fit-content;
}

body[data-theme="light"] .filters {
  background: rgba(255, 255, 255, 0.9);
}

.filters__section {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters__block {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

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

.filters__flow {
  display: grid;
  gap: var(--space-2);
}

.filters__flow .flow-select {
  display: grid;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.filters__flow select {
  text-transform: none;
  letter-spacing: 0.04em;
}

.filters__block.is-empty .filters__flow {
  display: none;
}

.filters__label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: var(--font-xs);
  color: var(--muted);
}

.filters input[type="text"],
.filters select {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  min-height: 36px;
  height: 36px;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.select-shell {
  position: relative;
}

.select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}

.select-trigger {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  min-height: 36px;
  height: 36px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  max-width: 100%;
}

.select-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid var(--muted);
  border-left: none;
  border-top: none;
  transform: rotate(45deg);
  margin-left: auto;
  opacity: 0.7;
}

.select-trigger.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.select-panel {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 8px;
  display: none;
  z-index: 10;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.select-panel.is-open {
  display: grid;
  gap: 6px;
}

.select-option {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.select-option__media {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
}

.select-option__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.select-option__thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.select-option__content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.select-option:hover,
.select-option.is-active {
  background: rgba(210, 180, 124, 0.12);
  border-color: rgba(210, 180, 124, 0.35);
}

.select-option__ref {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-option__desc {
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.3;
}

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


.chip {
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px var(--space-3);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.chip--ghost {
  color: var(--muted);
  border-style: dashed;
}

.chip--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chip--active {
  border-color: rgba(210, 180, 124, 0.7);
  color: var(--text);
}

.range input {
  width: 100%;
}

.range__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-xs);
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox input {
  accent-color: var(--accent);
  margin-right: 8px;
}

.results {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.results__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.results__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.badge {
  border: 1px solid rgba(210, 180, 124, 0.5);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.results__sort {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.results__sort select {
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  align-items: flex-start;
}

.active-filters:empty {
  display: none;
}

.active-filters .chip {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 12px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  height: auto;
  background: rgba(20, 20, 23, 0.6);
  border-color: rgba(210, 180, 124, 0.45);
  color: var(--text);
}

body[data-theme="light"] .active-filters .chip {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(199, 154, 91, 0.45);
}

.filters__advanced {
  border-top: 1px solid var(--stroke);
  padding-top: 12px;
  color: var(--muted);
  display: grid;
  gap: 12px;
}

.filters__advanced summary {
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--text);
}

.filters__hint {
  font-size: var(--font-xs);
  color: var(--muted);
}

.filters__label--small {
  font-size: 10px;
  letter-spacing: 0.16em;
  margin-top: 10px;
}

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

.guided__variants {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.guided-variant {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 6px;
  color: var(--text);
  cursor: pointer;
}

.guided-variant:hover {
  border-color: rgba(210, 180, 124, 0.5);
}

.guided-variant.is-active {
  border-color: rgba(210, 180, 124, 0.9);
  box-shadow: 0 0 0 1px rgba(210, 180, 124, 0.35) inset;
}

.guided-variant.is-low-confidence {
  border-style: dashed;
}

.guided-variant img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.guided-variant__fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: var(--font-xs);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.guided-variant__label {
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guided-variant__desc {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guided-variant__text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.guided-variant__count {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.guided-variant__quality {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.85;
}

.guided__meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  align-content: start;
  justify-content: start;
}

.results__footer {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 260px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  content-visibility: auto;
  contain-intrinsic-size: 260px 360px;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 241, 236, 0.25);
}

.card__media {
  background: linear-gradient(120deg, rgba(210, 180, 124, 0.18), rgba(255, 255, 255, 0));
  padding: var(--space-3);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

body[data-theme="light"] .card__media {
  background: linear-gradient(120deg, rgba(255, 226, 190, 0.5), rgba(255, 255, 255, 0));
}

.card__media img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(26, 26, 26, 0.85);
  padding: 4px 8px;
  border-radius: 4px;
}

.card__img-fallback {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
}

.card__body {
  padding: var(--space-4);
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
}

.score {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.card__meta {
  display: flex;
  justify-content: space-between;
  color: var(--text);
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card--cta {
  align-items: center;
  text-align: left;
  padding: 22px;
  gap: 16px;
}

.empty {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--stroke);
  padding: 30px 7vw 50px;
  display: grid;
  gap: var(--space-4);
  font-size: var(--font-sm);
  color: var(--muted);
}

.footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 15;
}

.account-menu[hidden] {
  display: none !important;
}

.account-menu__item {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}

.account-menu__item:hover {
  border-color: rgba(210, 180, 124, 0.45);
  background: rgba(210, 180, 124, 0.08);
}

.account-menu__item--danger {
  color: #e3b8b8;
}

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

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

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

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.64);
  backdrop-filter: blur(3px);
}

.admin-modal__panel {
  position: relative;
  width: min(540px, 92vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.admin-modal__panel--wide {
  width: min(620px, 92vw);
}

.admin-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal__close {
  border: 1px solid var(--stroke);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.admin-modal__listing {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
}

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

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

.admin-modal__link {
  display: inline-flex;
}

.admin-modal .auth-form select,
.admin-modal .auth-form textarea {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.64);
  backdrop-filter: blur(3px);
}

.auth-modal__panel {
  position: relative;
  width: min(560px, 92vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 14px;
}

.auth-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-modal__close {
  border: 1px solid var(--stroke);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

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

.auth-tab {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-tab.is-active {
  color: var(--text);
  border-color: rgba(210, 180, 124, 0.5);
  background: rgba(210, 180, 124, 0.08);
}

.auth-panel-wrap {
  display: grid;
  gap: 12px;
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.auth-form input {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 12px;
}

.auth-form__hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form--danger {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.btn--danger-outline {
  border-color: rgba(220, 145, 145, 0.45);
  color: #e5b8b8;
}

.btn--danger-outline:hover {
  border-color: rgba(220, 145, 145, 0.7);
  background: rgba(160, 64, 64, 0.14);
}

.auth-profile {
  display: grid;
  gap: 10px;
}

.auth-profile__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
}

.auth-profile__line span {
  color: var(--muted);
}

.auth-status--verified {
  color: #b7d8b2;
}

.auth-status--unverified {
  color: #e5c694;
}

.auth-security {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
}

.auth-security__label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-security__event {
  margin: 6px 0 0;
  font-size: 14px;
}

.auth-session-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.auth-session-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--muted);
}

.auth-feedback {
  min-height: 20px;
  font-size: 12px;
  color: var(--muted);
}

.auth-feedback.is-error {
  color: #e7b2b2;
}

.auth-feedback.is-success {
  color: #b7d8b2;
}

.site-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: min(420px, 88vw);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.site-toast[hidden] {
  display: none !important;
}

.site-toast.is-success {
  color: #b7d8b2;
}

.site-toast.is-error {
  color: #e7b2b2;
}

.page-content {
  margin-top: var(--space-6);
}

.collections-layout {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
}

.collections-sidebar {
  position: sticky;
  top: 110px;
}

.collections-list {
  display: grid;
  gap: 10px;
}

.collections-auth {
  display: grid;
  gap: 12px;
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  padding: 14px;
}

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

.collection-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.collection-list-item strong {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.collection-list-item span {
  font-size: 12px;
  color: var(--muted);
}

.collection-list-item.is-active {
  border-color: rgba(210, 180, 124, 0.7);
  box-shadow: inset 0 0 0 1px rgba(210, 180, 124, 0.22);
}

.collections-detail {
  display: grid;
  gap: 16px;
}

.collections-detail__bar {
  margin-bottom: 0;
}

.collections-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.collections-summary-grid .about-block {
  padding: 14px;
}

.collections-summary-grid h4 {
  margin: 0 0 6px;
}

.collections-summary-grid p {
  margin: 0;
  color: var(--text);
}

.about-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.about-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--panel);
}

.about-block p {
  color: var(--muted);
  margin-bottom: 0;
}

.auth-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.auth-wrap--sm {
  max-width: 520px;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
}

.auth-card h2 {
  margin: 0;
}

.auth-card .stack {
  gap: var(--space-3);
}

.auth-card input {
  width: 100%;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-size: var(--text-xs);
}

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

.collections-grid .card__body p {
  color: var(--muted);
  margin: 0;
}

.insights-modules {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight-module {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  min-height: 280px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.insight-module__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.insight-module__head h3 {
  margin: 0;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-module__head span {
  color: var(--muted);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.insight-module__body {
  padding: var(--space-4) var(--space-5);
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.insight-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: color-mix(in srgb, var(--panel) 70%, var(--bg));
}

.insight-row__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.insight-row p {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.insight-note {
  margin: 8px 0 0;
  font-size: var(--text-2xs);
  color: var(--muted);
}

.insight-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--text-2xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.insight-pill--up {
  color: #4dd196;
  background: color-mix(in srgb, #4dd196 20%, transparent);
}

.insight-pill--down {
  color: #f58c8c;
  background: color-mix(in srgb, #f58c8c 20%, transparent);
}

.insight-empty,
.insight-loading {
  color: var(--muted);
  font-size: var(--text-sm);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .topbar__nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-7);
  }

  .hero__copy {
    padding-right: 0;
  }

  .hero__panel {
    justify-content: flex-start;
  }

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

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

  .collections-sidebar {
    position: static;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .filters__advanced,
  .filters__section {
    grid-column: 1 / -1;
  }

  .insights__header {
    flex-direction: column;
    align-items: start;
  }

  .insights__controls {
    width: 100%;
    grid-template-columns: 1fr 1.4fr auto;
  }

  .insights-modules {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 1fr auto;
    align-items: start;
    padding: var(--space-5) 6vw;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand__name {
    font-size: 16px;
    letter-spacing: 0.05em;
  }

  .topbar__actions {
    display: flex;
    margin-right: 0;
    gap: var(--space-1);
    justify-self: end;
    max-width: 44vw;
  }

  .nav__link--account {
    padding: 6px 10px;
    font-size: 11px;
  }

  .theme-switch--floating {
    top: 14px;
    right: 10px;
    transform: scale(0.92);
    transform-origin: top right;
  }

  .admin-inline {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

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

  .admin-modal__panel,
  .admin-modal__panel--wide {
    width: min(96vw, 620px);
    padding: 16px;
  }

  .account-menu {
    right: 0;
  }

  .auth-modal__panel {
    width: min(96vw, 520px);
    padding: 16px;
  }

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

  .search-pill {
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px;
  }

  .hero__meta {
    flex-direction: column;
    gap: 6px;
  }

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

  .auth-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: var(--space-4);
  }

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

  .results__bar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .card {
    min-height: 0;
  }

  .card__media img,
  .card__img-fallback {
    height: 180px;
  }
}

@media (max-width: 430px) {
  .brand__name {
    display: none;
  }

  .shell {
    padding-left: 5vw;
    padding-right: 5vw;
  }
}
