.b2m-tool {
  --b2m-sans: "Source Sans 3", system-ui, "Segoe UI", sans-serif;
  --b2m-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  background: var(--b2m-surface);
  color: var(--b2m-ink);
  border: 1px solid var(--b2m-rule);
  border-radius: 12px;
  padding: 1.25rem;
  font-family: var(--b2m-sans);
}

.b2m-fields,
.b2m-fields--convert,
.b2m-fields--logs {
  display: grid;
  gap: 0.9rem;
}

.b2m-field label,
.b2m-segment legend,
.b2m-result-label,
.b2m-receipt-head {
  display: block;
  margin: 0 0 0.4rem;
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--b2m-muted);
}

.b2m-tool input:not([type="range"]):not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.b2m-tool select {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--b2m-rule-strong);
  background: var(--b2m-paper);
  color: var(--b2m-ink);
  padding: 0.5rem 0.8rem;
  font-family: var(--b2m-mono);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

.b2m-tool input:focus-visible,
.b2m-tool select:focus-visible,
.b2m-tool button:focus-visible {
  outline: 2px solid var(--b2m-focus);
  outline-offset: 2px;
}

.b2m-tool input[aria-invalid="true"] { border-color: var(--b2m-danger); }

.b2m-segment {
  border: 0;
  margin: 1.25rem 0 0.9rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.b2m-segment legend { float: left; width: 100%; padding: 0; }

.b2m-segment label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--b2m-ink);
  cursor: pointer;
}
.b2m-segment input[type="radio"] { accent-color: var(--b2m-amber); width: 18px; height: 18px; margin: 0; }

.b2m-swap,
.b2m-presets button,
.b2m-button--ghost,
.b2m-reset {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--b2m-rule-strong);
  background: transparent;
  color: var(--b2m-ink);
  font-family: var(--b2m-sans);
  font-size: 0.9375rem;
  font-weight: 550;
  padding: 0 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.b2m-swap:hover,
.b2m-presets button:hover,
.b2m-button--ghost:hover,
.b2m-reset:hover { border-color: var(--b2m-ink); background: var(--b2m-surface-2); }

.b2m-reset {
  margin-top: 1.25rem;
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.b2m-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

/* Result readouts: two big mono numbers split by a hairline. */
.b2m-split {
  display: grid;
  margin-top: 0.4rem;
  border: 1px solid var(--b2m-rule);
  border-radius: 12px;
  background: var(--b2m-surface-2);
  overflow: hidden;
}

.b2m-result {
  position: relative;
  padding: 1rem 1.1rem 1.1rem;
  min-width: 0;
}
.b2m-split .b2m-result + .b2m-result { border-top: 1px solid var(--b2m-rule); }

.b2m-result-value,
.b2m-log-row p:last-child {
  margin: 0 0 0.6rem;
  font-family: var(--b2m-mono);
  font-weight: 500;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.b2m-tool .b2m-button--ghost {
  background: transparent;
  color: var(--b2m-ink);
  border: 1px solid var(--b2m-rule-strong);
}
.b2m-tool .b2m-button--ghost:hover { background: var(--b2m-surface-2); color: var(--b2m-ink); border-color: var(--b2m-ink); }
.b2m-result .b2m-button--ghost {
  min-height: 32px;
  padding: 0 0.8rem;
  font-size: 0.8125rem;
}

/* Log-scale slider: 2px track, square thumb, mono ticks. */
.b2m-slider { margin: 1.5rem 0 0.25rem; }

.b2m-tool input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.b2m-tool input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--b2m-rule-strong); border-radius: 0; }
.b2m-tool input[type="range"]::-moz-range-track { height: 2px; background: var(--b2m-rule-strong); border-radius: 0; }
.b2m-tool input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border: 0;
  border-radius: 0;
  background: var(--b2m-amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--b2m-amber) 20%, transparent);
}
.b2m-tool input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: var(--b2m-amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--b2m-amber) 20%, transparent);
}
.b2m-tool input[type="range"]:focus-visible { outline: 2px solid var(--b2m-focus); outline-offset: 4px; border-radius: 2px; }

