.bto-tool {
  --bto-ink: #eeeefb;
  --bto-subtle: #b9c3da;
  --bto-gold: #f8d49a;
  --bto-border: #718299;
  --bto-field: #111b2d;
  box-sizing: border-box;
  color-scheme: dark;
  margin: 1.25rem 0;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid #58637c;
  border-radius: 1.15rem;
  background: radial-gradient(ellipse at 98% 0, #3f3555 0%, transparent 53%), #171e31;
  color: var(--bto-ink);
  font: 1rem/1.62 system-ui, sans-serif;
}

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

.bto-tool .bto-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bto-tool h2, .bto-tool h3 {
  margin: 0;
  color: var(--bto-ink);
  line-height: 1.2;
}

.bto-tool h2 { font-size: clamp(1.35rem, 4vw, 1.85rem); }
.bto-tool h3 { font-size: 1.15rem; }

.bto-tool :is(.bto-intro, .bto-note) {
  max-width: 65ch;
  margin: .6rem 0 1rem;
  color: var(--bto-subtle);
}

.bto-tool .bto-note { margin: .9rem 0 0; font-size: .875rem; }
.bto-tool .bto-fieldset { width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }

.bto-tool .bto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 1rem;
}

.bto-tool label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .45rem;
  font-weight: 650;
}

.bto-tool small { color: var(--bto-subtle); font-size: .825rem; font-weight: 400; }

.bto-tool input, .bto-tool button {
  min-height: 2.75rem;
  padding: .55rem .8rem;
  border: 1px solid var(--bto-border);
  border-radius: .5rem;
  background: var(--bto-field);
  color: var(--bto-ink);
  font: inherit;
  line-height: 1.25;
}

.bto-tool input { display: block; min-width: 0; width: 100%; }
.bto-tool input::placeholder { color: #a8b5ce; }
.bto-tool button { cursor: pointer; }
.bto-tool button:hover { border-color: var(--bto-gold); }
.bto-tool button:disabled { cursor: default; }
.bto-tool :is(input, button):focus-visible { outline: 3px solid var(--bto-gold); outline-offset: 3px; }

.bto-tool .bto-actions, .bto-tool .bto-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: 1rem;
}

.bto-tool .bto-primary {
  border-color: var(--bto-gold);
  background: var(--bto-gold);
  color: #211d28;
  font-weight: 725;
}

.bto-tool .bto-primary:hover { background: #ffe5bd; }
.bto-tool .bto-examples { color: var(--bto-subtle); font-size: .875rem; }
.bto-tool .bto-examples button { border-radius: 1.5rem; }

.bto-tool .bto-result {
  margin-top: 1.2rem;
  padding: 1rem;
  border-left: 3px solid var(--bto-gold);
  border-radius: .5rem;
  background: var(--bto-field);
  overflow-wrap: anywhere;
}

.bto-tool .bto-result:empty { margin: 0; padding: 0; border: 0; }
.bto-tool .bto-result p { margin: .45rem 0 0; color: var(--bto-subtle); }
.bto-tool .bto-instances { display: grid; gap: .65rem; margin: .85rem 0 0; padding: 0; list-style: none; }
.bto-tool .bto-instances li { display: grid; gap: .12rem; }
.bto-tool .bto-instances time { font: 600 1rem/1.35 ui-monospace, monospace; color: var(--bto-gold); }
.bto-tool .bto-instances span { color: var(--bto-subtle); font-size: .9rem; }
