/* Staff workspace. The staff member signs in with an EmpireVault account, so
   the workspace uses EmpireVault's own tokens (copied by value). It is branded
   per operator only where the operator asks for its logo and accent colour
   (the rules under .staff[data-staff-brand], near the end); otherwise only
   .brand-sample reads the --brand-* variables.

   Every pair of text and background here reaches 4.5 to 1, in light and in
   dark (test/system/staff_pages_test.rb measures them). EmpireVault's teal,
   #0d9488, is 3.74 to 1 on white: it is --color-accent, never text and never
   behind text. */
.staff {
  --color-primary: #0f766e;
  --color-primary-hover: #115e59;
  --color-on-primary: #ffffff;
  --color-accent: #0d9488;
  --color-text-primary: #1e293b;
  --color-text-secondary: #5b6b80;
  --color-surface: #ffffff;
  --color-background: #f8fafc;
  --color-sunken: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-strong: #94a3b8;
  --color-current: #ccfbf1;
  --color-on-current: #115e59;
  --color-success-bg: #dcfce7;
  --color-success-text: #166534;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #991b1b;
  --color-danger: #b91c1c;
  --color-info-bg: #dbeafe;
  --color-info-text: #1e40af;
  --color-neutral-bg: #e2e8f0;
  --color-neutral-text: #334155;
  --color-scrim: rgba(15, 23, 42, 0.45);
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --sidebar-width: 240px;

  margin: 0;
  color: var(--color-text-primary);
  background: var(--color-background);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: dark) {
  .staff {
    --color-primary: #2dd4bf;
    --color-primary-hover: #5eead4;
    --color-on-primary: #0f172a;
    --color-accent: #2dd4bf;
    --color-text-primary: #e2e8f0;
    --color-text-secondary: #a3b2c7;
    --color-surface: #1e293b;
    --color-background: #0f172a;
    --color-sunken: #172033;
    --color-border: #334155;
    --color-border-strong: #64748b;
    --color-current: #134e4a;
    --color-on-current: #ccfbf1;
    --color-success-bg: #14532d;
    --color-success-text: #bbf7d0;
    --color-warning-bg: #713f12;
    --color-warning-text: #fef3c7;
    --color-danger-bg: #7f1d1d;
    --color-danger-text: #fee2e2;
    --color-danger: #fca5a5;
    --color-info-bg: #1e3a8a;
    --color-info-text: #dbeafe;
    --color-neutral-bg: #334155;
    --color-neutral-text: #e2e8f0;
    --color-scrim: rgba(0, 0, 0, 0.6);
  }
}

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

.staff a {
  color: var(--color-primary);
}

.staff a:hover {
  color: var(--color-primary-hover);
}

.staff :focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.staff [hidden] {
  display: none !important;
}

/* Said on every page of a demonstration operator. Black on yellow: fixed, so
   no operator's colours can make it faint. */
.demonstration-line {
  margin: 0;
  padding: 0.4rem 1rem;
  color: #000;
  background: #ffd84d;
  font-weight: 700;
  text-align: center;
}

/* ---- Shell: sidebar and page ---- */

.staff-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.staff-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

.staff-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.staff-brand h1,
.staff-header-plain h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.staff-nav {
  flex: 1;
}

.staff-nav-group {
  margin-bottom: 0.9rem;
}

.staff-nav-heading {
  margin: 0 0 0.2rem;
  padding: 0 0.75rem;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.staff .staff-nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
}

.staff .staff-nav a:hover {
  background: var(--color-sunken);
}

.staff .staff-nav a[aria-current="page"] {
  border-left-color: var(--color-accent);
  color: var(--color-on-current);
  background: var(--color-current);
  font-weight: 700;
}

.staff-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.staff-user form {
  margin: 0;
}

.staff-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.staff-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-height: 3.5rem;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.staff-breadcrumb {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.93rem;
}

.staff-breadcrumb a {
  font-weight: 500;
}

.staff-breadcrumb [aria-current] {
  color: var(--color-text-primary);
  font-weight: 600;
}

.staff-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.staff-actions form {
  margin: 0;
}

.staff-main {
  width: 100%;
  max-width: 76rem;
  padding: 1.5rem;
}