.b2m-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.15rem;
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  color: var(--b2m-muted);
}

/* Receipt: mono, right-aligned values, big total. */
.b2m-receipt {
  border: 1px solid var(--b2m-rule);
  border-radius: 12px;
  background: var(--b2m-paper);
  padding: 1.1rem 1.25rem 1.25rem;
  font-family: var(--b2m-mono);
}
.b2m-receipt dl { margin: 0; }
.b2m-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--b2m-rule-strong);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.b2m-receipt-row dt { color: var(--b2m-muted); }
.b2m-receipt-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.b2m-receipt-total { margin-top: 1.1rem; }
.b2m-total {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--b2m-amber-text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.b2m-log-results { display: grid; gap: 0.6rem; }
.b2m-log-row {
  border: 1px solid var(--b2m-rule);
  border-radius: 12px;
  background: var(--b2m-surface-2);
  padding: 0.85rem 1rem 0.5rem;
}
.b2m-log-row p:first-child {
  margin: 0 0 0.3rem;
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--b2m-muted);
}
.b2m-log-row p:last-child { font-size: clamp(1.25rem, 3vw, 1.75rem); margin-bottom: 0.4rem; }

.b2m-formula,
.b2m-hint {
  color: var(--b2m-muted);
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.b2m-tool-error { color: var(--b2m-danger); font-weight: 600; }

.b2m-unit-columns { display: grid; gap: 1.25rem; margin-top: 1rem; }
.b2m-unit-columns h3 {
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--b2m-muted);
  margin: 0 0 0.4rem;
}
.b2m-unit-columns dl { margin: 0; }
.b2m-unit-columns dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--b2m-rule);
  padding: 0.5rem 0;
}
.b2m-unit-columns dt { color: var(--b2m-muted); font-family: var(--b2m-mono); font-size: 0.9375rem; }
.b2m-unit-columns dd { margin: 0; font-family: var(--b2m-mono); font-size: 0.9375rem; font-variant-numeric: tabular-nums; text-align: right; }

.b2m-convert-grid { display: grid; gap: 1.5rem; }
.b2m-convert-main { min-width: 0; }

/* Bandwidth packet. */
.b2m-transfer { margin: 1rem 0 0.4rem; }
.b2m-transfer-track {
  position: relative;
  height: 2px;
  background: var(--b2m-rule-strong);
}
.b2m-transfer-packet {
  position: absolute;
  top: -6px;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--b2m-amber);
}
.b2m-transfer-packet.is-run { animation: b2m-packet 1.6s ease-in-out infinite; }
@keyframes b2m-packet {
  0% { left: 0; }
  100% { left: calc(100% - 14px); }
}

.b2m-result-value.is-pop,
.b2m-log-row p:last-child.is-pop { animation: b2m-pop 0.2s ease; }
@keyframes b2m-pop {
  0% { opacity: 0.55; }
  100% { opacity: 1; }
}

/* Embedded "Try it" card: narrow, stacked, no receipt. */
.b2m-tool--compact {
  background: transparent;
  border: 0;
  padding: 0;
}
.b2m-tool--compact .b2m-result-value { font-size: clamp(1.375rem, 2.2vw, 1.625rem); }
.b2m-tool--compact .b2m-fields--convert { grid-template-columns: 1fr; }
.b2m-tool--compact .b2m-swap { justify-self: start; }
.b2m-tool--compact .b2m-segment { margin-top: 0.9rem; }
.b2m-tool--compact .b2m-reset { display: none; }
.b2m-tool--compact input:not([type="range"]):not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.b2m-tool--compact select { font-size: 1rem; }
.b2m-tool--compact .b2m-fields,
.b2m-tool--compact .b2m-log-results { grid-template-columns: 1fr; }

