/* The bio and button tools (src/tools/b-tools.ts, tools/b.js). On top of tools.css and site.css tokens. */
.tool [hidden] { display: none !important; }
.tb-opt { font-weight: 400; font-size: 12px; }
.tb-note { margin: 0; }
.tb-status { margin: 0; min-height: 1.5em; }
.tb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tb-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.tb-check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.tb-checks { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.tb-cta { margin-top: 16px; }

/* Fancy fonts: one tappable row per style. */
.tb-fonts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tb-font {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.tb-font:hover { border-color: var(--accent); }
.tb-font:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tb-font-text { font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.tb-font-copy { font-weight: 600; color: var(--accent); }
.tb-font.tb-copied { border-color: var(--accent); background: var(--accent-soft); }

/* Bios: numbered cards with their length. */
.tb-bios { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; counter-reset: bio; }
.tb-bio { display: grid; gap: 10px; align-content: space-between; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); min-width: 0; }
.tb-bio-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; color: var(--text); }
.tb-bio-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.tb-over { color: var(--danger-fg); font-weight: 600; }

/* Builders: controls beside a sticky preview and the code. */
.tb-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.tb-controls { display: grid; gap: 14px; min-width: 0; }
.tb-out { position: sticky; top: 84px; display: grid; gap: 12px; min-width: 0; }
.tb-preview {
  display: grid; place-items: center; min-height: 140px; padding: 24px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg) radial-gradient(var(--line) 1px, transparent 1px) 0 0 / 16px 16px; overflow: auto;
}
.tb-preview-mail { place-items: start; background: #ffffff; color: #1f1e1d; border-color: var(--line-strong); }
.tb-code { display: grid; gap: 8px; }
.tb-tabs { display: flex; gap: 4px; }
.tb-tab { padding: 6px 12px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tb-tab[aria-selected='true'] { background: var(--bg-raised); border-color: var(--line); color: var(--text); }
.tb-snippet { width: 100%; min-height: 120px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--text); background: var(--bg-input); resize: vertical; }

.tb-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tb-swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 1px solid var(--line-strong); cursor: pointer; }
.tb-swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; min-height: 0; }
.tb-swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--accent); }
.tb-swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.tb-swatch-custom { background: conic-gradient(#e5484d, #f5a524, #46a758, #0091ff, #8e4ec6, #e5484d); overflow: hidden; }
.tb-swatch-custom input[type='color'] { width: 100%; height: 100%; padding: 0; border: 0; }

.tb-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-icon-opt { position: relative; display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line-control); background: var(--bg-input); color: var(--text-dim); cursor: pointer; }
.tb-icon-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; min-height: 0; }
.tb-icon-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.tb-icon-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Profile fields: icon, input, network name. */
.tb-networks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.tb-legend { grid-column: 1 / -1; padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.tb-network { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; min-width: 0; }
.tb-network > svg { grid-column: 1; grid-row: 1; justify-self: center; color: var(--text-dim); z-index: 1; pointer-events: none; }
.tb-network > input { grid-column: 1 / -1; grid-row: 1; padding-left: 36px; min-width: 0; }
.tb-network-name { grid-column: 1 / -1; padding: 2px 0 0 2px; font-size: 11.5px; }

.tb-more { grid-column: 1 / -1; }
.tb-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.tb-more > .tb-networks { margin-top: 8px; }

/* Link in bio ideas: niche chips, then the lists. */
.tb-niches { margin: 0; justify-content: flex-start; max-width: none; }
.tb-niche { position: relative; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-control); background: var(--bg-raised); font-size: 13.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.tb-niche input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; min-height: 0; }
.tb-niche:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.tb-niche:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tb-ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.tb-idea-group { padding: 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); min-width: 0; }
.tb-idea-group p { margin: 4px 0 10px; }
.tb-idea-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-idea-h { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.tb-idea-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.45; }
.tb-idea-list strong { display: block; color: var(--text); }

@media (max-width: 860px) {
  .tb-builder { grid-template-columns: minmax(0, 1fr); }
  .tb-out { position: static; }
  .tb-bios { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .tb-font { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .tb-font-name { grid-column: 1 / -1; }
  .tb-networks { grid-template-columns: minmax(0, 1fr); }
  .tb-network-name { display: none; }
  /* Five tones do not fit one row on a phone: they wrap, three to a row. */
  .tool .rc-seg { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .tb-preview { padding: 18px 12px; }
}
