/* The radar's admin views (admin.js): only an account in ADMIN_EMAILS ever sees them. Built from
   the site's own tokens and components in styles.css. */

.admin-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* On the Stores tab the health table sits above the store cards. */
#stores-admin {
  margin-bottom: var(--space-lg);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.admin-toolbar h2,
.admin-card h2 {
  margin: 0;
  font-size: var(--text-subheading);
  font-weight: 600;
}

.admin-summary,
.admin-muted,
.admin-sub,
.admin-legend {
  color: var(--text3);
  font-size: var(--text-body-sm);
}

.admin-muted {
  margin: 0;
}

.admin-sub {
  display: block;
  font: 400 var(--text-caption) var(--font-mono);
}

.admin-note {
  margin: 0;
  color: var(--accent);
  font: 400 var(--text-caption) var(--font-mono);
}

.is-bad {
  color: var(--error);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--space-md);
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  min-width: 0;
}

.admin-card > .btn {
  align-self: flex-start;
}

.admin-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Wide tables scroll inside their card, never the page. */
.admin-scroll {
  overflow-x: auto;
  min-width: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body-sm);
}

.admin-table th,
.admin-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table thead th {
  color: var(--text3);
  font: 400 var(--text-label) / 1.2 var(--font-pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-table tbody tr:last-child > * {
  border-bottom: none;
}

.admin-table .is-num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.admin-table tr.is-failing > td:first-child {
  box-shadow: inset 3px 0 0 var(--error);
}

.admin-table .admin-error {
  min-width: 180px;
  max-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--error);
  font: 400 var(--text-caption) var(--font-mono);
}

.admin-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: var(--text-body-sm);
}

.admin-facts dt {
  color: var(--text3);
}

.admin-facts dd {
  margin: 0;
}

/* The Farmers matrix: products down, regions across, the product column pinned while it scrolls. */
.admin-matrix .admin-product {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 220px;
  max-width: 300px;
  white-space: normal;
  background: var(--surface1);
  font-weight: 500;
}

.admin-matrix .admin-product a:hover {
  color: var(--accent);
}

.admin-matrix .admin-product .badge {
  margin-top: 4px;
}

.admin-cell {
  text-align: center;
  font: 400 var(--text-caption) / 1.2 var(--font-mono);
  border-radius: var(--radius-element);
}

td.admin-cell {
  min-width: 52px;
  border-left: 2px solid var(--surface1);
}

.admin-cell small {
  display: block;
  color: var(--text3);
  font-size: 10px;
}

.admin-cell.is-fresh {
  background: var(--success-bg);
  color: var(--success);
}

.admin-cell.is-due {
  background: var(--warning-bg);
  color: var(--warning);
}

.admin-cell.is-stale {
  background: var(--error-bg);
  color: var(--error);
}

.admin-cell.is-never {
  color: var(--text4);
  box-shadow: inset 0 0 0 1px var(--border-visible);
}

.admin-cell.has-stock small {
  color: var(--text1);
  font-weight: 700;
}

.admin-legend {
  margin: 0;
  line-height: 2;
}

.admin-legend .admin-cell {
  display: inline-block;
  padding: 0 6px;
}

/* Farmers: the check intervals, and each product's place on the hot list. */
.admin-settings {
  gap: 8px;
}

.admin-settings .admin-toolbar {
  align-items: flex-end;
}

.admin-minutes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text2);
}

.admin-minutes .admin-input {
  width: 96px;
}

.admin-hot-select {
  display: block;
  width: auto;
  height: 30px;
  margin-top: 6px;
  padding: 0 8px;
  font-size: var(--text-caption);
}

.admin-hot-select.is-hot {
  border-color: var(--restock);
}

.admin-matrix tr.is-hot .admin-product {
  box-shadow: inset 3px 0 0 var(--restock);
}

/* Log */
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text3);
  font-size: var(--text-caption);
}

.admin-field-grow {
  flex: 1 1 240px;
}

.admin-select,
.admin-input {
  height: 38px;
  padding: 0 12px;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  height: 38px;
  color: var(--text2);
}

.log {
  margin: 0;
  padding: 6px 0;
  list-style: none;
  font: 400 var(--text-caption) / 1.5 var(--font-mono);
}

