@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #0c0a0b;
  --bg-raised: #131012;
  --bg-sunken: #080607;
  --surface: #1c1719;
  --surface-hover: #241e20;
  --line: rgba(255, 232, 232, 0.08);
  --line-strong: rgba(255, 232, 232, 0.15);

  --text: #f6f0ef;
  --text-soft: #cdc3c2;
  --muted: #978b8c;
  --faint: #635859;

  --accent: #d92d3a;
  --accent-hover: #e8414e;
  --accent-ink: #ffffff;
  --accent-text: #f45d65;
  --accent-soft: rgba(230, 60, 72, 0.14);
  --accent-line: rgba(244, 93, 101, 0.45);
  --accent-glow: rgba(217, 45, 58, 0.3);

  --positive: #72d4a3;
  --positive-soft: rgba(114, 212, 163, 0.12);
  --warning: #f2b45a;
  --warning-soft: rgba(242, 180, 90, 0.12);
  --danger: #f0806f;
  --danger-soft: rgba(240, 128, 111, 0.12);

  --radius-lg: 22px;
  --radius: 14px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --header-h: 72px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -220px, var(--accent-glow), transparent 72%),
    radial-gradient(800px 500px at 100% 420px, rgba(140, 22, 36, 0.16), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

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

::selection {
  background: rgba(230, 60, 72, 0.35);
}

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

.container {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, transform 0.05s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--outline {
  border-color: var(--line-strong);
}

.btn--outline:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--surface-hover);
}

.btn--accent-outline {
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.btn--accent-outline:hover:not(:disabled) {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

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

.btn--danger {
  border-color: rgba(240, 128, 111, 0.4);
  color: var(--danger);
}

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

.btn--lg {
  height: 52px;
  font-size: 15px;
}

.btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}

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

.round-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.55);
  color: var(--text);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.2s;
}

.round-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(24, 24, 27, 0.85);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 12, 0.74);
  backdrop-filter: saturate(140%) blur(16px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 100%;
}

.brand {
  font: 400 22px/1 var(--font-serif);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand--small {
  font-size: 22px;
  color: var(--text);
}

.topbar__nav {
  display: flex;
  gap: 28px;
  margin-right: auto;
}

.topbar__nav a {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s;
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(244, 93, 101, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(244, 93, 101, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 93, 101, 0); }
}

.topbar__auth {
  display: flex;
  gap: 8px;
}

/* ---------- Account menu ---------- */

.account {
  position: relative;
}

.account__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.account__toggle:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.account__toggle .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.account__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 10px;
  width: 300px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #141416;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.account__row {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-sunken);
  font-size: 12px;
  color: var(--muted);
}

.account__row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: hsl(var(--hue, 40) 45% 50% / 0.16);
  color: hsl(var(--hue, 40) 70% 75%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Intro ---------- */

.intro {
  padding: 64px 0 40px;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status[data-status="active"],
.status[data-status="sold"] {
  color: var(--accent-text);
}

.status[data-status="active"]::before {
  animation: pulse 1.8s infinite;
}

.intro__title {
  max-width: 1000px;
  margin-top: 18px;
  font: 400 clamp(46px, 6.4vw, 84px) / 0.98 var(--font-serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.intro__title.is-clickable {
  cursor: pointer;
}

.intro__title.is-clickable:hover {
  color: var(--text-soft);
}

.intro__byline {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
}

.intro__seller {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-text) 40%, transparent);
  text-underline-offset: 3px;
}

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

.intro__description {
  max-width: 720px;
  margin-top: 22px;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  align-items: start;
  gap: 40px;
  padding-bottom: 96px;
}

/* The single minmax(0, 1fr) track keeps wide children (the spreadsheet) inside the
   column instead of letting them push across the bidding panel. */
.layout__main,
.layout__side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.section-head h2 {
  color: var(--text);
  font: 400 32px/1.1 var(--font-serif);
  letter-spacing: -0.01em;
}

.clients-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
}

.sheet-legend {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 13px;
}

.sheet-legend summary {
  color: var(--text-soft);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.sheet-legend summary::-webkit-details-marker {
  display: none;
}

.sheet-legend[open] summary {
  margin-bottom: 10px;
}

.sheet-legend__list {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 6px 16px;
  margin: 0;
}

.sheet-legend__list dt {
  margin: 0;
  color: var(--text-soft);
  font-weight: 600;
}

.sheet-legend__list dd {
  margin: 0;
  line-height: 1.45;
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  gap: 12px;
}

.gallery__stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-sunken);
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  touch-action: pan-y;
  user-select: none;
}

.gallery__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  opacity: 0;
}

.gallery__nav--prev {
  left: 16px;
}

.gallery__nav--next {
  right: 16px;
}

.gallery__stage:hover .gallery__nav,
.gallery__nav:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .gallery__nav {
    opacity: 1;
  }
}