@media (min-width: 720px) {
  .b2m-split { grid-template-columns: 1fr 1fr; }
  .b2m-split .b2m-result + .b2m-result { border-top: 0; border-left: 1px solid var(--b2m-rule); }
  .b2m-fields--convert { grid-template-columns: 1.2fr 1fr auto 1fr; align-items: end; }
  .b2m-fields--logs { grid-template-columns: 1fr 1fr; }
  .b2m-log-results { grid-template-columns: 1fr 1fr; }
  .b2m-unit-columns { grid-template-columns: 1fr 1fr; }
  .b2m-swap { margin-bottom: 0.1rem; }
  .b2m-tool--compact .b2m-split { grid-template-columns: 1fr; }
  .b2m-tool--compact .b2m-split .b2m-result + .b2m-result { border-left: 0; border-top: 1px solid var(--b2m-rule); }
  .b2m-tool--compact .b2m-log-results { grid-template-columns: 1fr; }
}

@media (min-width: 960px) {
  .b2m-convert-main .b2m-fields--convert { grid-template-columns: 1fr auto 1fr; }
  .b2m-convert-main .b2m-fields--convert > .b2m-field:first-child { grid-column: 1 / -1; }
  .b2m-convert-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 2rem; }
  .b2m-tool--compact .b2m-convert-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .b2m-transfer-packet,
  .b2m-result-value,
  .b2m-log-row p:last-child { animation: none !important; transition: none !important; }
  .b2m-swap, .b2m-presets button, .b2m-button--ghost, .b2m-reset { transition: none; }
}

/* Compress tools. Every selector starts with .b2m-tool so page-body typography rules cannot win. */

/* Numbered flow: choose, options, compress, download. */
.b2m-tool .b2m-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}
.b2m-tool .b2m-steps > li.b2m-step {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.b2m-tool .b2m-step-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
}
.b2m-tool .b2m-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--b2m-rule-strong);
  border-radius: 50%;
  background: var(--b2m-surface-2);
  color: var(--b2m-muted);
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}
.b2m-tool .b2m-step-title {
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--b2m-muted);
}
.b2m-tool .b2m-step-body { min-width: 0; }

/* The step the reader has to act on next. */
.b2m-tool[data-stage="choose"] [data-step="choose"] .b2m-step-num,
.b2m-tool[data-stage="ready"] [data-step="run"] .b2m-step-num,
.b2m-tool[data-stage="stale"] [data-step="run"] .b2m-step-num,
.b2m-tool[data-stage="busy"] [data-step="run"] .b2m-step-num,
.b2m-tool[data-stage="done"] [data-step="result"] .b2m-step-num {
  background: var(--b2m-amber);
  border-color: var(--b2m-amber);
  color: var(--b2m-amber-ink);
}
.b2m-tool[data-stage="choose"] [data-step="choose"] .b2m-step-title,
.b2m-tool[data-stage="ready"] [data-step="run"] .b2m-step-title,
.b2m-tool[data-stage="stale"] [data-step="run"] .b2m-step-title,
.b2m-tool[data-stage="busy"] [data-step="run"] .b2m-step-title,
.b2m-tool[data-stage="done"] [data-step="result"] .b2m-step-title { color: var(--b2m-ink); }

