/* BIMI Validator and Builder (/tools/bimi/). Builds on tools.css (form,
   cards, grid) and uses only tokens from tokens.css. */

.bimi-optional { font-weight: var(--weight-body); color: var(--txt-3); }
.bimi-help { margin: 12px 0 0; color: var(--txt-3); font-size: var(--text-small); line-height: 1.6; }
.bimi-message { min-height: 1.5em; margin: 16px 0 0; color: var(--txt-2); }
.bimi-results { margin-top: 24px; }

/* Summary: logo previews beside the verdict */
.bimi-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 20px; }
.bimi-summary-text { flex: 1 1 280px; min-width: 0; }
.bimi-summary-text h2 { margin: 0 0 8px; font-size: var(--text-h2); overflow-wrap: anywhere; }
.bimi-verdict { margin: 0 0 6px; font-weight: 600; line-height: 1.5; }
.bimi-verdict--pass { color: var(--green); }
.bimi-verdict--warn { color: var(--amber); }
.bimi-verdict--fail { color: var(--red); }
.bimi-meta { margin: 0; color: var(--txt-3); font-size: var(--text-small); }
.bimi-previews { display: flex; gap: 20px; flex-wrap: wrap; }
.bimi-previews[hidden] { display: none; }
.bimi-preview { margin: 0; display: grid; gap: 8px; justify-items: center; }
.bimi-preview-frames { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface2); }
.bimi-logo { width: 64px; height: 64px; object-fit: contain; background: #ffffff; border: 1px solid var(--border); }
.bimi-logo--circle { border-radius: 50%; }
.bimi-logo--square { border-radius: 14px; }
.bimi-preview figcaption { font-size: var(--text-caption); color: var(--txt-3); }

/* Sections and their checks */
.bimi-card h3 { align-items: center; }
.bimi-name { display: block; margin: 0 0 10px; color: var(--txt-2); font-size: var(--text-compact); overflow-wrap: anywhere; }
.bimi-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-caption); font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface2); color: var(--txt); white-space: nowrap; }
.bimi-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--txt-3); flex: none; }
.bimi-chip--pass::before { background: var(--green); }
.bimi-chip--warn::before { background: var(--amber); }
.bimi-chip--fail::before { background: var(--red); }
.bimi-checks { list-style: none; margin: 12px 0 0; padding: 0; }
.bimi-check { padding: 12px 0; border-top: 1px solid var(--border); }
.bimi-check-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bimi-check-head strong { font-size: var(--text-small); color: var(--txt); }
.bimi-check-detail, .bimi-check-fix { margin: 6px 0 0; font-size: var(--text-small); line-height: 1.6; color: var(--txt-2); overflow-wrap: anywhere; }
.bimi-check-fix { color: var(--txt-3); }
.bimi-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 8px; font-size: var(--text-small); }
.bimi-facts dt { color: var(--txt-3); }
.bimi-facts dd { margin: 0; color: var(--txt); overflow-wrap: anywhere; }

/* Builder */
.bimi-builder h2 { margin: 0; font-size: var(--text-h3); }
.bimi-builder-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.bimi-builder-form select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--txt); font: inherit; }
.bimi-wide { grid-column: 1 / -1; }
.bimi-toggle input { width: auto; margin: 0; }
.bimi-toggle label { display: flex; gap: 8px; align-items: center; font-weight: var(--weight-body); margin: 0; }
.bimi-toggle.email-field { align-self: end; padding-bottom: 12px; }
.bimi-output { display: grid; gap: 12px; margin-top: 20px; }
.bimi-output-row pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface2); padding: 12px; border-radius: 8px; font-family: var(--font-mono); font-size: var(--text-compact); color: var(--txt); }
.bimi-output-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bimi-output-label { font-weight: 600; font-size: var(--text-small); }
.bimi-copy { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--primary-ink); font: inherit; font-size: var(--text-compact); font-weight: 600; cursor: pointer; }
.bimi-copy:hover { border-color: var(--primary); }
.bimi-problems { margin: 0; color: var(--red); font-size: var(--text-small); line-height: 1.6; }
.bimi-subtitle { margin: 28px 0 0; font-size: var(--text-card-title); }
.bimi-svg-output { margin-top: 12px; }
.bimi-svg-output .bimi-preview { justify-items: start; margin: 12px 0; }
.bimi-svg-summary { margin: 12px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.bimi-builder input[type="file"] { font: inherit; color: var(--txt-2); max-width: 100%; }

/* About */
.bimi-about { margin-top: 40px; }
.bimi-about h2 { font-size: var(--text-h2); }
.bimi-about code { overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .bimi-builder-form { grid-template-columns: 1fr; }
  .bimi-summary { padding: 18px; }
}