.staff-main > h2:first-of-type,
.page-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.staff-main h3 {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.1rem;
}

/* The menu button and the drawer exist only on a narrow screen, and only
   once the menu controller is running (data-menu-ready). Without scripts the
   sidebar is simply above the page. */
.staff .staff-menu-open,
.staff .staff-menu-close,
.staff .staff-scrim {
  display: none;
}

@media (max-width: 55.99rem) {
  .staff-shell {
    display: block;
  }

  .staff-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .staff .staff-shell[data-menu-ready] .staff-menu-open,
  .staff .staff-shell[data-menu-ready] .staff-menu-close {
    display: inline-flex;
  }

  .staff .staff-nav a {
    min-height: 44px;
  }

  .staff-shell[data-menu-ready] .staff-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(20rem, 88vw);
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
    border-bottom: 0;
  }

  .staff .staff-shell[data-menu-ready] .staff-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: var(--color-scrim);
  }

  .staff-header {
    padding: 0.5rem 1rem;
  }

  .staff-main {
    padding: 1rem;
  }
}

/* Nobody signed in, and the invitation and reset pages: one card. */
.staff-header-plain {
  justify-content: center;
}

.staff-card,
.staff > .staff-main {
  max-width: 28rem;
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 30rem) {
  .staff-card,
  .staff > .staff-main {
    margin: 1rem;
    width: auto;
  }
}

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

.staff-button,
.staff-button-quiet,
.staff-button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  color: var(--color-on-primary);
  background: var(--color-primary);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.staff a.staff-button,
.staff a.staff-button:hover {
  color: var(--color-on-primary);
}

.staff-button:hover {
  border-color: var(--color-primary-hover);
  background: var(--color-primary-hover);
}

.staff-button-quiet,
.staff a.staff-button-quiet {
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
  background: var(--color-surface);
}

.staff-button-quiet:hover {
  background: var(--color-sunken);
}

.staff-button-danger,
.staff a.staff-button-danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-surface);
}

.staff-button-danger:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

/* ---- Notices ---- */

.staff-notice,
.form-errors,
.live-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-md);
}

.staff-notice {
  color: var(--color-success-text);
  background: var(--color-success-bg);
}

.form-errors {
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
}

.staff .form-errors a,
.staff .staff-notice a {
  color: inherit;
  font-weight: 600;
}

/* "Connection lost": words, a border and a background, not colour alone. */
.live-notice {
  border-width: 2px;
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  font-weight: 700;
}

/* ---- Cards, facts, empty pages ---- */

.card {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.staff-main dl,
.facts {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
  gap: 0.45rem 1.25rem;
  margin: 0 0 1.25rem;
}

.staff-main dt {
  color: var(--color-text-secondary);
  font-size: 0.93rem;
}

.staff-main dd {
  margin: 0;
}

.staff-main dd > p:first-child {
  margin-top: 0;
}

.staff-main dd > p:last-child {
  margin-bottom: 0;
}

@media (max-width: 40rem) {
  .staff-main dl,
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .staff-main dd {
    margin-bottom: 0.6rem;
  }
}

.empty {
  margin: 0 0 1.25rem;
  padding: 1.5rem;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
  background: var(--color-surface);
}

.muted,
.form-hint {
  color: var(--color-text-secondary);
  font-size: 0.93rem;
}

/* Text shown as it was typed, line breaks kept (an operator's bank details). It wraps: never wider than its card. */
.staff-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border, currentColor);
  border-radius: 4px;
}

/* ---- Tables: each scrolls sideways inside its own box ---- */