.gallery__counter {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.gallery__expand {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 40px;
  height: 40px;
}

.gallery__thumbs {
  position: relative;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.gallery__thumb {
  flex: none;
  width: 120px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raised);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.gallery__thumb:hover {
  opacity: 0.85;
}

.gallery__thumb[aria-current="true"] {
  border-color: var(--accent-text);
  opacity: 1;
}

/* ---------- Facts ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.fact {
  padding: 18px 20px;
}

.fact:first-child {
  padding-left: 0;
}

.fact + .fact {
  border-left: 1px solid var(--line);
}

.fact dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fact dd {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Bid card ---------- */

.bid-card {
  display: grid;
  gap: 22px;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(217, 45, 58, 0.16), transparent 70%),
    linear-gradient(180deg, #1a1315, #100d0e 60%);
  box-shadow: inset 0 1px 0 rgba(244, 93, 101, 0.35);
}

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

.price__value {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  transform-origin: left center;
}

.price.is-bumped .price__value {
  animation: bump 0.7s ease-out;
}

@keyframes bump {
  0% { color: var(--accent-text); transform: scale(1.04); }
  100% { color: inherit; transform: none; }
}

.price__meta {
  color: var(--muted);
  font-size: 13px;
}

.countdown {
  display: grid;
  gap: 8px;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}

.countdown__units {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.countdown__unit {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.countdown__unit b {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

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

.countdown__date {
  color: var(--muted);
  font-size: 13px;
}

.countdown.is-urgent .countdown__unit b {
  color: var(--accent-text);
}

.countdown.is-closed .countdown__unit b {
  color: var(--faint);
}

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

.notice[data-tone="success"] {
  background: var(--positive-soft);
  color: var(--positive);
}

.notice[data-tone="warning"] {
  background: var(--warning-soft);
  color: var(--warning);
}

.bid-card__actions {
  display: grid;
  gap: 12px;
}

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

.bid-form__label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.bid-form__min {
  color: var(--muted);
  font-weight: 500;
}

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

.stepper__button {
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 22px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.stepper__button:hover:not(:disabled) {
  border-color: var(--accent-line);
  color: var(--accent-text);
}

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

.stepper__field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-sunken);
  font-size: 20px;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stepper__field:focus-within {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.stepper__field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bid-card__hint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- Bid history ---------- */

.history {
  padding: 22px 24px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}

.history .section-head {
  margin-bottom: 8px;
}

.history .section-head h2 {
  font-size: 26px;
}

.history__list {
  max-height: 440px;
  margin: 0 -24px;
  padding: 0 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.history__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.history__who {
  display: grid;
  min-width: 0;
}

.history__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.history__time {
  color: var(--muted);
  font-size: 12px;
}

.history__amount {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.history__item.is-top .history__amount {
  color: var(--accent-text);
}

.history__empty {
  padding: 18px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag--you {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.tag--top,
.tag--buy {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- Spreadsheet ---------- */

.sheet {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}

.sheet__bar {
  display: flex;
  align-items: stretch;
  height: 42px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.sheet__namebox,
.sheet__fx,
.sheet__value {
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.sheet__namebox {
  width: 88px;
  border-right: 1px solid var(--line);
  color: var(--accent-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sheet__fx {
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
}

.sheet__value {
  overflow: hidden;
  color: var(--text-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sheet__scroll {
  max-height: 560px;
  overflow: auto;
  outline: none;
  scroll-padding: 30px 0 0 52px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.sheet__grid {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.sheet__grid th,
.sheet__grid td {
  height: 38px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.sheet__grid th {
  background: #161214;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
}

.sheet__grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 44px;
  padding: 6px 10px;
  vertical-align: bottom;
}

.sheet__grid thead th.sheet__corner {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sheet__col-label {
  display: block;
  max-width: 11rem;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: normal;
}

.sheet__col-letter {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
}

.sheet__grid tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 52px;
  min-width: 52px;
  padding: 0 8px;
}

.sheet__grid thead th:first-child {
  left: 0;
  z-index: 3;
}

.sheet__grid td {
  color: var(--text-soft);
  cursor: cell;
}

.sheet__grid td:hover {
  background: rgba(255, 255, 255, 0.025);
}

.sheet__grid td.is-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The server already replaced the hidden tail; the blur only marks the placeholder as unreadable. */
.sheet__grid td.is-redacted {
  cursor: default;
  user-select: none;
}

.sheet__grid td.is-redacted .redacted {
  display: inline-block;
  color: var(--faint);
  filter: blur(4px);
  opacity: 0.85;
  vertical-align: baseline;
}

.sheet__grid td.is-selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent-text);
  color: var(--text);
}

.sheet__grid th.is-active {
  background: #2a1417;
  color: var(--accent-text);
}

.sheet__grid thead th.is-active {
  box-shadow: inset 0 -2px 0 var(--accent-text);
}

.sheet__grid tbody th.is-active {
  box-shadow: inset -2px 0 0 var(--accent-text);
}

.sheet__tabs {
  display: flex;
  height: 38px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

.sheet__tab {
  display: flex;
  align-items: center;
  margin-top: -1px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: var(--bg-raised);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

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

.sheet__tab.is-active {
  background: var(--bg);
  box-shadow: inset 0 -2px 0 var(--accent-text);
  color: var(--accent-text);
}

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

.footer {
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

/* ---------- Bid dock ---------- */

.dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(560px, calc(100% - 32px));
  padding: 10px 10px 10px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  translate: -50% 0;
  animation: dock-in 0.25s ease-out;
}

@keyframes dock-in {
  from { opacity: 0; translate: -50% 14px; }
}

.dock__price {
  display: grid;
  line-height: 1.25;
}

.dock__price .label {
  font-size: 10px;
}

.dock__price strong {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dock__time {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Modals ---------- */

.modal {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: #121214;
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.modal[open] {
  animation: modal-in 0.2s ease-out;
}

.modal::backdrop {
  background: rgba(4, 4, 5, 0.75);
  backdrop-filter: blur(6px);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.modal__body {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 30px;
}

.modal__body h3 {
  padding-right: 36px;
  font: 400 34px/1.05 var(--font-serif);
  letter-spacing: -0.01em;
}

.modal__lead {
  margin-top: -8px;
  color: var(--muted);
}

.modal__lead strong {
  color: var(--accent-text);
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.terms {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 14px 32px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.terms strong {
  color: var(--accent-text);
}

.modal__switch {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

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

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

.field__label {
  font-size: 13px;
  font-weight: 600;
}

.field__hint {
  color: var(--muted);
  font-size: 12px;
}

.field input {
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  background: var(--bg-sunken);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.captcha {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha__image {
  width: 150px;
  height: 50px;
  border-radius: 12px;
  background: #eef2f6;
}

.form-error {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(6, 6, 7, 0.97);
  color: var(--text);
}

.lightbox[open] {
  display: grid;
  place-items: center;
  animation: fade-in 0.2s ease-out;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

@keyframes fade-in {
  from { opacity: 0; }
}

.lightbox__image {
  max-width: min(92vw, 1600px);
  max-height: 84dvh;
  border-radius: 14px;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
  cursor: zoom-in;
}

.lightbox.is-zoomed {
  overflow: auto;
  place-items: start;
}

.lightbox.is-zoomed .lightbox__image {
  max-width: none;
  max-height: none;
  margin: auto;
  border-radius: 0;
  touch-action: auto;
  cursor: zoom-out;
}

.lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  translate: 0 -50%;
  width: 52px;
  height: 52px;
}

.lightbox__nav--prev {
  left: 24px;
}

.lightbox__nav--next {
  right: 24px;
}

.lightbox__counter {
  position: fixed;
  bottom: 26px;
  left: 50%;
  translate: -50% 0;
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 20px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100% - 40px));
}

.toast {
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s, translate 0.3s;
}

.toast--success {
  border-color: rgba(114, 212, 163, 0.45);
}

.toast--warning {
  border-color: rgba(242, 180, 90, 0.5);
}

.toast--error {
  border-color: rgba(240, 128, 111, 0.55);
}

.toast.is-leaving {
  opacity: 0;
  translate: 0 -6px;
}

@keyframes toast-in {
  from { opacity: 0; translate: 0 -8px; }
}

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

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
  }
}

/* Four facts side by side need room; below that they read better in two rows. */
@media (max-width: 1280px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .fact:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* Two columns leave the lot table too narrow to read, so stack everything. */
@media (max-width: 1040px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .layout__main,
  .layout__side {
    display: contents;
  }

  .gallery { order: 1; }
  .bid-card { order: 2; }
  .facts { order: 3; }
  .history { order: 4; }
  #details { order: 5; }
}

@media (max-width: 920px) {
  .topbar__inner {
    justify-content: space-between;
    gap: 16px;
  }

  .topbar__nav {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 62px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .brand {
    font-size: 18px;
  }

  .account__alias {
    display: none;
  }

  .topbar__auth .btn {
    padding: 0 14px;
  }

  .intro {
    padding: 36px 0 28px;
  }

  .intro__title {
    font-size: 44px;
  }

  .intro__description {
    font-size: 16px;
  }

  .gallery__stage {
    border-radius: 16px;
  }

  .gallery__thumb {
    width: 88px;
  }

  .bid-card {
    padding: 20px;
  }

  .price__value {
    font-size: 40px;
  }

  .countdown__unit b {
    font-size: 26px;
  }

  .history {
    padding: 18px 18px 4px;
  }

  .history__list {
    margin: 0 -18px;
    padding: 0 18px;
  }

  .footer {
    padding-bottom: 112px;
  }

  .dock {
    bottom: 0;
    width: 100%;
    gap: 14px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
  }

  .lightbox__nav {
    display: none;
  }

  .toasts {
    top: calc(var(--header-h) + 10px);
    right: 16px;
    width: calc(100% - 32px);
  }
}
