/* ==========================================================================
   Logo to Brand Style Guide Generator — tool page only
   Uses the design tokens from main.css, so both themes work automatically.
   ========================================================================== */

.bs [hidden], .bs-guide-section[hidden], .bs-guide [hidden] { display: none !important; }

/* Input pane */
.bs-stage { display: flex; flex-direction: column; gap: 0.5rem; }
.bs-preview {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: repeating-conic-gradient(rgba(var(--ink), 0.07) 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}
.bs-preview img { display: block; max-width: 100%; max-height: 220px; width: auto; height: auto; }
.bs-meta { margin-top: 0; overflow-wrap: anywhere; }
.bs-bgnote, .bs-privacy { margin: -0.5rem 0 0; line-height: 1.5; }
.bs-privacy { display: flex; gap: 0.45rem; align-items: flex-start; margin-top: 0; }
.bs-privacy .icon { flex: none; width: 15px; height: 15px; margin-top: 0.15rem; color: var(--success); }
.bs-note { margin: 0; padding: 0.6rem 0.8rem; border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 10px; background: rgba(245, 158, 11, 0.08); color: var(--text-2); }

/* Detected colours strip */
.bs-detected { display: flex; height: 26px; margin-top: 0.5rem; overflow: hidden; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border); }
.bs-det { flex: 1 1 0; min-width: 10px; background: var(--c); }

