/* Buyer-facing pages. Every brand surface reads one of the four variables an
   operator sets (see BrandHelper#brand_css); no brand colour is written here. */
.buyer {
  /* Two tints made from the operator's own pair, so they suit a light page and a dark one. */
  --line: color-mix(in srgb, var(--brand-text) 16%, transparent);
  --wash: color-mix(in srgb, var(--brand-text) 5%, var(--brand-background));
  --quiet: color-mix(in srgb, var(--brand-text) 68%, var(--brand-background));
  /* Outbid, and a refusal: red mixed towards the page's own text colour, so it reads on a light or a dark page. */
  --refusal: color-mix(in srgb, #b3261e 55%, var(--brand-text));
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  margin: 0;
  color: var(--brand-text);
  background: var(--brand-background);
}

.buyer a {
  color: var(--brand-text);
  text-underline-offset: 0.15em;
}

.buyer a:hover {
  text-decoration-color: var(--brand-accent);
  text-decoration-thickness: 2px;
}

.buyer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 5px solid var(--brand-accent);
}

.buyer-header h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.buyer-header h1 a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* A wide logo is held by its height, a tall one by its width; never more than most of a phone. */
.buyer-logo {
  display: block;
  max-height: 3.5rem;
  max-width: min(20rem, 60vw);
  width: auto;
  height: auto;
}

.buyer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.buyer-nav form {
  margin: 0;
}

.buyer-nav-primary,
.buyer .staff-button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--brand-accent);
  border-radius: 4px;
  background: var(--brand-accent);
  color: var(--brand-accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.buyer a.buyer-nav-primary {
  color: var(--brand-accent-text);
}

.buyer-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* The foot of the page is part of the page: its own colours on a tint of
   them, so it suits a dark page as well as a light one. */
.buyer-footer {
  margin-top: 3rem;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  color: var(--brand-text);
  background: var(--wash);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.buyer-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
}

.buyer-footer [data-footer-name] {
  font-weight: 700;
}

.buyer-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.buyer .buyer-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--brand-text);
  font-weight: 400;
}

/* In the header the accent is for the one thing to do next; signing out is quiet. */
.buyer .buyer-nav .staff-button {
  border-color: var(--line);
  background: transparent;
  color: var(--brand-text);
  font-weight: 400;
}

.buyer .buyer-nav a:not(.buyer-nav-primary) {
  text-decoration: none;
}

.buyer .buyer-nav a:not(.buyer-nav-primary):hover {
  text-decoration: underline;
}

.buyer .form-input {
  color: var(--brand-text);
  background: var(--brand-background);
  border-color: color-mix(in srgb, var(--brand-text) 45%, transparent);
}

.buyer .form-input:focus,
.buyer .staff-button:focus-visible,
.buyer a:focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.buyer .staff-table th,
.buyer .staff-table td {
  border-color: color-mix(in srgb, var(--brand-text) 20%, transparent);
}

/* Words never push a page wider than its screen. */
.buyer h2,
.buyer h3,
.buyer li,
.buyer p,
.buyer td,
.buyer dd {
  overflow-wrap: anywhere;
}

.buyer h2 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.buyer h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.15rem;
}

/* The top of the front page and of an auction: what this is, and how to look through it. */
.catalogue-hero {
  margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border-left: 6px solid var(--brand-accent);
  background: var(--wash);
}

.catalogue-hero h2 {
  margin-top: 0;
}

.catalogue-hero p {
  max-width: 44rem;
}

.catalogue-hero .catalogue-search {
  margin-bottom: 0;
}

/* The operator's own words and picture. Words beside the picture on a wide
   screen, above it on a narrow one; with no picture, one column. */
.catalogue-hero[data-hero="picture"] {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
}

.hero-words {
  min-width: 0;
}

