:root {
  color-scheme: dark;
  --black: #050505;
  --ink: #f7f7f4;
  --muted: #a7a7a0;
  --paper: #050505;
  --panel: #0e0e0e;
  --field: #f7f7f4;
  --field-ink: #0a0a0a;
  --soft: #151515;
  --line: #2b2b2b;
  --yellow: #ffd21f;
  --yellow-dark: #ffcf12;
  --danger: #ff8b7f;
  --success: #79d99c;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--black);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  color: var(--ink);
  background: var(--black);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 80px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
  object-position: left center;
}

.nav-links {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 850;
}

.nav-links a,
.nav-button {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-button:hover,
.nav-button:focus-visible {
  color: var(--yellow);
}

.nav-pill {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--yellow);
  border-radius: 8px;
  background: var(--yellow);
  color: var(--black) !important;
}

.nav-pill.secondary {
  border-color: var(--field);
  background: var(--field);
  color: var(--black) !important;
}

.nav-form {
  margin: 0;
}

.nav-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.blank-stage {
  min-height: calc(100vh - 72px);
  background: var(--black);
}

.auth-wrap,
.dashboard-wrap {
  min-height: calc(100vh - 72px);
  padding: 28px 18px 44px;
}

.auth-wrap {
  display: grid;
  place-items: start center;
  background: var(--black);
}

.auth-panel,
.panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.auth-panel {
  max-width: 470px;
  padding: clamp(24px, 4vw, 38px);
}

.auth-panel.wide {
  max-width: 980px;
}

.page-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--yellow-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  font-size: 3.25rem;
}

h2 {
  font-size: 1.5rem;
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-grid.three {
  grid-template-columns: 1fr;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 46px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #bdbdb6;
  border-radius: 8px;
  background: var(--field);
  color: var(--field-ink);
  outline: none;
}

textarea {
  width: 100%;
  min-height: 116px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #bdbdb6;
  border-radius: 8px;
  background: var(--field);
  color: var(--field-ink);
  outline: none;
  resize: vertical;
}

input[type="file"] {
  padding: 10px;
  color: var(--field-ink);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--yellow);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 210, 31, 0.48);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--yellow);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 950;
  text-decoration: none;
}

.button.primary {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--black);
}

.button.secondary {
  background: var(--yellow);
  color: var(--black);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

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

.form-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 22px;
  color: var(--yellow);
  font-weight: 800;
}

.form-links a:hover,
.form-links a:focus-visible {
  color: var(--ink);
}

.notice {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 6px;
}

.notice.error {
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--danger);
}

.notice.success {
  border-color: rgba(21, 127, 59, 0.28);
  color: var(--success);
}

.reset-notice {
  max-width: 900px;
  margin-bottom: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
}

.panel .stack-form {
  margin-top: 18px;
}

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

.metric {
  margin: 18px 0 0;
  font-size: 3.5rem;
  line-height: 0.9;
  font-weight: 950;
}

.blank-panel {
  min-height: 220px;
}

.admin-topbar {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-topbar .page-heading {
  margin-bottom: 0;
}

.admin-add-button {
  width: 100%;
}

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

.form-actions,
.product-actions {
  display: grid;
  gap: 10px;
}

.product-actions {
  margin-top: 14px;
  justify-items: start;
}

.product-action-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.compact-button {
  min-height: 40px;
  padding: 9px 13px;
}

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

.product-list-panel {
  margin-top: 18px;
}

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

.product-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--black);
}

.product-thumb {
  position: relative;
  display: grid;
  width: 82px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.product-thumb span:not(:only-child) {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--ink);
  font-size: 0.68rem;
}

.product-main {
  min-width: 0;
}

.product-title-row,
.product-meta,
.product-location {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.product-title-row {
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 950;
}

.product-title-row span,
.product-meta span,
.product-location span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.product-main h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.25;
}

.product-meta,
.product-location {
  margin-top: 8px;
}

.product-notes {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-description {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-products {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 30px 0;
  color: var(--muted);
}

.product-form-panel {
  max-width: 980px;
}

.option-grid {
  display: grid;
  gap: 12px;
}

.check-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.check-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.auction-grid {
  display: grid;
  gap: 16px;
}

.auction-card-public {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.auction-card-public:hover,
.auction-card-public:focus-visible {
  border-color: var(--yellow);
}

.auction-media,
.auction-hero-image {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  background: #1f1f1f;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.auction-media {
  aspect-ratio: 4 / 3;
}

.auction-media img,
.auction-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ghost-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 8px;
  border: 1px solid var(--yellow);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.86);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

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

.auction-card-top,
.auction-price-row,
.auction-meta-row,
.auction-status-row,
.auction-stat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.auction-card-top,
.auction-status-row {
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.auction-card-body h2 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.auction-price-row {
  justify-content: flex-start;
}

.auction-price-row span,
.bid-price span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auction-price-row strong,
.bid-price strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.auction-meta-row,
.auction-stat-list {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.auction-meta-row span,
.auction-stat-list span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.auction-detail-grid {
  display: grid;
  gap: 18px;
}

.auction-image-panel,
.bid-panel {
  min-width: 0;
}

.auction-hero-image {
  min-height: 280px;
  border-radius: 8px;
}

.bid-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.bid-price {
  display: grid;
  gap: 6px;
}

.bid-price strong {
  font-size: clamp(3rem, 15vw, 5rem);
}

.ghost-note {
  margin: 0;
  color: var(--yellow);
  font-weight: 850;
}

.full-button {
  width: 100%;
}

.empty-auctions {
  display: grid;
  align-content: center;
}

.image-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo-tile {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f1f1f;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.photo-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-tile img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile.has-photo img {
  display: block;
}

.photo-number,
.photo-action {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
}

.photo-number {
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.photo-action {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--field);
  color: var(--black);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.05;
}

.photo-tile.has-photo .photo-number {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
}

.photo-tile.has-photo .photo-action {
  position: absolute;
  right: 6px;
  bottom: 6px;
}

@media (min-width: 380px) {
  .brand-logo {
    width: 92px;
  }

  .nav-links {
    gap: 10px;
    font-size: 0.84rem;
  }

  .nav-pill {
    padding-inline: 12px;
  }
}

@media (min-width: 760px) {
  .site-header {
    min-height: 82px;
    gap: 24px;
    padding: 14px clamp(24px, 4vw, 56px);
  }

  .brand-logo {
    width: 180px;
    max-height: 54px;
  }

  .nav-links {
    gap: clamp(12px, 2vw, 22px);
    font-size: 0.92rem;
  }

  .blank-stage,
  .auth-wrap,
  .dashboard-wrap {
    min-height: calc(100vh - 82px);
  }

  .auth-wrap,
  .dashboard-wrap {
    padding: 56px clamp(28px, 5vw, 64px);
  }

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

  .form-grid.three {
    grid-template-columns: minmax(0, 1.4fr) minmax(76px, 0.35fr) minmax(0, 1.1fr);
  }

  .admin-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .admin-actions {
    grid-auto-flow: column;
    justify-content: end;
  }

  .form-actions {
    grid-auto-flow: column;
    justify-content: start;
  }

  .admin-add-button {
    width: auto;
  }

  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .product-card {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 14px;
  }

  .product-thumb {
    width: 96px;
  }

  .product-main h3 {
    font-size: 1.08rem;
  }

  h1 {
    font-size: 5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .metric {
    font-size: 5rem;
  }
}

@media (min-width: 960px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  }

  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .auction-detail-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  }

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