.log-line {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.log-line:last-child {
  border-bottom: none;
}

.log-line time {
  color: var(--text4);
}

.log-level {
  min-width: 40px;
  text-transform: uppercase;
  color: var(--text3);
}

.log-line.is-warn .log-level {
  color: var(--warning);
}

.log-line.is-error .log-level,
.log-line.is-fatal .log-level {
  color: var(--error);
}

.log-line.is-error {
  background: var(--error-bg);
}

.log-source {
  color: var(--accent);
}

.log-msg {
  color: var(--text1);
}

.log-details {
  flex-basis: 100%;
  color: var(--text3);
}

.log-kv i {
  font-style: normal;
  color: var(--text4);
}

.log-details details summary {
  cursor: pointer;
  color: var(--text2);
}

.log-details pre {
  margin: 6px 0 0;
  padding: 8px;
  max-height: 320px;
  overflow: auto;
  border-radius: var(--radius-control);
  background: var(--surface2);
  white-space: pre-wrap;
}

/* SKUs the Farmers probe found, waiting for a name. */
.found-skus-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.found-sku {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  min-width: 0;
}

.found-sku-image {
  width: 64px;
  height: 84px;
  object-fit: contain;
  flex: none;
  border-radius: var(--radius-control);
  background: var(--surface2);
}

.found-sku-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.found-sku-meta {
  font: 400 var(--text-caption) var(--font-mono);
  color: var(--text3);
  overflow-wrap: anywhere;
}

.found-sku-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.found-sku-input {
  flex: 1 1 220px;
  height: 36px;
  padding: 0 12px;
}

/* The Farmers SKU scan, above the found list. */
.scan-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.scan-form {
  display: grid;
  gap: 8px;
}

.scan-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.scan-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 400 var(--text-caption) var(--font-mono);
  color: var(--text3);
}

.scan-input {
  width: 90px;
  height: 36px;
  padding: 0 10px;
}

.scan-input-sku {
  width: 140px;
}

.scan-summary {
  margin: 0;
  font: 400 var(--text-caption) var(--font-mono);
  color: var(--text2);
}

.scan-progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.scan-find.is-pokemon {
  border-color: var(--accent);
}

/* Eight tabs do not fit a phone's bar, so an admin's scrolls sideways (the page never does). */
@media (max-width: 860px) {
  .tabbar.has-admin {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabbar.has-admin button {
    flex: 0 0 76px;
  }
}

@media (max-width: 600px) {
  .admin-matrix .admin-product {
    min-width: 140px;
    max-width: 160px;
    font-size: var(--text-caption);
  }
}

/* Check times */
.admin-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text2);
}

.admin-table tr.is-off > td {
  color: var(--text3);
}

.admin-hot-list {
  max-height: 420px;
  overflow-y: auto;
}

.admin-hot-list tr.is-hot > td:first-child {
  box-shadow: inset 3px 0 0 var(--restock);
}

/* Stock alerts paused: the card says so at a glance. */
.admin-card.is-paused {
  border-color: var(--error);
  box-shadow: inset 4px 0 0 var(--error);
}

.admin-card h2 .ph-bold {
  vertical-align: -2px;
}

/* Price and quantity boxes keep a box's width, not the column's. */
.admin-table .admin-number {
  width: 7.5em;
}

/* Speed checkout (buy-list-ui.js), in the radar's Alerts tab and its admin Checkout tab: phone first. */
.bl {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.bl-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-width: 0;
}

.bl-head,
.bl-details > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.bl-head h2,
.bl-head h3,
.bl-details > summary h2 {
  margin: 0;
  font-size: var(--text-subheading);
  font-weight: 600;
}

/* The delivery address, closed: its heading, whether it is saved and the arrow, then what it does. */
.bl-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  cursor: pointer;
  list-style: none;
}

.bl-details > summary .bl-sub {
  grid-column: 1 / -1;
  grid-row: 2;
}

/* Speed checkout locked: the steps to unlock it, in the accent so it reads as the next thing to do. */
.bl-gate {
  border-color: var(--accent);
}

.bl-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 1.4em;
  font-size: var(--text-body-sm);
  line-height: 1.45;
}

.bl-steps a {
  color: var(--accent);
  font-weight: 600;
}

.bl-gate .btn {
  align-self: flex-start;
}

/* How to add to the list: one way at a time. */
.bl-seg {
  align-self: flex-start;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  justify-self: start;
  padding: 3px;
  border: 2px solid var(--border-visible);
  border-radius: var(--radius-component);
  background: var(--surface1);
}