/* Only the front page's headline: an auction's page uses .catalogue-hero too and keeps an ordinary heading. */
.catalogue-hero[data-hero] h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.hero-intro {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.hero-picture {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 12rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.catalogue-search select {
  flex: 1 1 9rem;
  min-width: 0;
  max-width: 100%;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: var(--brand-text);
  background: var(--brand-background);
  border: 1px solid color-mix(in srgb, var(--brand-text) 45%, transparent);
  border-radius: 4px;
}

.catalogue-search select option {
  color: var(--brand-text);
  background: var(--brand-background);
}

.catalogue-search select:focus {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.catalogue-search .staff-button {
  min-height: 2.75rem;
}

@media (max-width: 56rem) {
  .catalogue-hero[data-hero="picture"] {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Browse by category: a picture, a name and how many lots. */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.category-tiles li {
  min-width: 0;
}

.buyer .category-tiles a {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 2.75rem;
  overflow: hidden;
  text-decoration: none;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.buyer .category-tiles a:hover,
.buyer .category-tiles a:focus-visible {
  border-color: var(--brand-accent);
}

.category-tiles img,
.category-tile-blank {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.category-tile-blank {
  background: color-mix(in srgb, var(--brand-text) 10%, var(--brand-background));
  border-bottom: 3px solid var(--brand-accent);
  box-sizing: border-box;
}

.category-tile-name {
  padding: 0.75rem 0.9rem 0;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.category-tile-count {
  padding: 0.15rem 0.9rem 0.85rem;
  color: var(--quiet);
  font-size: 0.9rem;
}

@media (max-width: 40rem) {
  .category-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.catalogue-phase {
  font-size: 1.15rem;
  font-weight: 700;
}

.catalogue-small,
.lot-crumbs {
  color: var(--quiet);
  font-size: 0.9rem;
}

/* Said in words first; the mark only adds to them. */
[data-phase="open"] .catalogue-phase::before,
.auction-list li[data-phase="open"] > span::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, #0b7a3b 70%, var(--brand-text));
}

/* The lot tag: the numbered tag hung on a piece at a yard sale. */
.lot-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  background: var(--brand-accent);
  color: var(--brand-accent-text);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
}

/* "Lot 4: Vacuum truck" stays one sentence for a screen reader and for anyone
   copying it; the tag's edge already does the colon's work for the eye. */
.lot-colon {
  color: transparent;
  letter-spacing: -0.25em;
}

.lot-title .lot-tag {
  margin-right: 0.35rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
  vertical-align: 0.3em;
}

.buyer img {
  max-width: 100%;
}

.buyer .form-group {
  max-width: 30rem;
}

.buyer .staff-button {
  min-height: 2.75rem;
}

/* Search: the field takes the room, the button keeps its size. */
.catalogue-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.catalogue-search label {
  flex-basis: 100%;
}

.catalogue-search input[type="search"] {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: var(--brand-text);
  background: var(--brand-background);
  border: 1px solid color-mix(in srgb, var(--brand-text) 45%, transparent);
  border-radius: 4px;
}

.catalogue-filters p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 0.5rem 0;
  color: var(--quiet);
  font-size: 0.9rem;
}

/* A filter is a switch: the one that is on is filled in. */
.buyer .catalogue-filters a,
.catalogue-filters strong {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-text);
  text-decoration: none;
}

.buyer .catalogue-filters a:hover {
  border-color: var(--brand-text);
}

.catalogue-filters strong {
  border-color: var(--brand-text);
  background: var(--brand-text);
  color: var(--brand-background);
}

.auction-list,
.lot-grid {
  display: grid;
  gap: 1.25rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

/* An auction on the front page: a wide row, its picture beside its name. One
   column on a phone. */
.auction-list {
  grid-template-columns: minmax(0, 1fr);
}

.auction-list li {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(1rem, 3vw, 2rem);
  align-content: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.auction-list li:not(:has(img)) {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 1.25rem;
}

.auction-list img {
  display: block;
  grid-row: 1 / span 2;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.buyer .auction-list a {
  align-self: end;
  padding: 1.25rem 1.25rem 0 0;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-decoration: none;
}

.buyer .auction-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(--brand-accent);
}

.auction-list li > span {
  align-self: start;
  padding: 0.5rem 1.25rem 1.25rem 0;
}

/* A lot in an auction: a card with its tag on the picture and its price at the foot. */
.lot-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
}

.lot-grid li {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.lot-grid li:hover,
.lot-grid li:focus-within {
  border-color: var(--brand-text);
}

.lot-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--wash);
}

.buyer .lot-grid a {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.buyer .lot-grid a:hover .lot-card-title {
  text-decoration: underline;
  text-decoration-color: var(--brand-accent);
  text-decoration-thickness: 2px;
}

.lot-card-title {
  padding: 0.8rem 0.9rem 0.2rem;
}

.lot-grid li:has(img) .lot-tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
}

.lot-card-place {
  padding: 0 0.9rem;
  color: var(--quiet);
  font-size: 0.9rem;
}

.lot-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 0.75rem;
  margin-top: auto;
  padding: 0.6rem 0.9rem 0.75rem;
  color: var(--quiet);
  font-size: 0.9rem;
}

.lot-price strong {
  color: var(--brand-text);
  font-size: 1.2rem;
}

@media (max-width: 40rem) {
  .auction-list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .auction-list img {
    grid-row: auto;
  }

  .buyer .auction-list a,
  .auction-list li > span {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Filter links are for thumbs. */
.buyer .catalogue-filters a,
.catalogue-filters strong {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  box-sizing: border-box;
}

/* Price and sort: one small form, its fields in a row that wraps. */
.browse-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem 1rem;
  margin: 0.75rem 0 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--wash);
  border-radius: 6px;
}

.browse-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  color: var(--quiet);
  font-size: 0.9rem;
}

.browse-field input,
.browse-field select {
  width: 9rem;
  max-width: 100%;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: var(--brand-text);
  background: var(--brand-background);
  border: 1px solid color-mix(in srgb, var(--brand-text) 45%, transparent);
  border-radius: 4px;
}

.browse-field select {
  width: 13rem;
}

.browse-field input:focus,
.browse-field select:focus,
.catalogue-search input:focus {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.browse-form .staff-button {
  min-height: 2.75rem;
}

.browse-count {
  margin: 0.5rem 0;
  font-weight: 700;
}

.lot-card-auction {
  padding: 0 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.lot-card-closes {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.9rem 0.6rem;
  font-size: 0.9rem;
}

.buyer .lot-card-closes .lot-countdown {
  font-size: 1.05rem;
}

.lot-card-closes + .lot-price {
  border-top: 1px solid var(--line);
}

/* The list of lots: a table on a wide screen, where a cell keeps its words whole. */
.buyer table[data-view="list"] td,
.buyer table[data-view="list"] th {
  overflow-wrap: normal;
}

/* On a phone each lot is a block: its title, then its facts, each with its name. */
@media (max-width: 40rem) {
  .buyer table[data-view="list"],
  table[data-view="list"] tbody,
  table[data-view="list"] tr,
  .buyer table[data-view="list"] td {
    display: block;
  }

  table[data-view="list"] thead {
    display: none;
  }

  table[data-view="list"] tr {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }

  .buyer table[data-view="list"] td {
    padding: 0.1rem 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  table[data-view="list"] td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--quiet);
    font-size: 0.9rem;
  }

  .buyer table[data-view="list"] td[data-lot-title] {
    padding: 0.2rem 0;
    font-weight: 700;
  }

  .buyer table[data-view="list"] td[data-lot-title] a {
    display: inline-block;
    min-height: 2.75rem;
  }
}

.lot-grid li > .lot-price {
  margin-top: auto;
}

.catalogue-paging {
  display: flex;
  gap: 1.5rem;
}

.buyer .catalogue-paging a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

@media (max-width: 40rem) {
  .browse-field,
  .browse-field input,
  .browse-field select {
    width: 100%;
  }

  .browse-field {
    flex: 1 1 8rem;
  }

  .browse-form .staff-button {
    flex: 1 1 100%;
  }
}

/* A section of the front page: its name, and where the rest are. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 2rem 0 0.6rem;
}

.buyer .section-head h3 {
  margin: 0;
}

.buyer .section-head a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.95rem;
}

.buyer [data-section] > h3,
.buyer .section-head h3 {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

/* Recent bids: one line each, the time at the end. */
.recent-bids {
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.recent-bids li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.recent-bids time {
  color: var(--quiet);
  font-size: 0.9rem;
}

/* Tables on buyer pages: bids, invoices, releases. */
.buyer .staff-table {
  border-collapse: collapse;
}

.buyer .staff-table th {
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--brand-text);
  font-size: 0.85rem;
  text-align: left;
}

.buyer .staff-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.staff-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* A lot's page in parts (Plan 30): the bidding (.lot-panel), a signed-in
   bidder's watch button (.lot-watch), the asset (.lot-asset: photographs,
   description, facts, documents) and the sale's side (.lot-sale: terms,
   removal, location, seller). On a phone they follow in that order, so the
   bidding comes before the photographs; on a wide screen the asset is the
   left column and the others the right. The space between the parts is each
   part's own margin, not a row gap: the watch button's row is empty for a
   visitor and must take no room. */
.lot-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "panel" "watch" "asset" "sale";
  column-gap: 2rem;
  row-gap: 0;
}

.lot-top > .lot-panel,
.lot-top > .lot-watch,
.lot-top > .lot-asset,
.lot-top > .lot-sale {
  min-width: 0;
  margin-bottom: 1rem;
}

.lot-top > .lot-panel {
  grid-area: panel;
}

.lot-top > .lot-watch {
  grid-area: watch;
}

.lot-top > .lot-asset {
  grid-area: asset;
}

.lot-top > .lot-sale {
  grid-area: sale;
}

@media (min-width: 60rem) {
  .lot-top {
    grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
    grid-template-areas: "asset panel" "asset watch" "asset sale";
    grid-template-rows: auto auto 1fr;
    align-items: start;
  }

  .lot-top > .lot-panel .lot-bidding {
    margin-top: 0;
  }
}

/* One block of the sale's side: a card with a small heading. */
.sale-block {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--wash);
  overflow-wrap: anywhere;
}