.table-box {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.staff-main table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.staff-main th,
.staff-main td {
  /* A cell keeps its words whole and the table scrolls in its box; elsewhere a long word wraps. */
  overflow-wrap: normal;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.staff-main thead th {
  color: var(--color-text-secondary);
  background: var(--color-sunken);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.staff-main tbody tr:last-child > * {
  border-bottom: 0;
}

.staff-main td form {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
}

/* Smaller in a row on a wide screen only: on a phone every button is thumb-sized. */
@media (min-width: 40rem) {
  .staff-main td .staff-button,
  .staff-main td .staff-button-quiet,
  .staff-main td .staff-button-danger {
    min-height: 36px;
    padding: 0.25rem 0.7rem;
  }
}

.num,
.staff-main td.num,
.staff-main th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Status badges: always words ---- */

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-neutral { color: var(--color-neutral-text); background: var(--color-neutral-bg); }
.badge-info { color: var(--color-info-text); background: var(--color-info-bg); }
.badge-success { color: var(--color-success-text); background: var(--color-success-bg); }
.badge-warning { color: var(--color-warning-text); background: var(--color-warning-bg); }
.badge-danger { color: var(--color-danger-text); background: var(--color-danger-bg); }
.badge-closed { color: var(--color-neutral-text); background: var(--color-neutral-bg); text-decoration: line-through; }

/* ---- Forms ---- */

.staff-main form {
  max-width: 44rem;
}

.staff-main .table-box form,
.staff-actions form,
.staff-main .inline-form {
  max-width: none;
}

.form-card {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.form-card > legend {
  padding: 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

/* A field that must be filled in is marked (Plan 31): drawn from the field's own
   `required` attribute, which is what a screen reader announces, so the two
   cannot disagree. What the mark means is said once by each form that has
   such a field (staff/shared/_required_legend). */
.form-group:has(> :required) > .form-label::after {
  content: " *";
  color: var(--color-danger);
  font-weight: 700;
}

.required-legend {
  margin: 0 0 1rem;
  color: var(--color-text-secondary);
  font-size: 0.93rem;
}

.required-legend strong {
  color: var(--color-danger);
}

.form-input,
.staff-main input[type="text"],
.staff-main input[type="email"],
.staff-main input[type="password"],
.staff-main input[type="number"],
.staff-main input[type="search"],
.staff-main input[type="date"],
.staff-main input[type="datetime-local"],
.staff-main input[type="url"],
.staff-main input[type="tel"],
.staff-main select,
.staff-main textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  background: var(--color-surface);
  font: inherit;
}

.staff-main input[type="file"] {
  max-width: 100%;
  min-height: 44px;
  font: inherit;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.staff-main details {
  margin: 0 0 1rem;
}

.staff-main summary {
  min-height: 44px;
  padding: 0.6rem 0;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Filters and tabs: links that say which is on ---- */

.staff-tabs,
.staff-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.25rem;
  padding: 0;
  border-bottom: 1px solid var(--color-border);
  list-style: none;
}

.staff .staff-tabs a,
.staff .staff-filters a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border-bottom: 3px solid transparent;
  color: var(--color-text-primary);
  font-weight: 500;
  text-decoration: none;
}

.staff .staff-tabs a:hover,
.staff .staff-filters a:hover {
  background: var(--color-sunken);
}

.staff .staff-tabs a[aria-current],
.staff .staff-filters a[aria-current] {
  border-bottom-color: var(--color-accent);
  font-weight: 700;
}

/* ---- Odds and ends kept from before ---- */

/* Read by a screen reader, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lot-countdown {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.terms-body {
  max-width: 44rem;
}

/* How the operator's colours look together (settings page). */
.brand-sample {
  max-width: 24rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-bottom: 4px solid var(--brand-accent);
  color: var(--brand-text);
  background: var(--brand-background);
}

/* The operator's logo and accent colour, only where it asked for them
   (TenantSettings#staff_brand?). These are the ONLY rules outside .brand-sample
   that read --brand-*: two things change, the mark at the head of the menu and
   the main button. */
.staff[data-staff-brand] .staff-logo-plate {
  display: inline-flex;
  max-width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--brand-background);
}

.staff[data-staff-brand] .staff-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(11rem, 100%);
  max-height: 2.5rem;
}

.staff[data-staff-brand] .staff-brand h1,
.staff[data-staff-brand] .staff-header-plain h1 {
  min-width: 0;
}

/* The plate, not the heading, sets the line: a name shown where there is no logo keeps its own line height. */
.staff[data-staff-brand] .staff-logo-plate {
  vertical-align: middle;
  line-height: 0;
}

.staff[data-staff-brand] .staff-button:not(.staff-button-quiet):not(.staff-button-danger),
.staff[data-staff-brand] a.staff-button:not(.staff-button-quiet):not(.staff-button-danger) {
  border: 1px solid color-mix(in srgb, var(--brand-accent-text) 40%, var(--brand-accent));
  color: var(--brand-accent-text);
  background: var(--brand-accent);
}

/* The accent and its text are the one pair known to be readable, exactly as
   saved: hover keeps both and shows at the button's edge. */
.staff[data-staff-brand] .staff-button:not(.staff-button-quiet):not(.staff-button-danger):hover {
  border-color: var(--brand-accent-text);
  color: var(--brand-accent-text);
  background: var(--brand-accent);
  box-shadow: inset 0 0 0 1px var(--brand-accent-text);
}

/* A button that cannot be pressed never wears the accent, hovered or not. */
.staff[data-staff-brand] .staff-button:not(.staff-button-quiet):not(.staff-button-danger):disabled,
.staff[data-staff-brand] .staff-button:not(.staff-button-quiet):not(.staff-button-danger):disabled:hover,
.staff[data-staff-brand] .staff-button:not(.staff-button-quiet):not(.staff-button-danger)[aria-disabled="true"],
.staff[data-staff-brand] .staff-button:not(.staff-button-quiet):not(.staff-button-danger)[aria-disabled="true"]:hover {
  border-color: var(--color-border-strong);
  color: var(--color-neutral-text);
  background: var(--color-neutral-bg);
  box-shadow: none;
  cursor: not-allowed;
}

/* The browser's own colour picker, large enough for a thumb. */
.colour-input {
  display: block;
  width: 5.5rem;
  height: 2.75rem;
  padding: 0.15rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  cursor: pointer;
}

.brand-sample-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  color: var(--brand-accent-text);
  background: var(--brand-accent);
  font-weight: 600;
}

/* ---- Dashboard ---- */

.queue,
.sales,
.staff-activity {
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border);
}