/* Step 1: drop zone and the files that were picked. */
.b2m-tool .b2m-drop { position: relative; margin: 0; }
.b2m-tool .b2m-drop .b2m-drop-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.b2m-tool .b2m-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 150px;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--b2m-rule-strong);
  border-radius: 12px;
  background: var(--b2m-surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.b2m-tool .b2m-drop:hover .b2m-drop-label,
.b2m-tool .b2m-drop.is-over .b2m-drop-label { border-color: var(--b2m-amber); }
.b2m-tool .b2m-drop-input:focus-visible + .b2m-drop-label { outline: 3px solid var(--b2m-focus); outline-offset: 2px; }
.b2m-tool .b2m-drop-title { font-size: 1.125rem; line-height: 1.4; font-weight: 650; color: var(--b2m-ink); }
.b2m-tool .b2m-drop-hint { font-size: 0.875rem; line-height: 1.5; color: var(--b2m-muted); }

.b2m-tool .b2m-picked {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.b2m-tool .b2m-picked[hidden] { display: none; }
.b2m-tool .b2m-picked > li.b2m-picked-item {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--b2m-rule);
  border-radius: 10px;
  background: var(--b2m-surface-2);
}
.b2m-tool .b2m-picked-item.is-error { border-color: var(--b2m-danger); }
.b2m-tool .b2m-picked-text { display: grid; gap: 0.1rem; min-width: 0; }
.b2m-tool .b2m-picked-name {
  font-family: var(--b2m-mono);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--b2m-ink);
  overflow-wrap: anywhere;
}
.b2m-tool .b2m-picked-meta {
  font-family: var(--b2m-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--b2m-muted);
}
.b2m-tool .b2m-picked-item.is-error .b2m-picked-meta { color: var(--b2m-danger); }
.b2m-tool .b2m-picked-remove {
  flex: none;
  min-height: 36px;
  padding: 0 0.8rem;
  border: 1px solid var(--b2m-rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--b2m-muted);
  font-family: var(--b2m-sans);
  font-size: 0.8125rem;
  font-weight: 550;
  cursor: pointer;
}
.b2m-tool .b2m-picked-remove:hover { color: var(--b2m-ink); border-color: var(--b2m-ink); }

/* Step 2: target size, format and the switches, as one panel. */
.b2m-tool .b2m-options {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--b2m-rule);
  border-radius: 12px;
  background: var(--b2m-surface-2);
}
.b2m-tool .b2m-fields--compress { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.b2m-tool .b2m-options .b2m-presets { margin: 1rem 0; }
.b2m-tool .b2m-presets button[aria-pressed="true"] {
  background: var(--b2m-amber);
  border-color: var(--b2m-amber);
  color: var(--b2m-amber-ink);
}
.b2m-tool .b2m-checks { display: grid; gap: 0.6rem; }
.b2m-tool .b2m-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--b2m-rule);
  border-radius: 10px;
  background: var(--b2m-paper);
  font-family: var(--b2m-sans);
  cursor: pointer;
}
.b2m-tool .b2m-check:hover { border-color: var(--b2m-rule-strong); }
.b2m-tool .b2m-check:focus-within { border-color: var(--b2m-amber); }
/* The generic field style must never reach a checkbox: it made a full-width 48px box. */
.b2m-tool .b2m-check input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0.15rem 0 0;
  padding: 0;
  accent-color: var(--b2m-amber);
}
.b2m-tool .b2m-check-text { display: grid; gap: 0.15rem; min-width: 0; flex: 1 1 0; }
.b2m-tool .b2m-check-label {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--b2m-ink);
  overflow-wrap: anywhere;
}
.b2m-tool .b2m-check-note {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--b2m-muted);
  overflow-wrap: anywhere;
}
.b2m-tool .b2m-options .b2m-hint { margin: 0.9rem 0 0; }