.buyer .sale-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--quiet);
}

.sale-block p {
  margin: 0.35rem 0;
}

/* The bidding panel in the operator's colours. Leading and outbid are said in
   words and a mark; their green and red are mixed towards the page's own text
   colour, so they stay readable on a light page and on a dark one. */
.buyer .lot-bidding {
  border: 1px solid var(--line);
  border-top: 6px solid var(--brand-accent);
  background: var(--wash);
}

.buyer .lot-standing-price {
  color: var(--quiet);
}

.buyer .lot-standing-price strong {
  /* On a line of its own, and still one sentence with its label. */
  display: inline-block;
  width: 100%;
  color: var(--brand-text);
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.buyer .lot-countdown {
  font-weight: 700;
}

/* The time is the long cell: it may wrap, so the table fits its column. */
.buyer .lot-bid-history td:first-child {
  white-space: normal;
}

.buyer .lot-bid-history td,
.buyer .lot-bid-history th {
  font-size: 0.9rem;
}

.buyer .lot-description {
  max-width: 44rem;
  font-size: 1.1rem;
}

.buyer .lot-own-position [data-leading="true"] strong,
.buyer .lot-row [data-leading="true"] strong {
  color: color-mix(in srgb, #0b7a3b 55%, var(--brand-text));
}

.buyer .lot-own-position [data-leading="false"] strong,
.buyer .lot-row [data-leading="false"] strong {
  color: var(--refusal);
}

.buyer .lot-row {
  border-bottom-color: color-mix(in srgb, var(--brand-text) 20%, transparent);
}

.buyer dl[data-specifications] {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.3rem 1rem;
}

.buyer dl[data-specifications] dt {
  font-weight: 600;
}

.buyer dl[data-specifications] dd {
  margin: 0;
}

@media (max-width: 40rem) {
  .buyer-header {
    padding: 0.7rem 1rem;
  }

  .buyer-main {
    padding: 1rem 1rem 2.5rem;
  }

  .buyer dl[data-specifications] {
    grid-template-columns: 1fr;
  }
}

/* The operator fixes this page's colours, so a notice or an error is drawn in
   the page's own text colour, whatever colour scheme the visitor's device
   prefers (the plain sheet's dark-mode colours would be pale on a white page). */
.buyer .staff-notice,
.buyer .form-errors {
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand-text) 35%, transparent);
  border-left: 6px solid var(--brand-accent);
  border-radius: 4px;
  color: var(--brand-text);
  background: var(--brand-background);
}