.bl-seg button {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  color: var(--text2);
  font-size: var(--text-body-sm);
  font-weight: 600;
}

.bl-seg button:hover {
  color: var(--text1);
}

.bl-seg button[aria-selected='true'] {
  background: var(--surface3);
  color: var(--text1);
}

.bl-head-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.bl-sub {
  display: block;
  margin: 4px 0 0;
  color: var(--text2);
  font-size: var(--text-body-sm);
  line-height: 1.45;
}

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

.bl-details > summary::after {
  content: '\25BE';
  color: var(--text3);
}

.bl-details[open] > summary::after {
  content: '\25B4';
}

.bl-count,
.bl-meta,
.bl-hint,
.bl-empty {
  margin: 0;
  color: var(--text3);
  font-size: var(--text-body-sm);
}

.bl-details > summary .bl-count {
  margin-left: auto;
}

.bl-kicker {
  color: var(--accent);
  font: 700 var(--text-label) / 1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Watching: a thin list, an entry's name over its price and quantity on a phone, one line where there is room. */
.bl-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.bl-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.bl-entry.is-off {
  opacity: 0.6;
}

/* An entry's name and terms: the button that opens it to change them. */
.bl-entry-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  min-height: 40px;
  padding: 2px 0;
  color: var(--text1);
  text-align: left;
}

.bl-entry-main:hover .bl-entry-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bl-entry-terms {
  color: var(--text2);
  font: 700 var(--text-caption) / 1.3 var(--font-mono);
}

.bl-entry.is-editing {
  background: var(--surface2);
  margin: 0 -10px;
  padding: 8px 10px 12px;
}

.bl-remove {
  margin-left: auto;
}

.bl-remove:hover {
  color: var(--error);
}

.bl-entry-title {
  font-size: var(--text-body-sm);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.bl-entry-edit {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bl-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text3);
  font-size: var(--text-caption);
}

.bl-mini span {
  white-space: nowrap;
}

/* 16px text: a phone does not zoom into a box it can read. */
.bl-mini .input {
  height: 34px;
  padding: 0 8px;
  font-size: 16px;
}

/* The price box gives way on a narrow phone, so the row never breaks "Max $". */
.bl-mini input[name="maxPrice"] {
  width: 6.5em;
  min-width: 0;
}

.bl-mini input[name="quantity"] {
  width: 4em;
}

.bl-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 2px solid var(--border-visible);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
}

.bl-icon:hover {
  color: var(--error);
  border-color: var(--error);
}

/* Adding, inside the list's card: under the list, set apart by a rule. */
.bl-adder {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.bl-adder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bl-adder-head h4 {
  margin: 0;
  font-size: var(--text-body-sm);
  font-weight: 700;
}

.bl-add-open {
  align-self: flex-start;
}

/* Recent links, folded at the foot of the list's card. */
.bl-recent {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.bl-recent > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text2);
  font-size: var(--text-body-sm);
  font-weight: 600;
  list-style: none;
}

.bl-recent > summary::-webkit-details-marker {
  display: none;
}

.bl-recent > summary::after {
  content: '\25BE';
  margin-left: auto;
  color: var(--text3);
}

.bl-recent[open] > summary::after {
  content: '\25B4';
}

.bl-recent .bl-sent {
  margin-top: 10px;
}

/* The delivery address inside the set-up card's step: no card of its own. */
.bl-embedded {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bl-embedded > .bl-sub {
  margin: 0;
}

/* An on/off switch, big enough for a thumb. */
.bl-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.bl-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.bl-switch span {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--surface3);
  transition: background var(--duration-fast) var(--ease);
  pointer-events: none;
}

.bl-switch span::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text1);
  transition: transform var(--duration-fast) var(--ease);
}

.bl-switch input:checked + span {
  background: var(--accent);
}

.bl-switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--on-accent);
}

.bl-switch input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* The set picker: one dropdown, full width on a phone. */
.bl-set {
  max-width: 420px;
}

.bl-set .input {
  width: 100%;
  cursor: pointer;
}

/* A set's items as a thin list: one line each, the full name, and Add at the side. */
.bl-items {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.bl-items li {
  border-bottom: 1px solid var(--border);
}

.bl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--text1);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.bl-item:hover,
.bl-item:focus-visible {
  background: var(--surface2);
}

