:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #475467;
  --paper: #fff;
  --soft: #f2f4f7;
  --line: #98a2b3;
  --brand: #0b4f6c;
  --brand-dark: #06364a;
  --accent: #ffd43b;
  --danger: #b42318;
  --success: #067647;
  --focus: #f79009;
  --shadow-surface: 0 0 0 1px oklch(0 0 0 / 0.08), 0 1px 2px -1px oklch(0 0 0 / 0.08), 0 8px 20px oklch(0 0 0 / 0.06);
  --shadow-surface-hover: 0 0 0 1px oklch(0 0 0 / 0.11), 0 2px 4px -1px oklch(0 0 0 / 0.1), 0 12px 28px oklch(0 0 0 / 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f8fafc;
  font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li,
dd,
figcaption {
  text-wrap: pretty;
}

a {
  color: #075985;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 3px;
}

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

button,
a,
input,
select,
textarea {
  border-radius: 0.5rem;
}

button,
.primary,
.site-nav-list a {
  min-height: 44px;
}

button,
.primary {
  transition-property: scale, background-color, color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

button:active:not(:disabled),
.primary:active {
  scale: 0.96;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  background: #fff;
  color: #000;
  padding: 0.75rem 1rem;
  font-weight: 800;
  box-shadow: var(--shadow-surface);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem max(1rem, calc((100vw - 1200px) / 2));
  color: #fff;
  background: color-mix(in srgb, var(--brand-dark) 96%, transparent);
  box-shadow: 0 2px 12px oklch(0 0 0 / 0.22);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.site-header nav {
  min-width: 0;
}

.site-nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav-list a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  transition-property: background-color, color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.site-nav-list a:hover {
  background: oklch(1 0 0 / 0.11);
  text-decoration: none;
}

.site-nav-list a[aria-current="page"] {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.16);
}

.hero,
.page-shell {
  max-width: 1200px;
  margin: auto;
  padding: 3rem 1rem;
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, #e0f2fe, #fff 72%);
  border-radius: 0 0 1.5rem 1.5rem;
}

.hero::after {
  content: "";
  position: absolute;
  right: -6rem;
  bottom: -9rem;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: oklch(0.86 0.12 207 / 0.24);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
  max-width: 66ch;
}

.hero h1,
.page-shell h1,
.item-detail h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.card-body h2,
.item-detail h1,
.site-nav-list a {
  overflow-wrap: anywhere;
}

.eyebrow {
  color: #075985;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: auto;
  padding: 1.25rem 1rem 4rem;
}

.auction-card,
.panel,
.item-detail {
  overflow: hidden;
  background: #fff;
  border-radius: 0.875rem;
  box-shadow: var(--shadow-surface);
}

.auction-card {
  transition-property: transform, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.auction-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-surface-hover);
}

.auction-card.is-favorite {
  box-shadow: 0 0 0 3px #9a6b00, var(--shadow-surface-hover);
}

.card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e4e7ec;
}

.card-image > img,
.gallery-main {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #eef2f6;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.card-body {
  padding: 1.25rem;
}

.card-body h2 {
  margin: 0.15rem 0;
}

.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 15rem;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #eaecf0, #eaecf0 10px, #f9fafb 10px, #f9fafb 20px);
  font-weight: 700;
}

.favorite-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: #533d00;
  background: #fff7cc;
  border: 2px solid #7a5900;
  font-weight: 800;
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.12);
}

.favorite-button[aria-pressed="true"] {
  background: var(--accent);
}

.compact-facts,
.details-grid dl,
.panel dl {
  margin: 1rem 0;
}

.compact-facts div,
.details-grid dl div {
  margin-bottom: 0.6rem;
}

dt {
  font-weight: 800;
}

dd {
  margin: 0;
  color: var(--muted);
}

.compact-facts dd,
.price strong,
.countdown strong,
.activity-list span,
td {
  font-variant-numeric: tabular-nums;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--brand);
  border: 2px solid var(--brand-dark);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.14);
}