.buyer .form-errors {
  border-left-color: #b3261e;
  font-weight: 600;
}

/* A refusal on a buyer's page is not to be missed (Plan 30): the size of a
   heading, and a rule of the refusal's colour all round. */
.buyer .form-errors[role="alert"] {
  border: 2px solid var(--refusal);
  font-size: 1.15rem;
  font-weight: 700;
}

/* The bid field's own lines: the minimum, and the words for an amount below it. */
.bid-hint {
  margin: 0.35rem 0 0;
  color: var(--quiet);
  font-size: 0.9rem;
}

.bid-hint:empty {
  display: none;
}

.bid-problem {
  margin: 0.35rem 0 0;
  color: var(--refusal);
  font-weight: 600;
}

.bid-problem[hidden] {
  display: none;
}

.buyer .form-input[aria-invalid="true"] {
  border-color: var(--refusal);
  border-width: 2px;
}

.buyer .staff-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* An explanation for whoever wants it: closed until asked for. */
.info {
  margin: 0.25rem 0 0.75rem;
}

.info summary {
  cursor: pointer;
  text-decoration: underline;
  min-height: 1.75rem;
}

.info p {
  margin: 0.4rem 0 0;
  color: var(--quiet);
}

/* A lot's facts: a list of names and values, two columns where there is room. */
.key-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 0 2rem;
  margin: 0.5rem 0 1.5rem;
}

