/* brand-import module: the "Found on your website" panel. Uses the design tokens from styles.css. */
.bi-panel { position: relative; padding: 20px; border-radius: var(--radius, 18px); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13.5px; }
.bi-panel.bi-enter { animation: bi-in .35s var(--ease) both; }
@keyframes bi-in { from { opacity: 0; transform: translateY(8px); } }
.bi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bi-head h3 { font: var(--title-md); letter-spacing: -.02em; outline: none; }
.bi-head p { margin-top: 3px; color: var(--muted); }
.bi-close { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); transition: background .2s, color .2s; }
.bi-close:hover { background: rgba(29, 27, 24, .06); color: var(--ink); }
.bi-close svg { width: 17px; height: 17px; }

.bi-form { display: flex; gap: 8px; margin-top: 14px; }
.bi-form .input { flex: 1; min-width: 0; height: 40px; padding: 8px 14px; }
.bi-form .btn { height: 40px; }
.bi-live { min-height: 1.3em; margin-top: 6px; font-size: 12.5px; color: var(--green); }
.bi-live:empty { min-height: 0; margin: 0; }

.bi-body { margin-top: 10px; }
.bi-empty { padding: 18px 0 6px; color: var(--muted); }
.bi-summary strong { display: block; font-size: 14.5px; overflow-wrap: anywhere; }
.bi-summary span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.bi-note { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: var(--amber-soft); color: #7a520c; font-size: 12.5px; line-height: 1.45; }
.bi-error { padding: 14px 16px; border-radius: 14px; background: var(--red-soft); border: 1px solid #f6cfc8; }
.bi-error p { margin: 3px 0 10px; color: var(--ink-2); }

/* Loading: a spinner line and a rough outline of what's coming */
.bi-reading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.bi-spinner { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.bi-skel-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.bi-skel { display: block; height: 12px; margin-top: 8px; border-radius: 6px; background: linear-gradient(90deg, #f1ede6 25%, #f8f5f0 50%, #f1ede6 75%) 0 0 / 200% 100%; animation: bi-shimmer 1.4s linear infinite; }
.bi-skel-tile { width: min(112px, calc((100% - 20px) / 3)); height: 88px; margin: 0; border-radius: 14px; }
.bi-skel-dot { width: 44px; height: 44px; margin: 0; border-radius: 12px; }
@keyframes bi-shimmer { to { background-position: -200% 0; } }

.bi-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.bi-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.bi-group-head h4 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.bi-group-head span { font-size: 12.5px; color: var(--faint); }
.bi-group ul { list-style: none; margin: 0; padding: 0; }

.bi-check { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.bi-check:disabled { cursor: not-allowed; }
.bi-tick { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700; }
.bi-mini { height: 28px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
.bi-mini:hover:not(:disabled) { border-color: #d0c8bb; color: var(--ink); }
.bi-mini.is-on { border-color: transparent; background: var(--green-soft); color: var(--green); opacity: 1; }
.bi-link { padding: 0; border: 0; background: none; color: var(--ink-2); font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
.bi-state { font-size: 12.5px; font-weight: 600; color: var(--green); }
.bi-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.is-added { opacity: .72; }

/* Logos: hotlinked previews on a checkerboard so transparent and white logos both show */
.bi-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.bi-logo { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.bi-logo.is-added { opacity: 1; border-color: #bfe3cc; }
.bi-logo-img { position: relative; display: grid; place-items: center; height: 96px; border-radius: 10px; overflow: hidden;
  background: repeating-conic-gradient(#f1ede6 0% 25%, #fff 0% 50%) 50% / 14px 14px; }
.bi-logo-img img { max-width: 88%; max-height: 80px; object-fit: contain; }
.bi-logo-fail { display: none; font-size: 12px; color: var(--faint); }
.bi-logo.is-broken img { display: none; }
.bi-logo.is-broken .bi-logo-fail { display: block; }
.bi-logo-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 12.5px; }
.bi-logo-meta span { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bi-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: auto; }
.bi-logo-actions > span { width: 100%; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.bi-logo-actions .bi-mini { height: 26px; padding: 0 9px; font-size: 12px; }
.bi-added-note { font-size: 12.5px; font-weight: 600; color: var(--green); }
.bi-problem { font-size: 12px; line-height: 1.4; color: var(--red); }
.bi-problem a { color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Colors: a swatch you can tick, with its hex and where the site uses it */
.bi-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.bi-color { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bi-swatch { position: relative; display: block; height: 58px; border-radius: 12px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(29, 27, 24, .1); cursor: pointer; transition: box-shadow .2s, transform .2s var(--ease); }
.bi-color.is-selected .bi-swatch { box-shadow: inset 0 0 0 1px rgba(29, 27, 24, .1), 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.bi-swatch:hover { transform: translateY(-1px); }
.bi-swatch .bi-check, .bi-swatch .bi-tick { position: absolute; top: 7px; left: 7px; }
.bi-color-meta code { display: block; font: 600 12px/1.3 var(--mono); color: var(--ink-2); }
.bi-color-meta span { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-color .bi-mini { align-self: flex-start; height: 26px; }

/* Rows: fonts, words, profiles */
.bi-list { display: flex; flex-direction: column; gap: 6px; }
.bi-font, .bi-text, .bi-profile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.bi-font-meta, .bi-text-body, .bi-profile-meta { flex: 1; min-width: 0; }
.bi-font-sample { display: block; font-size: 20px; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.bi-font-meta > span:last-child, .bi-profile-meta a { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.bi-profile-meta a:hover { color: var(--ink); text-decoration: underline; }
.bi-font-actions { display: flex; gap: 5px; }
.bi-text { align-items: flex-start; }
.bi-text .bi-check, .bi-text .bi-tick { margin-top: 2px; }
.bi-kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.bi-text-body p { margin-top: 2px; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.bi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-chip { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: border-color .2s, color .2s; }
.bi-chip:hover { border-color: var(--line-2); color: var(--ink); }
.bi-chip::after { content: " →"; color: var(--faint); }

/* Add selected stays in reach while scrolling a long list */
.bi-foot { position: sticky; bottom: 0; z-index: 1; display: flex; gap: 8px; margin: 18px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius, 18px) var(--radius, 18px); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }

@media (max-width: 480px) {
  .bi-panel { padding: 16px; }
  .bi-foot { margin: 16px -16px -16px; padding: 12px 16px; }
  .bi-foot .btn-dark { flex: 1; }
  .bi-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bi-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .bi-font { flex-wrap: wrap; }
  .bi-font-actions { width: 100%; padding-left: 30px; }
  .bi-text { flex-wrap: wrap; }
  .bi-text > .bi-mini { margin-left: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .bi-panel, .bi-skel, .bi-spinner { animation: none; }
}
