body {
  --livery-field-height: 3rem;
  --livery-field-radius: .75rem;
  --livery-field-ink: var(--ln-ink, #101010);
  --livery-field-muted: var(--ln-muted, #505158);
  --livery-field-surface: color-mix(in srgb, var(--ln-white, #fff) 97%, var(--livery-field-ink));
  --livery-field-border: color-mix(in srgb, var(--ln-control-line, #a7a094) 87%, var(--livery-field-ink));
  --livery-field-accent: var(--ln-accent-dark, #73582b);
  --livery-field-action: var(--ln-action, #101c2b);
  --livery-field-error: #a93630;
  --livery-field-font: var(--ln-font, system-ui, sans-serif);
}

[data-livery-theme="midnight"] body { --livery-field-error: #ffaba3; }

/* Composite controls draw their own border and focus indicator around the input. */
body :is(input, select, textarea):not([hidden]):not([data-livery-field-custom],
  [type="hidden"], [type="checkbox"], [type="radio"], [type="file"], [type="range"],
  [type="color"], [type="image"], [type="button"], [type="submit"], [type="reset"]) {
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: var(--livery-field-height);
  padding: .65rem .85rem;
  border: 1px solid var(--livery-field-border);
  border-radius: var(--livery-field-radius);
  background-color: var(--livery-field-surface);
  color: var(--livery-field-ink);
  font: 400 1rem/1.35 var(--livery-field-font);
}

body textarea:not([hidden]):not([data-livery-field-custom]) {
  min-block-size: 5.5rem;
  resize: vertical;
}

body select:not([hidden]):not([multiple], [size], [data-livery-field-custom]) {
  appearance: none;
  padding-inline-end: 2.45rem;
  background-image:
    linear-gradient(45deg, transparent 48%, var(--livery-field-muted) 50%),
    linear-gradient(135deg, var(--livery-field-muted) 50%, transparent 52%);
  background-position: calc(100% - 1.125rem) 50%, calc(100% - .8125rem) 50%;
  background-repeat: no-repeat;
  background-size: .3125rem .3125rem;
}

body select:not([hidden]):not([multiple], [size], [data-livery-field-custom]):dir(rtl) {
  background-position: .8125rem 50%, 1.125rem 50%;
}

body :is(input, textarea)::placeholder { color: var(--livery-field-muted); opacity: 1; }
body :is(input[type="checkbox"], input[type="radio"], input[type="range"], progress) { accent-color: var(--livery-field-action); }

body :is(input, select, textarea):not([hidden]):not([data-livery-field-custom]):is([aria-invalid="true"], :user-invalid) {
  border-color: var(--livery-field-error);
}

body :is(input, select, textarea):not([hidden]):not([data-livery-field-custom]):is(:disabled, [readonly]) {
  color: var(--livery-field-muted);
}

body :is(input, select, textarea):disabled { cursor: not-allowed; }

input[type="file"]::file-selector-button {
  min-block-size: 2.5rem;
  margin-inline-end: .65rem;
  padding-inline: .85rem;
  border: 1px solid var(--livery-field-border);
  border-radius: .6rem;
  background: var(--livery-field-surface);
  color: var(--livery-field-ink);
  font: 650 .875rem/1.3 var(--livery-field-font);
  cursor: pointer;
}

/* View changes focus headings for assistive technology. Only controls need a visual cue. */
body :is(h1, h2, h3, h4, h5, h6, main, [role="status"], [role="alert"])[tabindex="-1"]:focus {
  outline: none !important;
}

@media (forced-colors: none) {
  /* The shared treatment takes precedence over outlines set by individual components. */
  body :focus-visible { outline: none !important; }

  body :is(a[href], button, summary, [role="button"], [role="link"], [role="tab"], [tabindex="0"]):focus-visible {
    box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 16%, transparent);
  }

  body :is(a[href], button, summary):not(:where(.landing-brand, .account-entry-brand)):focus-visible {
    text-decoration-line: underline;
    text-decoration-thickness: .12em;
    text-underline-offset: .22em;
  }

  body :is(input, select, textarea, [contenteditable="true"]):not([data-livery-field-custom]):focus-visible {
    box-shadow: inset 0 0 0 100vmax color-mix(in srgb, var(--livery-field-accent) 18%, transparent);
  }

  body :is(.livery-offer-result, .listing-create-upload, .business-upload-tile):focus-within,
  body .discovery-card-identity > h3 a:focus-visible::after {
    outline: none;
  }

  body .website-badge-lookup:focus-within { box-shadow: none; }
}

@media (forced-colors: active) {
  body select:not([hidden]):not([multiple], [size], [data-livery-field-custom]) { appearance: auto; background-image: none; }
  body :is(input, select, textarea):focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