/* Role editors */
.bs-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 1100px) and (min-width: 961px) { .bs-roles { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .bs-roles { grid-template-columns: 1fr; } }
.bs-role {
  display: flex;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.bs-swatch {
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(var(--ink), 0.16);
  cursor: pointer;
}
.bs-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.bs-swatch:focus-within { outline: 2px solid var(--lilac); outline-offset: 2px; }
.bs-role-main { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; flex: 1; }
.bs-role-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.5rem; }
.bs-role-name { color: var(--text); font-size: 0.88rem; font-weight: 700; }
.bs-role-tag { color: var(--muted); font-size: 0.72rem; }
.bs-hex.input { padding: 0.35rem 0.6rem; font: 600 0.85rem/1.3 var(--font-mono); text-transform: uppercase; }
.bs-hex[aria-invalid="true"] { border-color: var(--danger); }
.bs-dots { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bs-dot {
  width: 18px; height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(var(--ink), 0.25);
  cursor: pointer;
  transition: transform 0.15s;
}
.bs-dot:hover { transform: scale(1.18); }
.bs-dot:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* Guide section */
.bs-guide-section { padding-top: clamp(20px, 3vw, 32px); }
.bs-guide {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--radius-xl);
}
.bs-tabs { flex-wrap: wrap; max-width: 100%; border-radius: 18px; }
.bs-panel { min-width: 0; }
.bs-panel:focus-visible { outline: 2px solid var(--lilac); outline-offset: 4px; border-radius: 8px; }
.bs-h { margin: 1.4rem 0 0.7rem; font-size: 1.05rem; letter-spacing: -0.01em; }
.bs-panel > .bs-h:first-child { margin-top: 0.25rem; }
.bs-p { margin: -0.3rem 0 0.8rem; line-height: 1.55; }

/* Colour cards */
.bs-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 0.5rem; padding: 0; list-style: none; }
@media (max-width: 900px) { .bs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bs-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.bs-card-sw {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem;
  width: 100%; min-height: 86px;
  padding: 0.65rem 0.75rem;
  border: 0;
  font: 700 0.92rem/1.2 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.bs-card-sw:focus-visible { outline: 3px solid var(--lilac); outline-offset: -3px; }
.bs-card-aa { font-size: 0.72rem; font-weight: 600; opacity: 0.9; }
.bs-card-vals { display: flex; flex-direction: column; align-items: flex-start; padding: 0.4rem 0.4rem 0.5rem; }
.bs-val {
  max-width: 100%;
  padding: 0.12rem 0.35rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font: 0.76rem/1.45 var(--font-mono);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.bs-val:hover { color: var(--text); background: var(--surface-3); }
.bs-val-hex { color: var(--text); font-weight: 700; font-size: 0.86rem; }

/* Scales */
.bs-scale { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.bs-scale-name { margin: 0; color: var(--text); font-size: 0.86rem; font-weight: 600; }
.bs-steps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.bs-step {
  display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; min-height: 58px;
  padding: 0.4rem 0.35rem;
  border: 0;
  font: 0.62rem/1.25 var(--font-mono);
  text-align: left;
  cursor: pointer;
}
.bs-step b { font: 700 0.74rem/1.2 var(--font-body); }
.bs-step.is-base { box-shadow: inset 0 0 0 3px currentColor; }
.bs-step:focus-visible { outline: 3px solid var(--lilac); outline-offset: -3px; }
@media (max-width: 700px) {
  .bs-scale { grid-template-columns: 1fr; gap: 0.35rem; }
  .bs-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Contrast matrix */
.bs-mx-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.bs-mx-wrap:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.bs-mx { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.8rem; }
.bs-mx th, .bs-mx td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; vertical-align: middle; }
.bs-mx thead th { background: var(--surface-2); color: var(--text); font-weight: 600; white-space: nowrap; }
.bs-mx tbody th { color: var(--text); font-weight: 600; white-space: nowrap; }
.bs-mx tr > :last-child { border-right: 0; }
.bs-mx tbody tr:last-child > * { border-bottom: 0; }
.bs-chip { display: inline-block; width: 12px; height: 12px; margin-right: 0.4rem; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(var(--ink), 0.3); vertical-align: -1px; }
.bs-mx-sample { display: inline-grid; place-items: center; width: 34px; height: 26px; margin-right: 0.4rem; border-radius: 6px; font: 700 0.9rem/1 var(--font-body); box-shadow: inset 0 0 0 1px rgba(var(--ink), 0.12); vertical-align: middle; }
.bs-mx-ratio { color: var(--text); font: 600 0.78rem var(--font-mono); }
.bs-rating { display: block; width: max-content; margin-top: 0.2rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700; }
.bs-mx-na { color: var(--muted); text-align: center !important; }
.is-pass { color: var(--success-text); background: rgba(52, 211, 153, 0.14); }
.is-large { color: var(--warn-text); background: rgba(245, 158, 11, 0.15); }
.is-fail { color: var(--danger-text); background: rgba(251, 113, 133, 0.15); }
.bs-inline { padding: 0.05rem 0.4rem; border-radius: 6px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(var(--ink), 0.15); }
.bs-panel code { font: 0.8rem var(--font-mono); color: var(--text); }

/* Typography */
.bs-suggest-note { display: flex; gap: 0.55rem; margin: 0 0 1rem; padding: 0.75rem 0.9rem; border: 1px solid rgba(139, 92, 246, 0.35); border-radius: 12px; background: var(--grad-soft); color: var(--text-2); font-size: 0.88rem; line-height: 1.5; }
.bs-suggest-note .icon { flex: none; width: 18px; height: 18px; margin-top: 0.1rem; color: var(--lilac); }
.bs-suggest-note b { color: var(--text); }
.bs-type-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 860px) { .bs-type-grid { grid-template-columns: minmax(0, 1fr); } }
.bs-type-card { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.bs-type-card .result-label { margin: 0; }
.bs-type-h { margin: 0; color: var(--text); font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.15; overflow-wrap: anywhere; }
.bs-type-b { margin: 0; color: var(--text-2); font-size: 1rem; line-height: 1.6; }
.bs-type-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; }
.bs-type-meta dt { color: var(--muted); font-size: 0.75rem; }
.bs-type-meta dd { margin: 0; color: var(--text); font-size: 0.88rem; font-weight: 600; }
.bs-type-side { min-width: 0; }
.bs-type-side .result-list li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.bs-alts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.bs-alts .chip-btn { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
.bs-ts { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.bs-ts li { display: flex; align-items: baseline; gap: 1rem; min-width: 0; padding: 0.35rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.bs-ts code { flex: none; width: 170px; color: var(--muted) !important; font-size: 0.74rem !important; }
.bs-ts span { min-width: 0; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .bs-ts li { flex-direction: column; gap: 0.15rem; } .bs-ts span { max-width: 100%; } }

/* Logo usage */
.bs-warns { margin-bottom: 1rem; }
.bs-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0; }
@media (max-width: 760px) { .bs-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bs-facts div { padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.bs-facts dt { color: var(--muted); font-size: 0.75rem; }
.bs-facts dd { margin: 0.1rem 0 0; color: var(--text); font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.bs-usage { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .bs-usage { grid-template-columns: minmax(0, 1fr); } }
.bs-rec .result-list li { font-size: 0.9rem; margin-bottom: 0.55rem; }
.bs-rec a { color: var(--link); }
.bs-clear-demo { padding-top: 1.4rem; min-width: 0; }
.bs-clear {
  display: inline-block;
  max-width: 100%;
  margin: 0.5rem 0;
  padding: var(--pad);
  border: 1.5px dashed var(--lilac);
  border-radius: 8px;
  background: #fff;
}
.bs-clear img { display: block; max-width: 100%; height: 72px; width: auto; object-fit: contain; outline: 1px solid rgba(139, 92, 246, 0.35); }
.bs-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 760px) { .bs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .bs-tiles { grid-template-columns: minmax(0, 1fr); } }
.bs-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 150px;
  margin: 0;
  padding: 1rem;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(var(--ink), 0.12);
}
.bs-tile img { display: block; max-width: 85%; max-height: 70px; width: auto; height: auto; }
.bs-tile figcaption { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; text-align: center; }
.bs-tile-note { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.68rem; }
.bs-tile .is-pass { color: #065f46; background: #d1fae5; }
.bs-tile .is-large { color: #92400e; background: #fef3c7; }
.bs-tile .is-fail { color: #9f1239; background: #ffe4e6; }
.bs-fav { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem; }
.bs-fav figure { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; margin: 0; }
.bs-fav canvas { display: block; background: repeating-conic-gradient(rgba(var(--ink), 0.08) 0 25%, transparent 0 50%) 0 0 / 8px 8px; }
.bs-fav figcaption { color: var(--muted); font-size: 0.75rem; }
.bs-fav-zoom { width: 128px; height: 128px; image-rendering: pixelated; border-radius: 6px; }
.bs-tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  max-width: 220px;
  padding: 0.5rem 0.9rem;
  border-radius: 10px 10px 0 0;
  background: #eef0f5;
  color: #1f2937;
  font: 0.8rem/1.2 Arial, Helvetica, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.bs-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-tab canvas { flex: none; background: none; }

/* Export */
.bs-export-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .bs-export-grid { grid-template-columns: minmax(0, 1fr); } }
.bs-export-head { flex-wrap: wrap; }
.bs-formats label { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.bs-code { max-height: 420px; font-size: 0.78rem; }
.bs-export-actions { margin-top: 0.75rem; }
.bs-doc-card { display: flex; flex-direction: column; gap: 0.85rem; }
.bs-doc-card p { margin: 0; color: var(--text-2); font-size: 0.92rem; line-height: 1.6; }
