/* Reserve: a sale catalogue beside the face of a Dutch auction clock. */
:root {
  --head: var(--c-earth);
  --primary-bg: var(--c-earth);
  --primary-fg: var(--c-cream);
}
[data-theme="dark"] { --head: var(--c-peach); --primary-bg: var(--c-peach); --primary-fg: var(--accent-fg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --head: var(--c-peach); --primary-bg: var(--c-peach); --primary-fg: var(--accent-fg); }
  .mark { background: var(--c-cream); padding: 8px 12px; }
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
main { max-width: 44rem; margin: 0 auto; padding: 32px 16px 64px; }
p, h1, h2, h3, h4, ol, ul { margin: 0; }
[hidden] { display: none !important; }
.soft { color: var(--ink-soft); }
.small { font-size: 12px; }
.label { font-variant-caps: all-small-caps; letter-spacing: 0.06em; color: var(--ink-soft); }
#lot-caption { font-size: 18px; line-height: 1.3; }
label, legend {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.problem:empty, #window-note:empty, #error:empty, #notes:empty, #offer:empty, #budget:empty, #lot-note:empty, #lot-result:empty { display: none; }
.problem, #error { color: var(--ink); font-weight: 700; }
#error { margin: 0 0 24px; border-left: 3px solid var(--ink); padding: 4px 0 4px 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* header */
header { margin-bottom: 32px; }
.mark { display: inline-block; line-height: 0; }
.mark img { width: 140px; height: auto; display: block; }
h1 { margin-top: 24px; font-size: 56px; line-height: 1.05; font-weight: 700; color: var(--head); letter-spacing: -0.01em; }
.lede { margin-top: 8px; max-width: 36rem; }
body[data-screen="screen-lot"] h1, body[data-screen="screen-lot"] .lede,
body[data-screen="screen-catalogue"] h1, body[data-screen="screen-catalogue"] .lede { display: none; }
body[data-screen="screen-lot"] header, body[data-screen="screen-catalogue"] header { margin-bottom: 24px; }

/* controls */
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  font: 500 16px/1 var(--font-body);
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--ink); cursor: pointer;
}
button.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); font-weight: 700; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
:focus-visible, #drop:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
input[type="text"], input[type="date"] {
  display: block; width: 100%; min-width: 0; height: 44px; margin-top: 8px; padding: 0 12px;
  font: 500 16px var(--font-body); font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--bg); border: 1px solid var(--ink);
}
input[type="radio"] {
  appearance: none; flex: none; width: 18px; height: 18px; margin: 0 8px 0 0; padding: 3px;
  border: 1px solid var(--ink); border-radius: 0; background: var(--bg); background-clip: content-box;
}
input[type="radio"]:checked { background-color: var(--ink); }
@media (forced-colors: active) { input[type="radio"]:checked { forced-color-adjust: none; background-color: CanvasText; border-color: CanvasText; } }