.primary:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

.site-footer {
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid #d0d5dd;
  background: #fff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.narrow {
  max-width: 860px;
}

.panel {
  margin-bottom: 1.25rem;
  padding: 1.5rem;
}

.item-detail {
  overflow: visible;
  padding: clamp(1rem, 3vw, 2rem);
}

dialog .item-detail {
  border-radius: inherit;
  box-shadow: none;
}

.item-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
}

.gallery-main {
  aspect-ratio: 4 / 3;
  border-radius: 0.625rem;
}

.thumbnails {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.7rem 0.2rem;
}

.thumbnail {
  flex: 0 0 5rem;
  height: 5rem;
  min-height: 44px;
  padding: 0.2rem;
  background: #fff;
  border: 2px solid #667085;
}

.thumbnail.selected {
  border-color: #075985;
  box-shadow: 0 0 0 2px #075985;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.bid-panel {
  align-self: start;
  padding: 1.25rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 1px oklch(0 0 0 / 0.12), 0 4px 12px oklch(0 0 0 / 0.06);
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  color: #054f31;
  background: #d1fadf;
  border-radius: 999px;
  font-weight: 800;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #d0d5dd;
}

.price strong {
  font-size: 1.6rem;
}

.countdown {
  padding: 0.8rem;
  background: #fff3cd;
  border: 2px solid #8a6116;
  border-radius: 0.5rem;
}

.countdown strong {
  display: block;
  font-size: 1.7rem;
}

.extension-notice {
  color: var(--muted);
  font-size: 0.9rem;
}

label,
legend {
  display: block;
  margin: 0.7rem 0 0.3rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid #667085;
}

.money-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 2px solid #667085;
  border-radius: 0.5rem;
}

.money-input:focus-within {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.money-input span {
  padding-left: 0.7rem;
  font-weight: 800;
}

.money-input input {
  width: 100%;
  padding: 0.7rem;
  border: 0;
  border-radius: 0;
  outline: 0;
}

.field-help,
.form-status {
  font-size: 0.9rem;
}

.form-status.error,
.outbid {
  color: var(--danger);
  font-weight: 800;
}

.form-status.success,
.bid-state {
  color: var(--success);
  font-weight: 800;
}

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

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.details-grid > div {
  padding: 1rem;
  background: #f9fafb;
  border-top: 4px solid var(--brand);
  border-radius: 0 0 0.625rem 0.625rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.45rem 0;
  font-weight: 600;
}

.check input {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  min-height: 1.25rem;
  height: 1.25rem;
  margin-top: 0.12rem;
}

.activity-list {
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #d0d5dd;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
  background: #fff;
  border: 2px dashed #667085;
  border-radius: 0.875rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.65rem;
  text-align: left;
  border: 1px solid #98a2b3;
}

th {
  background: #e4e7ec;
}

dialog {
  width: min(1100px, calc(100% - 2rem));
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0.875rem;
  box-shadow: 0 24px 60px oklch(0 0 0 / 0.28);
}

dialog::backdrop {
  background: #101828c9;
}

.dialog-close {
  position: sticky;
  top: 0.6rem;
  z-index: 5;
  float: right;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  margin: 0.6rem;
  padding: 0;
  color: #101828;
  background: #fff;
  border: 3px solid currentColor;
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.18);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media(max-width:760px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.55rem;
  }

  .brand {
    align-self: flex-start;
  }

  .site-nav-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .site-nav-list a {
    justify-content: center;
    padding-inline: 0.4rem;
    text-align: center;
  }

  .hero,
  .page-shell {
    padding: 2rem 1rem;
  }

  .hero {
    border-radius: 0;
  }

  .item-layout,
  .details-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .activity-list li {
    flex-direction: column;
  }

  .bid-panel {
    position: static;
  }

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

  dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  button:active:not(:disabled),
  .primary:active {
    scale: 1;
  }
}
