/*!
 * 123PhotoTool — Brand Color Palettes: a sticky search and category bar over
 * a grid of brand cards. Every code is on its swatch (no hover needed), a tap
 * copies it. Uses the shared tokens from pt-ui.css.
 */
.bc-page { --bc-top: 0px; }
.bc-page [hidden] { display: none !important; }

/* ── The bar: search, copy format, categories. Sticks under the site header. */
.bc-bar {
  position: sticky;
  top: var(--bc-top);
  z-index: 1010;
  margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  padding: 10px calc(var(--bs-gutter-x, 1.5rem) * 0.5) 8px;
  background: var(--bs-light, #fefefe);
  transition: top 0.25s ease, box-shadow 0.2s ease;
}
.bc-bar.bc-stuck { box-shadow: 0 6px 12px -8px rgba(30, 34, 40, 0.25); }
.bc-bar-row { display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 0 auto; }
.bc-search { position: relative; flex: 1 1 auto; min-width: 0; }
.bc-search .form-control {
  height: 48px;
  padding-inline: 44px 44px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #fff;
  border: 1px solid var(--pt-line, #e3e7ee);
}
/* No clear button while empty: give its room to the placeholder. */
.bc-search .form-control:placeholder-shown { padding-inline-end: 16px; }
.bc-search .form-control::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.bc-search .form-control:focus { border-color: var(--pt-accent, #0f70e6); box-shadow: 0 0 0 3px rgba(15, 112, 230, 0.15); }
.bc-search-icon {
  position: absolute; inset-inline-start: 16px; top: 50%;
  width: 18px; height: 18px; margin-top: -9px;
  color: var(--pt-muted, #6c757d); pointer-events: none;
}
.bc-clear {
  position: absolute; inset-inline-end: 4px; top: 50%;
  width: 40px; height: 40px; margin-top: -20px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--pt-muted, #6c757d);
}
.bc-clear:hover { background: var(--pt-surface, #f6f8fb); color: var(--pt-ink, #343f52); }
.bc-clear svg { width: 22px; height: 22px; }
.bc-format { display: flex; align-items: center; gap: 8px; margin: 0; flex: none; }
.bc-format-label { font-size: 0.75rem; color: var(--pt-muted, #6c757d); white-space: nowrap; }
.bc-format .form-select { height: 48px; width: auto; min-width: 100px; padding-block: 0; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--pt-ink, #343f52); background-color: #fff; border-color: var(--pt-line, #e3e7ee); }

/* Categories: one scrolling row, most brands first, with arrows on a mouse. */
.bc-cats-wrap { position: relative; margin-top: 10px; }
.bc-cats {
  display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 2px;
  scroll-padding-inline: 48px;
}
.bc-cats::-webkit-scrollbar { display: none; }
.bc-cats.bc-fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.bc-cats.bc-fade-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.bc-cats.bc-fade-start.bc-fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.bc-cat {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--pt-line, #e3e7ee); border-radius: 999px;
  background: #fff; color: var(--pt-ink, #343f52);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.bc-cat:hover { border-color: var(--pt-accent, #0f70e6); color: var(--pt-accent, #0f70e6); }
.bc-cat.active { background: var(--pt-accent, #0f70e6); border-color: var(--pt-accent, #0f70e6); color: #fff; }
.bc-cat-n { font-size: 0.65rem; font-weight: 600; opacity: 0.65; }
.bc-cat.bc-cat-none:not(.active) { opacity: 0.5; }
.bc-cat:focus-visible, .bc-sw:focus-visible, .bc-act:focus-visible, .bc-clear:focus-visible { outline: 3px solid var(--pt-accent, #0f70e6); outline-offset: 2px; }
.bc-cats-arrow {
  position: absolute; top: 2px; z-index: 1;
  width: 40px; height: 40px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--pt-line, #e3e7ee); border-radius: 50%;
  background: #fff; color: var(--pt-ink, #343f52);
  box-shadow: 0 2px 6px rgba(30, 34, 40, 0.12);
}
.bc-cats-arrow svg { width: 16px; height: 16px; }
.bc-cats-arrow:hover { color: var(--pt-accent, #0f70e6); }
.bc-cats-prev { inset-inline-start: 0; }
.bc-cats-next { inset-inline-end: 0; }
[dir="rtl"] .bc-cats-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .bc-cats.bc-fade-end { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
[dir="rtl"] .bc-cats.bc-fade-start { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
@media (hover: none) { .bc-cats-arrow { display: none !important; } }

.bc-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  margin: 14px 0 12px; font-size: 0.75rem; color: var(--pt-muted, #6c757d);
}
#bc-count { font-weight: 600; color: var(--pt-ink, #343f52); }

/* ── The cards ──────────────────────────────────────────────────────────── */
.bc-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
[dir="rtl"] .bc-grid { padding: 0; }
.bc-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--pt-line, #e3e7ee);
  border-radius: var(--pt-radius, 16px);
  padding: 14px;
  min-width: 0;
  container: bc-card / inline-size;
  content-visibility: auto;
  contain-intrinsic-size: auto 191px;
}
.bc-card[hidden] { display: none; }
.bc-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin-bottom: 10px; }
.bc-name { font-size: 0.95rem; font-weight: 700; margin: 0; color: var(--pt-ink, #343f52); min-width: 0; overflow-wrap: anywhere; }
.bc-tag { margin-inline-start: auto; flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.7rem; color: var(--pt-muted, #6c757d); }

.bc-sws {
  display: grid; gap: 6px;
  grid-template-columns: repeat(var(--k, 3), minmax(0, 1fr));
}
.bc-sws[data-k="2"] { --k: 2; }
.bc-sws[data-k="4"] { --k: 4; }
.bc-sws[data-k="5"] { --k: 5; }
.bc-sws[data-k="6"] { --k: 6; }
.bc-sw {
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  height: 72px; min-width: 0; padding: 0 2px 7px;
  border: 0; border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(30, 34, 40, 0.1);
  color: #1e2228;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.bc-sw.bc-on-dark { color: #fff; }
.bc-code {
  font: 600 0.7rem/1 var(--bs-font-monospace, ui-monospace, Menlo, Consolas, monospace);
  letter-spacing: -0.02em;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  max-width: 100%;
}
@media (hover: hover) { .bc-sw:hover { transform: translateY(-2px); } }
.bc-sw::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 22px; height: 22px; top: -18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}
.bc-sw.bc-done::after { opacity: 1; transform: none; }
/* Six codes (or five on a small phone) do not fit across a card: rows of three. */
@container bc-card (max-width: 400px) {
  .bc-sws[data-k="6"] { --k: 3; }
  .bc-sws[data-k="6"] .bc-sw { height: 52px; }
}
@container bc-card (max-width: 320px) {
  .bc-sws[data-k="5"] { --k: 3; }
  .bc-sws[data-k="5"] .bc-sw { height: 52px; }
}
@supports not (container-type: inline-size) {
  .bc-sws[data-k="6"] { --k: 3; }
}

.bc-foot { display: flex; gap: 8px; margin-top: 12px; }
.bc-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 4px 10px; flex: 1 1 0; min-width: 0;
  border: 1px solid var(--pt-line, #e3e7ee); border-radius: 10px;
  background: #fff; color: var(--pt-ink, #343f52);
  font-size: 0.75rem; font-weight: 600; line-height: 1.15; text-decoration: none; text-align: center;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.bc-act:hover { border-color: var(--pt-accent, #0f70e6); color: var(--pt-accent, #0f70e6); }
.bc-act::before {
  content: ""; flex: none; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--bc-icon) center / contain no-repeat; mask: var(--bc-icon) center / contain no-repeat;
}
.bc-copy-all { --bc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z'/%3E%3Cpath d='M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z'/%3E%3C/svg%3E"); }
.bc-copy-all.bc-done { --bc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E"); color: #2f9e7e; border-color: #2f9e7e; }
.bc-edit { --bc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm4 3a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM5.5 7a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm.5 6a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/%3E%3Cpath d='M16 8c0 3.15-1.866 2.585-3.567 2.07C11.42 9.763 10.465 9.473 10 10c-.603.683-.475 1.819-.351 2.92C9.826 14.495 9.996 16 8 16a8 8 0 1 1 8-8zm-8 7c.611 0 .654-.171.655-.176.078-.146.124-.464.07-1.119-.014-.168-.037-.37-.061-.591-.052-.464-.112-1.005-.118-1.462-.01-.707.083-1.61.704-2.314.369-.417.845-.578 1.272-.618.404-.038.812.026 1.16.104.343.077.702.186 1.025.284l.028.008c.346.105.658.199.953.266.653.148.904.083.991.024C14.717 9.38 15 9.161 15 8a7 7 0 1 0-7 7z'/%3E%3C/svg%3E"); }

.bc-empty { text-align: center; padding: 48px 16px; color: var(--pt-muted, #6c757d); }

/* ── Phone ──────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .bc-bar { padding-block: 8px; }
  .bc-bar-row { gap: 8px; }
  .bc-format-label { display: none; }
  .bc-format .form-select { min-width: 0; width: 86px; padding-inline: 14px 28px; background-position: right 10px center; }
  [dir="rtl"] .bc-format .form-select { padding-inline: 14px 28px; background-position: left 10px center; }
  .bc-search .form-control { padding-inline-start: 40px; }
  .bc-search-icon { inset-inline-start: 14px; }
  .bc-cats { margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -0.5); padding: 2px calc(var(--bs-gutter-x, 1.5rem) * 0.5); scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5); }
  .bc-cats.bc-fade-end, .bc-cats.bc-fade-start, .bc-cats.bc-fade-start.bc-fade-end { -webkit-mask-image: none; mask-image: none; }
  .bc-tip { display: none; }
  .bc-grid { gap: 12px; }
  .bc-card { padding: 12px; contain-intrinsic-size: auto 184px; }
  .bc-sw { height: 64px; }
}
