/* The link in bio, QR code and bio tools (src/tools/widgets.ts, tools-a.js). Built on site.css and tools.css. */
.ta-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ta-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.ta-check input { width: auto; flex: none; margin-top: 3px; min-height: 0; accent-color: var(--accent); }
[data-qr-tool] [hidden], [data-bio-tool] [hidden], .tool [hidden] { display: none !important; }
.tool.is-busy [data-run] { opacity: .7; cursor: progress; }

/* QR code maker: controls on the left, the code and its downloads on the right (stacked on phones, code first). */
.qrt { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 8px; }
.qrt-controls { display: grid; gap: 16px; padding: 20px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.qrt-pane { display: grid; gap: 12px; }
.qrt-check { align-self: end; padding-bottom: 10px; }
.qrt-inks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qrt-ink { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.qrt-ink input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.qrt-dot { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: box-shadow .15s ease, transform .15s ease; }
.qrt-dot-custom { background: conic-gradient(#e11d48, #f59e0b, #16a34a, #0ea5e9, #6d28d9, #e11d48); }
.qrt-ink:hover .qrt-dot { transform: scale(1.06); }
.qrt-ink:has(input:checked) .qrt-dot { box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--accent); }
.qrt-ink:has(input:focus-visible) .qrt-dot { outline: 2px solid var(--accent); outline-offset: 4px; }
.qrt-picker { width: 40px; height: 32px; padding: 0 2px; border: 1px solid var(--line-control, var(--line)); border-radius: 8px; background: var(--bg-input); cursor: pointer; }
.qrt-ink-note { margin: -4px 0 0; min-height: 0; }
.qrt-ink-note:empty { display: none; }
.qrt-stage { position: sticky; top: 84px; display: grid; gap: 12px; min-width: 0; }
.qrt-frame { aspect-ratio: 1; padding: 14px; background: #ffffff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 24px 48px -28px rgba(0, 0, 0, .45); }
.qrt-frame > svg { display: block; width: 100%; height: 100%; }
.qrt-target { margin: 0; text-align: center; color: var(--text-dim); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qrt-target.is-error { color: #d64545; font-weight: 600; }
.qrt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qrt-actions [data-dl=png] { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.qrt-size { margin: 0; }
.qrt-status { margin: 0; text-align: center; }

/* Grader: a ring with the score, then the checks, then the way out. */
.grade-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.grade-ring { --p: 0; --c: #2f9e6a; position: relative; flex: none; display: grid; place-items: center; align-content: center; width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.grade-ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-panel); }
.grade-ring > * { position: relative; }
.grade-ring output { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.grade-ring span { font-size: 11px; color: var(--text-faint); }
.grade-ring[data-grade=C] { --c: #d08a12; }
.grade-ring[data-grade=D], .grade-ring[data-grade=F] { --c: #d64545; }
.grade-letter { margin: 0; font-size: 20px; font-weight: 700; }
.grade-head p.dim { margin: 2px 0 0; }
.grade-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); }
.grade-cta p { margin: 2px 0 0; }
.grade-cta .btn { flex: none; }

/* Broken link checker */
.lc-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lc-chip { display: inline-flex; align-items: baseline; gap: 2px; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; background: var(--bg-raised); border: 1px solid var(--line); }
.lc-chip b { font-variant-numeric: tabular-nums; }
.lc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lc-row { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); }
.lc-main { display: grid; gap: 2px; min-width: 0; }
.lc-url { color: var(--text-dim); overflow-wrap: anywhere; text-decoration: none; }
.lc-url:hover { text-decoration: underline; }
.lc-state { justify-self: start; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lc-pass { color: #237a52; background: rgba(47, 158, 106, .14); }
.lc-warn { color: #9a650a; background: rgba(208, 138, 18, .16); }
.lc-fail { color: #c03636; background: rgba(214, 69, 69, .14); }
.lc-idle { color: var(--text-dim); background: var(--bg-input); }
.lc-chip.lc-pass, .lc-chip.lc-warn, .lc-chip.lc-fail, .lc-chip.lc-idle { border-color: transparent; }

/* Link preview checker: one mock per app, from the same fields. */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 6px 0 22px; }
.sp-card { margin: 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
.sp-app { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.sp-img { position: relative; aspect-ratio: 1.91 / 1; overflow: hidden; background: var(--bg-input); }
.sp-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-img.is-missing::after { content: 'No image'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--text-faint); }
.sp-meta { display: grid; gap: 2px; padding: 10px 12px; min-width: 0; font-size: 13px; }
.sp-meta strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.sp-meta span { color: var(--text-dim); overflow-wrap: anywhere; }
.sp-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-bubble { overflow: hidden; border-radius: 18px; background: #e9e9eb; color: #111; max-width: 300px; }
.sp-bubble .sp-meta span { color: #6b6b70; }
.sp-x { overflow: hidden; border: 1px solid var(--line-strong, var(--line)); border-radius: 16px; }
.sp-x .sp-img { border-radius: 0; }
.sp-x-host { position: absolute; left: 10px; bottom: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; }
.sp-x-title { display: block; padding: 6px 4px 0; font-size: 13px; color: var(--text-dim); }
.sp-x-small { display: grid; grid-template-columns: 110px minmax(0, 1fr); }
.sp-x-small .sp-thumb { aspect-ratio: 1; height: 100%; }
.sp-fb { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-raised); }
.sp-upper { text-transform: uppercase; font-size: 11.5px; letter-spacing: .02em; }
.sp-li { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); }
.sp-slack { display: grid; gap: 4px; padding: 2px 0 2px 12px; border-left: 4px solid var(--line-strong, var(--line)); font-size: 13.5px; min-width: 0; }
.sp-slack-site { display: flex; align-items: center; gap: 6px; }
.sp-slack-site img { border-radius: 3px; }
.sp-slack-title { color: #1d6fb8; font-weight: 700; overflow-wrap: anywhere; }
.sp-slack .sp-clamp { color: var(--text-dim); }
.sp-slack-img { max-width: 300px; border-radius: 8px; margin-top: 4px; }
.sp-h { font-size: 17px; margin: 0 0 10px; }
.sp-tags { margin-top: 16px; }
.sp-tags summary { cursor: pointer; font-weight: 600; }
.sp-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.sp-table th, .sp-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.sp-table th { width: 34%; font-family: var(--mono); font-weight: 500; color: var(--text-dim); }

/* Bio formatter: the editor, and a phone-style profile beside it. */
.bio-tool { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 8px; }
.bio-form textarea { width: 100%; min-height: 150px; resize: vertical; font: inherit; line-height: 1.5; }
.bio-form [data-count].is-over { color: #d64545; font-weight: 700; }
.bio-meter { height: 6px; border-radius: 999px; background: var(--bg-input); overflow: hidden; margin-top: -6px; }
.bio-meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .15s ease; }
.bio-meter.is-over span { background: #d64545; }
.bio-actions { display: flex; align-items: center; gap: 12px; }
.bio-phone { position: sticky; top: 84px; margin: 0; padding: 22px 18px 16px; border-radius: 28px; background: #ffffff; color: #111111; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 24px 48px -28px rgba(0, 0, 0, .45); }
.bio-phone-top { display: flex; align-items: center; gap: 18px; }
.bio-avatar { flex: none; width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); padding: 3px; box-shadow: inset 0 0 0 3px #fff; }
.bio-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; font-size: 12px; color: #444; }
.bio-stats b { display: block; font-size: 15px; color: #111; }
.bio-name { margin: 12px 0 2px; font-weight: 700; font-size: 14px; }
.bio-text { margin: 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bio-link { display: flex; align-items: center; gap: 4px; margin: 4px 0 12px; font-size: 14px; font-weight: 600; color: #00376b; }
.bio-phone figcaption { text-align: center; color: #6b6b70; }

@media (max-width: 980px) {
  .qrt, .bio-tool { grid-template-columns: minmax(0, 1fr); }
  .qrt-stage { position: static; order: -1; max-width: 420px; width: 100%; margin-inline: auto; }
  .bio-phone { position: static; max-width: 380px; width: 100%; margin-inline: auto; }
}
@media (max-width: 560px) {
  .qrt-controls { padding: 16px; }
  .grade-cta { flex-direction: column; align-items: stretch; }
  .grade-head { gap: 14px; }
  .lc-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