.bl-item-name {
  flex: 1;
  min-width: 0;
  font-size: var(--text-body-sm);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.bl-item-add {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font: 700 var(--text-label) / 1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bl-link {
  align-self: flex-start;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 var(--text-body-sm) var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Forms: two columns where there is room, one on a phone. */
.bl-form,
.bl-keywords,
.bl-sheet-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bl-wide {
  grid-column: 1 / -1;
}

.bl-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: var(--text3);
  font-size: var(--text-caption);
}

.bl-field .input {
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
}

@media (max-width: 600px) {
  .bl-form {
    grid-template-columns: 1fr;
  }
}

/* Keywords: the words across a phone, its price and quantity under them, then Add; one line where there is room. */
.bl-keywords .bl-kw,
.bl-keywords .btn {
  grid-column: 1 / -1;
}

.bl-keywords .btn {
  height: 44px;
}

@media (min-width: 640px) {
  .bl-keywords {
    grid-template-columns: minmax(0, 1fr) 9.5em 6em auto;
    align-items: end;
  }

  .bl-keywords .bl-kw,
  .bl-keywords .btn {
    grid-column: auto;
  }
}

.bl-actions,
.bl-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bl-sheet-actions .btn {
  flex: 1 1 0;
  height: 48px;
}

.bl-sheet-actions .btn-primary {
  flex-grow: 2;
}

/* Too narrow for both on one row: Add on top, Cancel under it, as a phone's sheets have them. */
.bl-sheet-actions {
  flex-wrap: wrap-reverse;
}

.bl-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  height: 44px;
}

.bl-stepper button {
  border: 2px solid var(--border-visible);
  background: var(--surface3);
  color: var(--text1);
  font-size: 20px;
  cursor: pointer;
}

.bl-stepper button:first-child {
  border-radius: var(--radius-control) 0 0 var(--radius-control);
}

.bl-stepper button:last-child {
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.bl-stepper .input {
  min-width: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  text-align: center;
  -moz-appearance: textfield;
}

.bl-stepper .input::-webkit-inner-spin-button,
.bl-stepper .input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* An item's price and quantity: a sheet from the bottom on a phone, a dialog on a wide screen. */
body.bl-sheet-open {
  overflow: hidden;
}

/* The sheet is drawn inside the radar's shell (.radar-main and its .container), whose stacking puts
   it under the site header and the phone's tab bar: flattened while it's open, so the backdrop dims
   them with the page and the sheet sits over everything. */
body.bl-sheet-open .radar-main,
body.bl-sheet-open .radar-main > .container {
  z-index: auto;
}

.bl-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgb(8 7 15 / 60%);
}

.bl-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  border: 2px solid var(--border-visible);
  border-bottom: 0;
  border-radius: var(--radius-container) var(--radius-container) 0 0;
  background: var(--surface1);
  box-shadow: 0 -8px 32px rgb(0 0 0 / 35%);
  outline: none;
  animation: bl-rise var(--duration-slow) var(--ease);
}

.bl-sheet h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@keyframes bl-rise {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

@media (min-width: 640px) {
  .bl-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(460px, calc(100vw - 32px));
    transform: translate(-50%, -50%);
    border-bottom: 2px solid var(--border-visible);
    border-radius: var(--radius-container);
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-sheet {
    animation: none;
  }
}

/* What just happened, where a thumb is, then gone. */
.bl-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 300;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 10px 16px;
  transform: translateX(-50%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-component);
  background: var(--surface1);
  color: var(--text1);
  box-shadow: var(--shadow-1);
  font-size: var(--text-body-sm);
}