.key-details > div {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.key-details dt {
  color: var(--quiet);
}

.key-details dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lot-sale-basis {
  margin: 0.75rem 0;
  color: var(--quiet);
  font-size: 0.95rem;
}

.lot-card-facts,
.lot-row-facts {
  color: var(--quiet);
  font-size: 0.9rem;
}

.lot-card-facts {
  display: block;
  padding: 0 0.9rem;
}

.lot-row-facts {
  display: block;
}

.lot-photos figure {
  margin: 0;
}

/* The photograph viewer (gallery_controller.js). Its controls sit on the
   picture, on the page's own colours so they read on any photograph. */
.gallery-stage {
  position: relative;
}

.gallery-stage > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--wash);
}

.gallery-arrow,
.gallery-zoom,
.gallery-count {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--brand-background);
  color: var(--brand-text);
  font: inherit;
}

.gallery-arrow,
.gallery-zoom {
  min-width: 2.75rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.gallery-arrow {
  top: 50%;
  margin-top: -1.375rem;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
}

.gallery-previous {
  left: 0.5rem;
}

.gallery-next {
  right: 0.5rem;
}

.gallery-zoom {
  top: 0.5rem;
  right: 0.5rem;
  padding: 0 0.75rem;
}

.gallery-count {
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
}

.gallery-arrow:focus-visible,
.gallery-zoom:focus-visible,
.lot-photos ul a:focus-visible {
  outline: 3px solid var(--brand-text);
  outline-offset: 2px;
}

.lot-photos [hidden] {
  display: none;
}

.lot-photos ul {
  flex-wrap: wrap;
  overflow-x: visible;
}

.lot-photos ul a {
  display: block;
  border: 2px solid transparent;
  border-radius: 6px;
}

.lot-photos ul a[aria-current="true"] {
  border-color: var(--brand-text);
}

.lot-photos ul img {
  display: block;
  border-radius: 4px;
}

.gallery-viewer {
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  margin: 0;
  padding: 1rem;
  border: 0;
  background: var(--brand-background);
  color: var(--brand-text);
}

.gallery-viewer::backdrop {
  background: var(--brand-background);
}

.gallery-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.gallery-viewer .gallery-stage > img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  margin: 0 auto;
  object-fit: contain;
}

.gallery-viewer-caption {
  margin: 0.75rem 0 0;
  text-align: center;
  color: var(--quiet);
  overflow-wrap: anywhere;
}

.lot-photos figcaption {
  margin-top: 0.4rem;
  color: var(--quiet);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* A page of lots: the filter column beside the lots on a wide page, folded above them on a narrow one. */
.browse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 2rem;
  align-items: start;
}

.browse-results {
  min-width: 0;
}

.browse-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
}

.browse-bar .browse-form {
  margin: 0 0 0.5rem;
  padding: 0;
  background: none;
}

.browse-filters {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* The fold: a label that is a button on a narrow page. Its box is read, not seen. */
.filters-fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0 1rem;
  font-weight: 700;
  cursor: pointer;
}

.filters-fold::after {
  content: "+";
  font-size: 1.3rem;
}

.filters-fold-box:checked + .filters-fold::after {
  content: "\2212";
}