/* empty */
#drop {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px;
  min-height: 176px; padding: 32px 24px; border: 1px solid var(--ink); cursor: pointer;
  text-transform: none; letter-spacing: normal; font-size: 16px; color: var(--ink);
}
#drop.over { outline: 3px solid var(--ink); outline-offset: -4px; }
#drop .soft { font-size: 12px; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* ready */
.count { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.notes { margin-top: 8px; padding-left: 20px; color: var(--ink-soft); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 24px 0; padding-top: 24px; border-top: 1px solid var(--ink); }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field .soft.small { margin-top: 8px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }
.radios label { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; text-transform: none; letter-spacing: normal; color: var(--ink); cursor: pointer; }
.rule { font-size: 12px; color: var(--ink-soft); }
#rule { margin-top: 8px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#window-note, #window-error, #field-error, #offer, #budget { margin-bottom: 8px; font-variant-numeric: tabular-nums; }
#open-sale { margin-top: 16px; }

/* lot */
.lot { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 32px; align-items: start; }
.lot-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
#lot-title { font-size: 32px; line-height: 1.15; font-weight: 700; color: var(--head); overflow-wrap: anywhere; }
#lot-when { font-variant-numeric: tabular-nums; }
.numeral {
  margin-top: 16px; font-weight: 200; line-height: 1; font-variant-numeric: tabular-nums;
  font-size: clamp(64px, 18vw, 200px); white-space: nowrap; letter-spacing: -0.02em;
}
.numeral.long { font-size: clamp(40px, 11vw, 120px); }
#clock-unit { min-height: 24px; }
#lot-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.accept { width: 100%; min-height: 96px; font-size: 20px; }
#pass { align-self: flex-start; }
.result { margin-top: 16px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
#next { align-self: flex-start; }
#scale { width: 96px; height: 320px; overflow: visible; margin-top: 8px; }
#scale .tick { stroke: var(--ink); stroke-width: 1; }
#scale .tick-label { fill: var(--ink-soft); font: 500 11px var(--font-body); font-variant-numeric: tabular-nums; }
#scale .zero { stroke: var(--error); stroke-width: 2; }
#scale .zero-label { fill: var(--error); font: 700 11px var(--font-body); }
#scale .marker { stroke: var(--ink); stroke-width: 3; }

/* catalogue */
.actions { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
#catalogue { border: 1px solid var(--ink); padding: 32px; }
.title-block { padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.cat-title { font-size: 56px; line-height: 1.05; font-weight: 700; color: var(--head); }
.title-block p { margin-top: 8px; font-variant-numeric: tabular-nums; }
.part { padding: 24px 0; border-bottom: 1px solid var(--ink); }
.part h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--head); font-weight: 700; margin-bottom: 16px; break-after: avoid; }
.part p + p { margin-top: 8px; }
.part > p, .part li { font-variant-numeric: tabular-nums; }
.part ol { padding-left: 24px; }
.part ol li + li { margin-top: 4px; }
.terms { font-weight: 700; }
[data-section] h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 700; color: var(--head); break-after: avoid; }
.entry {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 0 16px;
  padding: 16px 0; border-top: 1px solid var(--ink); break-inside: avoid; font-variant-numeric: tabular-nums;
}
.rank { font-weight: 700; color: var(--head); font-size: 20px; line-height: 1.2; }
.entry-title { font-weight: 700; overflow-wrap: anywhere; }
.entry-hammer { text-align: right; }
.hammer { font-weight: 700; white-space: nowrap; }
.two-col { columns: 2; column-gap: 32px; padding-left: 20px; }
.two-col li { break-inside: avoid; margin-bottom: 8px; }
.colophon { padding-top: 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.colophon .mark img { width: 120px; }

@media (max-width: 479px) {
  h1, .cat-title { font-size: 44px; }
  .fields { grid-template-columns: 1fr; }
  .lot { gap: 16px; }
  #scale { height: 240px; }
  #catalogue { padding: 16px; }
  .entry { grid-template-columns: 28px minmax(0, 1fr); }
  .entry-hammer { grid-column: 2; text-align: left; margin-top: 8px; }
  .two-col { columns: 1; }
}

@page { size: A4; margin: 18mm 18mm 24mm; }
@media print {
  :root, :root:not([data-theme="light"]) {
    --bg: #FFFFFF; --ink: #1A1A1A; --ink-soft: #5B5B5B; --head: var(--c-earth);
    color-scheme: light;
  }
  html, body { background: #FFFFFF; }
  body { font-size: 10pt; }
  main { max-width: none; padding: 0; }
  header, #error, .actions, #screen-empty, #screen-ready, #screen-lot { display: none !important; }
  #catalogue { border: 0; padding: 0; }
  .cat-title { font-size: 28pt; }
  .entry { padding: 8pt 0; }
  .rank { font-size: 14pt; }
  .mark { background: none; padding: 0; }
  .ranking { break-before: page; }
}