/* In the radar on a phone: over its tab bar, where the radar's own toasts sit. */
@media (max-width: 860px) {
  .radar-main .bl-toast {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

.bl-sent {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bl-sent li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: anywhere;
}

.bl-sent small {
  color: var(--text3);
  font-size: var(--text-caption);
}

.bl-sent small.is-bad {
  color: var(--error);
}

/* Auto-buy on the admin Checkout tab: its switches as badges, its caps as facts, each attempt's stage in its tone. */
.bl-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bl-badge {
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 999px;
  color: var(--text2);
  font: 600 var(--text-caption) / 1.5 var(--font-mono);
}

.bl-badge.is-good {
  color: var(--success);
}

.bl-badge.is-warn {
  color: var(--warning);
}

.bl-badge.is-bad {
  color: var(--error);
}

.bl-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}

.bl-facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bl-facts dt {
  color: var(--text3);
  font-size: var(--text-caption);
}

.bl-facts dd {
  margin: 0;
  font-weight: 600;
}

.bl-hint.is-bad {
  color: var(--error);
}

.bl-attempts b.is-good {
  color: var(--success);
}

.bl-attempts b.is-bad {
  color: var(--error);
}

/* An attempt still being placed: where it is in the worker right now (refreshed every couple of seconds), with a pulse. */
.bl-attempts b.is-live {
  color: var(--warning);
}

.bl-attempts li.is-running {
  padding-left: 10px;
  border-left: 2px solid var(--warning);
}

.bl-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
}

.bl-live b {
  color: var(--text1);
}

.bl-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  animation: bl-live-pulse 1.4s ease-in-out infinite;
}

.bl-live-steps {
  color: var(--text3);
  font-family: var(--font-mono);
}

/* A proxy test's report: a few plain lines. */
.bl-facts-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text2);
  font-size: var(--text-caption);
}

.bl-facts-list b {
  color: var(--text1);
}

.bl-live-steps i {
  font-style: normal;
  opacity: 0.7;
}

@keyframes bl-live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-live-dot {
    animation: none;
  }
}

.bl-shots a {
  margin-right: 10px;
}

/* ── Speed checkout's Chrome extension setup (extension-setup.js): four steps down a rail, phone first ── */
/* Inside the set-up card's step, the extension has no card or heading of its own. */
.ext-embedded {
  padding: 0;
  gap: 16px;
}

.ext-embedded > .bl-sub {
  margin: 0;
}

.ext {
  display: grid;
  gap: 20px;
  padding: 18px;
  min-width: 0;
}

.ext[aria-busy='true'] {
  gap: 10px;
}

.ext-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.ext-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-component);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 22px;
}

.ext-head h2 {
  margin: 2px 0 0;
  font-size: var(--text-subheading);
  font-weight: 600;
}

.ext-head .bl-sub {
  margin-top: 4px;
}

.ext-status {
  margin-top: 4px;
}

.ext-steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ext-step {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0 14px;
  padding-bottom: 22px;
}

.ext-step:last-child {
  padding-bottom: 0;
}

/* The rail from one step's dot to the next: green once the step is done. */
.ext-step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 36px;
  bottom: 4px;
  left: 15px;
  width: 2px;
  border-radius: 1px;
  background: var(--surface3);
}

.ext-step.is-done:not(:last-child)::before {
  background: var(--success);
}

.ext-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--surface3);
  border-radius: 50%;
  background: var(--surface1);
  color: var(--text3);
  font: 700 13px / 1 var(--font-mono);
  transition:
    border-color var(--duration-medium) var(--ease),
    background var(--duration-medium) var(--ease);
}

.ext-step.is-current .ext-dot {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

.ext-step.is-plain .ext-dot {
  box-shadow: none;
}

.ext-step.is-done .ext-dot {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.ext-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 5px;
}

.ext-body h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.ext-step.is-next .ext-body h3 {
  color: var(--text3);
}

.ext-body p,
.ext-body li {
  margin: 0;
  color: var(--text2);
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.ext-body p b,
.ext-body li b {
  color: var(--text1);
}

.ext-body .is-bad {
  color: var(--error);
}

.ext-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ext-done {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success) !important;
  font-weight: 600;
}

.ext-done i {
  font-size: 18px;
}

.ext-quiet {
  color: var(--text3) !important;
  font-size: var(--text-caption) !important;
}

.ext-code {
  padding: 2px 6px;
  border-radius: var(--radius-element);
  background: var(--surface2);
  color: var(--text1);
  font: 400 var(--text-caption) / 1.6 var(--font-mono);
  overflow-wrap: anywhere;
}

.ext-inline {
  height: 26px;
  margin: 0 2px;
  padding: 0 8px;
  vertical-align: middle;
}

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

.ext-how > summary {
  width: fit-content;
  color: var(--accent);
  font-size: var(--text-body-sm);
  font-weight: 600;
  cursor: pointer;
}

.ext-how[open] > summary {
  margin-bottom: 10px;
}

.ext-how > :not(summary) + :not(summary) {
  margin-top: 10px;
}

.ext-aside {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-component);
  background: var(--surface2);
}