.queue li:last-child,
.sales li:last-child,
.staff-activity li:last-child {
  border-bottom: 0;
}

.queue-count {
  flex: none;
  min-width: 2.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sales li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.sales p {
  margin: 0;
}

.sales-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.staff-activity li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.15rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.staff-activity time {
  color: var(--color-text-secondary);
  font-size: 0.87rem;
  white-space: nowrap;
}

.staff-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.staff-roles li {
  padding: 0.1rem 0.6rem;
  border-radius: 9999px;
  color: var(--color-neutral-text);
  background: var(--color-neutral-bg);
  font-size: 0.87rem;
}

/* ---- The header of every page of one auction ---- */

.auction-header {
  margin: 0 0 1.25rem;
}

.auction-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}

.auction-header h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.auction-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  margin-left: auto;
}

.auction-header-actions form {
  margin: 0;
}

.auction-pause {
  position: relative;
  margin: 0;
}

.auction-pause > summary {
  padding: 0.5rem 1rem;
  list-style: none;
}

.auction-pause > summary::-webkit-details-marker {
  display: none;
}

.auction-pause[open] > form {
  margin-top: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

/* A popover beside the button on a wide screen; in the flow of the page on a phone, where it would run off the edge. */
@media (min-width: 40rem) {
  .auction-pause[open] > form {
    position: absolute;
    right: 0;
    z-index: 10;
    width: 24rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  }
}

@media (max-width: 39.99rem) {
  .auction-header-actions {
    width: 100%;
    margin-left: 0;
  }

  .auction-pause[open] {
    order: 2;
    width: 100%;
  }
}

.auction-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.5rem;
  margin: 0.5rem 0 1rem;
  padding: 0;
  color: var(--color-text-secondary);
  font-size: 0.93rem;
  list-style: none;
}

/* A page's own heading under the auction's. */
.auction-header ~ h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

/* ---- A lot: where it stands and what can be done, beside its details ---- */

.lot-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
}

.lot-title h2,
.lot-title p {
  margin: 0;
}

.lot-title h2 {
  font-size: 1.2rem;
}

.lot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 1.25rem;
}

.lot-side,
.lot-main {
  min-width: 0;
}

@media (min-width: 64rem) {
  .lot-layout {
    grid-template-columns: minmax(0, 1fr) 22rem;
    align-items: start;
  }

  .lot-main {
    grid-column: 1;
    grid-row: 1;
  }

  .lot-side {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 1rem;
  }
}

.card h3 {
  margin: 0 0 0.75rem;
}