/* Step 3: the one button that starts the work. */
.b2m-tool .b2m-run { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.b2m-tool .b2m-run-button {
  min-height: 48px;
  padding: 0 1.5rem;
  font-size: 1rem;
}
/* Inert rather than dimmed amber, so a disabled button does not read as the next action. */
.b2m-tool .b2m-run-button[disabled] {
  background: var(--b2m-surface-2);
  border-color: var(--b2m-rule-strong);
  color: var(--b2m-muted);
  cursor: not-allowed;
}
.b2m-tool .b2m-run-button[aria-busy="true"] { cursor: progress; }
.b2m-tool .b2m-run .b2m-reset { margin-top: 0; }
.b2m-tool .b2m-reset[hidden] { display: none; }
.b2m-tool .b2m-run-note {
  margin: 0.75rem 0 0;
  font-family: var(--b2m-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--b2m-muted);
}
.b2m-tool[data-stage="stale"] .b2m-run-note { color: var(--b2m-amber-text); }

/* Step 4: results, one card per file. */
.b2m-tool .b2m-result-empty {
  margin: 0;
  font-family: var(--b2m-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--b2m-muted);
}
.b2m-tool .b2m-result-empty[hidden] { display: none; }
.b2m-tool .b2m-again { margin-top: 1rem; min-height: 44px; }
.b2m-tool .b2m-again[hidden] { display: none; }

.b2m-tool .b2m-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.b2m-tool .b2m-files:empty { display: none; }
.b2m-tool .b2m-files > li.b2m-file {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--b2m-rule);
  border-radius: 12px;
  background: var(--b2m-surface-2);
}
.b2m-tool .b2m-file p { margin: 0; }
.b2m-tool .b2m-file-name {
  font-family: var(--b2m-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--b2m-ink);
  overflow-wrap: anywhere;
}
.b2m-tool .b2m-file-status { font-family: var(--b2m-sans); font-size: 1rem; line-height: 1.5; }
.b2m-tool .b2m-file-status.is-busy { color: var(--b2m-muted); }
.b2m-tool .b2m-file-status.is-ok { color: var(--b2m-teal); font-weight: 600; }
.b2m-tool .b2m-file-status.is-warn { color: var(--b2m-amber-text); font-weight: 600; }
.b2m-tool .b2m-file-status.is-error { color: var(--b2m-danger); font-weight: 600; }

.b2m-tool .b2m-file-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--b2m-rule);
}
.b2m-tool .b2m-file-stats > div { min-width: 0; }
.b2m-tool .b2m-file-stats dt {
  font-family: var(--b2m-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--b2m-muted);
}
.b2m-tool .b2m-file-stats dd {
  margin: 0.2rem 0 0;
  font-family: var(--b2m-mono);
  font-size: 1.0625rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--b2m-ink);
  overflow-wrap: anywhere;
}
.b2m-tool .b2m-file-stats > div:nth-child(3) dd { color: var(--b2m-amber-text); font-weight: 600; }
.b2m-tool .b2m-file-detail {
  font-family: var(--b2m-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--b2m-muted);
  overflow-wrap: anywhere;
}
.b2m-tool .b2m-file-preview {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  margin: 0;
  justify-self: start;
  border-radius: 8px;
  border: 1px solid var(--b2m-rule);
  background: #fff;
}
.b2m-tool a.b2m-file-download {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 1.3rem;
  border: 0;
  border-radius: 999px;
  background: var(--b2m-amber);
  color: var(--b2m-amber-ink);
  font-family: var(--b2m-sans);
  font-weight: 650;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
}
.b2m-tool a.b2m-file-download:hover { background: var(--b2m-amber-deep); color: var(--b2m-amber-ink); }
.b2m-tool a.b2m-file-download:focus-visible { outline: 2px solid var(--b2m-focus); outline-offset: 2px; }

.b2m-tool .b2m-run-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--b2m-rule-strong);
  overflow: hidden;
}
.b2m-tool .b2m-run-bar[hidden] { display: none; }
.b2m-tool .b2m-run-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--b2m-amber);
  transition: width 0.25s ease;
}
.b2m-tool .b2m-run-bar.is-indeterminate span {
  width: 35%;
  animation: b2m-run-bar-slide 1.1s ease-in-out infinite;
}
@keyframes b2m-run-bar-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

@media (min-width: 560px) {
  /* A rail down the left edge ties the four steps together. */
  .b2m-tool .b2m-step-body {
    margin-left: 13px;
    padding-left: 1.4rem;
    border-left: 1px solid var(--b2m-rule);
    padding-bottom: 0.5rem;
  }
  .b2m-tool .b2m-steps > li.b2m-step:last-child .b2m-step-body { border-left-color: transparent; }
  .b2m-tool .b2m-file-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .b2m-tool .b2m-fields--compress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .b2m-tool .b2m-drop-label { transition: none; }
  .b2m-tool .b2m-run-bar span { transition: none; }
  .b2m-tool .b2m-run-bar.is-indeterminate span { animation: none; width: 100%; opacity: 0.45; }
}