/* This Chrome's copy is older than the version DropNZ offers: the aside, marked as needing the member. */
.ext-update {
  border-left: 3px solid var(--warning);
  background: var(--warning-bg);
}

/* An admin's list of who may use the extension: the same rows as the Chromes, and a box to add an id. */
.ext-access {
  margin-top: 16px;
}

.ext-access-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ext-access-add .input {
  flex: 1;
  min-width: 0;
}

/* An admin's view of how the stores are going: a store, then how its checkouts ended and where the latest stopped. */
.ext-health {
  margin-top: 16px;
}

.ext-health-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
}

.ext-health-body {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.ext-health-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ext-health-body small {
  color: var(--text3);
  font-size: var(--text-caption);
  overflow-wrap: anywhere;
}

/* Their connected Chromes: one row each, what it is over when it last connected, and Remove. */
.ext-chromes {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-component);
}

.ext-chrome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 6px 10px 12px;
}

.ext-chrome + .ext-chrome {
  border-top: 2px solid var(--border);
}

.ext-chrome > i {
  color: var(--text3);
  font-size: 20px;
}

.ext-chrome strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--text1);
  font-size: 14px;
  font-weight: 600;
}

.ext-chrome small {
  display: block;
  margin-top: 2px;
  color: var(--text3);
  font-size: var(--text-caption);
}

.ext-chrome .tag {
  height: 18px;
  font-size: var(--text-label);
}

.ext-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 600;
}

.ext-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--success-bg);
}

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

.ext-key {
  align-items: start;
}

/* The key, whole and wrapping, picked up in one click to copy by hand. */
.ext-key-text {
  display: block;
  padding: 8px 10px;
  border: 2px solid var(--border-visible);
  user-select: all;
  word-break: break-all;
}

/* What it does: what's on in this Chrome beside each, the paying one marked as the one to think about. */
.ext-modes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ext-mode {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--radius-component);
  background: var(--surface2);
}

.ext-mode > i {
  margin-top: 1px;
  color: var(--accent);
  font-size: 18px;
}

.ext-mode.is-warn > i {
  color: var(--warning);
}

.ext-mode strong {
  display: block;
  color: var(--text1);
  font-size: 14px;
  font-weight: 600;
}

.ext-mode p {
  margin-top: 2px !important;
}

.ext-note {
  min-height: 1.4em;
  margin: 0;
  color: var(--text2);
  font-size: var(--text-body-sm);
}

.ext-note:empty {
  display: none;
}

.ext-note.is-bad {
  color: var(--error);
}

.ext-spin {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ext-spin 0.7s linear infinite;
}

@keyframes ext-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ext-spin {
    animation-duration: 2s;
  }
}

@media (max-width: 520px) {
  .ext {
    padding: 16px 14px;
  }

  .ext-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ext-status {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-top: -4px;
  }

  .ext-mode {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ext-mode > .badge {
    grid-column: 2;
    justify-self: start;
  }
}

/* Checkout tabs (checkout-tabs.js): Tasks, Profiles, Proxies. A row is what it is, its status and its buttons; a narrow screen stacks them. */
.tk-tabs {
  margin-bottom: 14px;
  max-width: 100%;
  overflow-x: auto;
}

.tk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.tk-row.is-off .tk-main {
  opacity: 0.65;
}

.tk-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tk-title {
  overflow-wrap: anywhere;
}

.tk-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tk-edit {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-component);
  background: var(--surface1);
}

.tk-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text2);
  font-size: var(--text-body-sm);
}

.tk-small {
  width: auto;
  min-width: 120px;
}

.tk-note:empty {
  display: none;
}

.tk-note.is-bad {
  color: var(--error);
}

@media (max-width: 640px) {
  .tk-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tk-side {
    align-items: flex-start;
  }
}

.tk-groupbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 16px;
  margin: 10px 0;
}

.tk-newgroup {
  margin: 4px 0 8px;
}

.tk-newgroup > summary {
  cursor: pointer;
}

/* Five tabs do not fit a phone in one row: they wrap, so the bar never makes the page wider than the screen. */
.tk-tabs {
  display: flex;
  flex-wrap: wrap;
  overflow-x: visible;
}