.filters-fold-box:focus-visible + .filters-fold {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

.filters-body {
  display: none;
  padding: 0 1rem 1rem;
}

.filters-fold-box:checked ~ .filters-body {
  display: block;
}

.filters-head {
  display: none;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.filters-head h3,
.facet h4 {
  margin: 0;
  font-size: 1rem;
}

.filters-fold-box:checked ~ .filters-body .filters-head {
  display: flex;
}

.filters-fold-box:checked ~ .filters-body .filters-head h3 {
  visibility: hidden;
}

.buyer .filters-head a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.9rem;
}

.facet {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.facet h4 {
  color: var(--quiet);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facet ul {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

/* A choice: a tick box drawn here, its words, and how many lots have it. */
.buyer .facet .tick {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--brand-text);
  font-size: 0.95rem;
  text-decoration: none;
}

.tick::before {
  content: "";
  box-sizing: border-box;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid color-mix(in srgb, var(--brand-text) 60%, var(--brand-background));
  border-radius: 3px;
}

.tick[data-shape="round"]::before {
  border-radius: 50%;
}

.tick[aria-current]::before {
  border-color: var(--brand-text);
  background: var(--brand-text);
  box-shadow: inset 0 0 0 3px var(--brand-background);
}

.tick[aria-current] .tick-name {
  font-weight: 700;
}

.buyer .facet .tick:hover .tick-name {
  text-decoration: underline;
  text-decoration-color: var(--brand-accent);
  text-decoration-thickness: 2px;
}

.tick-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tick-count {
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--wash);
  color: var(--quiet);
  font-size: 0.8rem;
}

.facet summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.filters-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.filters-form .browse-field {
  flex: 1 1 6rem;
}

.filters-form .browse-field[data-filter="auction"] {
  flex-basis: 100%;
}

.filters-form .browse-field input,
.filters-form .browse-field select {
  width: 100%;
}

.filters-form .staff-button {
  flex: 1 1 100%;
  min-height: 2.75rem;
}

@media (min-width: 60rem) {
  .browse-layout {
    grid-template-columns: 16rem minmax(0, 1fr);
  }

  .filters-fold {
    display: none;
  }

  .filters-body,
  .filters-fold-box:checked ~ .filters-body {
    display: block;
    padding-top: 0.5rem;
  }

  .filters-head,
  .filters-fold-box:checked ~ .filters-body .filters-head {
    display: flex;
  }

  .filters-fold-box:checked ~ .filters-body .filters-head h3 {
    visibility: visible;
  }
}

/* The card: when the lot closes sits on the foot of its photograph; then its sale, its category and place. */
.lot-grid li {
  container-type: inline-size;
}

.lot-grid li:has(img) .lot-card-closes {
  position: absolute;
  top: 75cqw;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  padding: 0.3rem 0.9rem;
  background: var(--brand-background);
  font-size: 0.85rem;
  font-weight: 700;
}

.lot-grid li:has(img) .lot-price {
  border-top: 1px solid var(--line);
}

.buyer .lot-grid .lot-card-auction a {
  display: inline;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
}

.lot-card-featured {
  align-self: flex-start;
  margin: 0.2rem 0.9rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--brand-text);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Arriving by a tick (its link ends in #filters) the fold is open, so a buyer can tick again; the label then closes it. */
.browse-filters {
  scroll-margin-top: 0.5rem;
}

@media (max-width: 59.99rem) {
  .browse-filters:target .filters-body {
    display: block;
  }

  .browse-filters:target .filters-body .filters-head {
    display: flex;
  }

  .browse-filters:target .filters-body .filters-head h3 {
    visibility: hidden;
  }

  .browse-filters:target .filters-fold::after {
    content: "\2212";
  }

  .browse-filters:target .filters-fold-box:checked ~ .filters-body {
    display: none;
  }

  .browse-filters:target .filters-fold-box:checked + .filters-fold::after {
    content: "+";
  }
}

/* On a wide page there is no fold, so its box is no tab stop either. */
@media (min-width: 60rem) {
  .filters-fold-box {
    display: none;
  }
}

/* A staff member's preview of a buyer page (Plan 29). The line across the top is
   not the operator's: fixed colours of its own, so it reads on any brand. */
.preview-line {
  background: #fff4c2;
  color: #1f1a00;
  border-bottom: 2px solid #8a6d00;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.preview-line p,
.preview-line ul {
  margin: 0.25rem 0;
}

.preview-line a {
  color: #1f1a00;
  font-weight: 600;
  text-decoration: underline;
}

.preview-card {
  margin-bottom: 1.5rem;
}

.preview-heading {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--quiet);
  margin: 1rem 0 0.5rem;
}

.preview-card .lot-grid {
  max-width: 22rem;
}

/* Past results (Plan 37): a small picture beside each row. */
.result-thumb { display: block; width: 5rem; height: auto; }

/* "Powered by EmpireVault" (Plan 48): one small line under the foot, in the foot's own colours. The platform
   decides whether it shows; the operator's colours decide how. */
.buyer-attribution {
  max-width: 72rem;
  margin: 0.25rem auto 0;
  font-size: 0.8rem;
}