.staff-main dl.facts-stacked {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.1rem;
}

.staff-main dl.facts-stacked dd {
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.lot-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.lot-actions-row form {
  margin: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.photo-grid li {
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-sunken);
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  object-fit: cover;
}

/* The lot list's filters: side by side where there is room, one under another on a phone. */
.lot-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  align-items: flex-end;
}

.lot-filters .form-group {
  flex: 1 1 11rem;
  min-width: 0;
}

.lot-filters .form-actions {
  flex: 1 1 100%;
}

.tick-lot {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.tick-lot input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
}

.photo-grid [data-cover] {
  margin-bottom: 0.35rem;
}

/* What the order script says when an order was not saved: a row of its own, empty until then. */
.photo-order-status {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-warning-text);
  border-radius: var(--radius-md);
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
}

.photo-order-status:empty {
  display: none;
}

.photo-grid li[draggable="true"] {
  cursor: grab;
}

.photo-grid li.photo-dragged {
  opacity: 0.5;
}

.photo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.photo-controls form {
  margin: 0;
}

.photo-controls .staff-button-quiet {
  min-height: 44px;
  padding: 0.25rem 0.7rem;
  font-size: 0.87rem;
}

.lot-documents {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.lot-documents li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.lot-documents form {
  display: inline-block;
  margin: 0.25rem 0.25rem 0 0;
}

.increment-rows input {
  min-height: 40px;
}

/* ---- An invoice page leads with what is owed ---- */

.invoice-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
}

.invoice-summary h2,
.invoice-summary p {
  margin: 0;
}

.invoice-summary h2 {
  font-size: 1.35rem;
}

.invoice-summary-owed strong {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.invoice-summary > :last-child {
  margin-left: auto;
}

.invoice-paper {
  overflow-x: auto;
}

.staff-main h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.staff-counts dd {
  font-weight: 600;
}

/* ---- A table that becomes one card a row on a phone (site staff work from these) ---- */

@media (max-width: 40rem) {
  .staff-main table.stack-on-phone,
  .staff-main table.stack-on-phone tbody,
  .staff-main table.stack-on-phone tr,
  .staff-main table.stack-on-phone td {
    display: block;
  }

  .staff-main table.stack-on-phone thead {
    display: none;
  }

  .staff-main table.stack-on-phone tr {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--color-border);
  }

  .staff-main table.stack-on-phone tr:last-child {
    border-bottom: 0;
  }

  .staff-main table.stack-on-phone td {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.15rem 0;
    border: 0;
  }

  .staff-main table.stack-on-phone td::before {
    content: attr(data-label);
    color: var(--color-text-secondary);
    font-size: 0.87rem;
  }

  .staff-main table.stack-on-phone td:first-child {
    font-size: 1.05rem;
    font-weight: 700;
  }
}

/* ---- A release: its status, then collecting, then the rest ---- */

.release-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.release-status h2,
.release-status p {
  margin: 0;
}

.release-status h2 {
  font-size: 1.35rem;
}

.staff .collect-button {
  width: 100%;
  min-height: 48px;
  font-size: 1.05rem;
}

.release-paper {
  overflow-x: auto;
}

/* ---- The live board ---- */

.live-closed > summary {
  font-weight: 700;
}

/* A group of fields inside a card has no box of its own. */
.staff-main fieldset.form-group {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.staff-main fieldset.form-group > legend {
  padding: 0;
}

.staff-main .increment-rows {
  max-width: 28rem;
}

.staff-main .increment-rows th,
.staff-main .increment-rows td {
  padding: 0.25rem 0.5rem 0.25rem 0;
  border-bottom: 0;
}

.staff-main .increment-rows thead th {
  background: none;
}

.staff-main .increment-rows input {
  min-height: 38px;
  padding: 0.3rem 0.6rem;
}

/* A photograph's own caption, under it on the staff lot page. */
.photo-caption {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

/* "Find a lot" in the header: a short field and its button. */
.lot-lookup {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lot-lookup .form-input {
  width: 11rem;
  max-width: 45vw;
}

/* Support access (Plan 48): on every page while a platform person is inside, above everything else. */
.support-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.5rem 1rem;
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
}

.support-banner p {
  margin: 0;
}
