/* Synced from site/index.html palette + cap-viz — do not restyle ad hoc. */

.cap-viz {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  /* Hold space before/while JS mounts so the page doesn't jump when shots appear */
  min-height: 300px;
  /* Growing shot content shouldn't yank scroll via overflow anchoring */
  overflow-anchor: none;
}
.cap-viz .palette.palette-shot {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: none;
  pointer-events: none;
  user-select: none;
  box-sizing: border-box;
}
/* Placement page: only section-jump tabs are interactive. */
.cap-viz .palette-shot .tabs-row {
  pointer-events: none; /* row itself isn't a target */
}
.cap-viz .palette-shot .tab {
  cursor: default;
  pointer-events: none;
}
.cap-viz .palette-shot .tab:hover {
  /* Kill shared .tab:hover — non-jump tabs must not look clickable */
  background: transparent;
  color: var(--t-tab);
}
.cap-viz .palette-shot .tab.active:hover {
  background: rgba(var(--ink), 0.1);
  color: rgba(var(--ink), 0.92);
}
.cap-viz .palette-shot .tab[data-section] {
  cursor: pointer;
  pointer-events: auto;
}
.cap-viz .palette-shot .tab[data-section]:hover {
  background: rgba(var(--ink), 0.07);
  color: rgba(var(--ink), 0.82);
}
.cap-viz .palette-shot .tab[data-section].active:hover {
  background: rgba(var(--ink), 0.14);
  color: rgba(var(--ink), 0.92);
}
.cap-viz .palette-shot .result-item,
.cap-viz .palette-shot .result-item:hover {
  cursor: default;
  background: transparent;
}
.cap-viz .palette-shot .result-item.active,
.cap-viz .palette-shot .result-item.active:hover {
  background: rgba(99, 102, 241, 0.2);
}
.cap-viz .palette-shot .footer { display: none; }
.cap-viz .palette-shot .results {
  overflow: hidden;
  flex: none;
  max-height: none;
}
/* Keep live-demo tab chrome (12px / 4×10 padding). fitShotTabs scales the
   full strip to width — do not shrink labels/counts like capability shots. */
.cap-viz .palette-shot .tabs-row {
  overflow: hidden;
  scrollbar-width: none;
}
.cap-viz .palette-shot .tabs-row::-webkit-scrollbar { display: none; }
.cap-viz .palette-shot .tabs-row.is-scrollable {
  overflow-x: auto;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.cap-viz .palette-shot .tabs-row.is-scrollable .tab {
  pointer-events: auto;
}
.cap-viz .palette-shot .search-input.shot-query {
  display: flex;
  align-items: center;
  cursor: default;
}
.cap-viz .palette-shot .search-input[readonly] {
  cursor: default;
  pointer-events: none;
  caret-color: transparent;
}

/* Narrow screens: real-sized tabs (scroll), denser search/rows */
@media (max-width: 720px) {
  .cap-viz {
    min-height: 240px;
  }
  .cap-viz .palette.palette-shot {
    border-radius: 12px;
  }
  .cap-viz .palette-shot .tabs-row {
    gap: 2px;
    padding: 12px 8px 6px;
  }
  .cap-viz .palette-shot .tab {
    padding: 4px 10px;
    font-size: 12px;
    gap: 5px;
  }
  .cap-viz .palette-shot .tab-count {
    display: none !important;
  }
  .cap-viz .palette-shot .search-row {
    padding: 10px 12px;
    gap: 8px;
  }
  .cap-viz .palette-shot .search-input {
    font-size: 13px;
  }
  .cap-viz .palette-shot .item-hint {
    display: none;
  }
  .cap-viz .palette-shot .result-item {
    gap: 9px;
    padding: 6px 10px;
  }
  .cap-viz .palette-shot .item-desc {
    font-size: 11.5px;
  }
  .cap-viz .palette-shot .item-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }
  .cap-viz .palette-shot .category-label {
    padding: 8px 12px 4px;
    font-size: 10px;
  }
}
@media (max-width: 480px) {
  .cap-viz .palette-shot .search-input {
    font-size: 12px;
  }
}

.palette {
  background: var(--surface);
  border: 1px solid rgba(var(--ink),0.1);
  border-radius: 14px;
  width: 100%;
  max-width: 100%;
  max-height: min(560px, calc(100vh - 14vh - 48px));
  display: flex; flex-direction: column;
  box-shadow: 0 24px 48px var(--shadow), 0 0 0 1px rgba(var(--ink),0.04) inset;
  overflow: hidden;
  font-family: var(--ui);
  line-height: normal;
  overscroll-behavior: none;
  box-sizing: border-box;
}

.search-row {
  display: flex; align-items: center; padding: 13px 16px; gap: 10px;
  border-bottom: 1px solid rgba(var(--ink),0.07); flex-shrink: 0;
}
.search-icon { flex-shrink: 0; color: var(--t-icon); }
.search-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: rgba(var(--ink),0.92); font-size: 15px; font-family: inherit;
  caret-color: var(--periwinkle);
}
/* No selection ring on the search box — matches the real extension, which
   never shows one here either. Higher specificity than the generic
   button/link focus-visible rule above so it reliably wins. */
.search-input:focus, .search-input:focus-visible { outline: none; }
.search-input::placeholder { color: var(--t-placeholder); }
/* Shrink the hint on narrow palettes so the full placeholder still fits. */
@media (max-width: 720px) {
  .search-input { font-size: 13px; }
}
@media (max-width: 480px) {
  .search-input { font-size: 12px; }
}
.clear-btn {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(var(--ink),0.12); border: none; color: var(--t-clear);
  font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
}
.clear-btn.visible { opacity: 1; pointer-events: auto; }
.clear-btn:hover { background: rgba(var(--ink),0.2); }

.tabs-row {
  display: flex; gap: 2px; padding: 6px 10px;
  border-bottom: 1px solid rgba(var(--ink),0.07); flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.tabs-row::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 100px;
  border: none; background: transparent; color: var(--t-tab);
  font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background 0.08s, color 0.08s; user-select: none; white-space: nowrap;
}
.tab:hover { background: rgba(var(--ink),0.07); color: rgba(var(--ink),0.82); }
.tab.active { background: rgba(99,102,241,0.18); color: var(--active-text); }
.tab-count {
  background: rgba(var(--ink),0.1);
  border-radius: 100px; padding: 1px 5px;
  font-size: 10px; min-width: 18px; text-align: center;
  display: none;
}
.tab-count.visible { display: inline-block; }
.tab.active .tab-count { background: rgba(99,102,241,0.3); }

.results { overflow-x: hidden; overflow-y: auto; flex: 1; padding: 4px 0 6px; overscroll-behavior: none; }
.results::-webkit-scrollbar { width: 5px; }
.results::-webkit-scrollbar-track { background: transparent; }
.results::-webkit-scrollbar-thumb { background: rgba(var(--ink),0.1); border-radius: 3px; }

.category-label {
  padding: 10px 18px 3px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--t-cat); user-select: none;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.category-label .cat-sep {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: -0.12em;
  margin: 0 0.35em;
  opacity: 0.9;
}
.result-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 12px; margin: 1px 6px; border-radius: 8px; cursor: pointer; user-select: none;
}
.result-item:hover  { background: rgba(var(--ink),0.065); }
.result-item.active { background: rgba(99,102,241,0.2); }
.result-item.active .item-label { color: var(--active-text); }

.item-icon {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px;
  background: rgba(var(--ink),0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; color: rgba(var(--ink),0.74); overflow: hidden;
  position: relative;
}
.item-icon img { width: 18px; height: 18px; object-fit: contain; }
.item-icon svg { width: 16px; height: 16px; display: block; flex-shrink: 0; }
.item-icon .icon-letter {
  font-size: 13px; font-weight: 600; line-height: 1;
  user-select: none;
}
.item-icon .icon-fav {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  opacity: 0;
}
.item-icon .icon-fav.is-loaded { opacity: 1; }
.item-icon:has(.icon-fav.is-loaded) .icon-letter { visibility: hidden; }
.item-body { flex: 1; min-width: 0; }
.item-label {
  display: flex; align-items: center; gap: 6px;
  color: rgba(var(--ink),0.88); font-size: 13.5px;
  min-width: 0;
}
.item-label-text {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-label mark { background: rgba(129,140,248,0.28); color: inherit; border-radius: 2px; }
.item-desc {
  color: var(--t-desc); font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 5px;
}
.item-hint {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  padding: 0;
  color: var(--t-hint);
}
.hint-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(var(--ink),0.1);
  color: inherit;
}
.hint-key svg {
  width: 13px;
  height: 13px;
  display: block;
  flex-shrink: 0;
}
.hint-key.hint-text {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--ui);
  letter-spacing: 0.2px;
  line-height: 1;
}
.item-audible {
  flex-shrink: 0; width: 18px; height: 18px; color: rgba(var(--ink),0.68);
  display: flex; align-items: center; justify-content: center;
}
.item-audible svg { width: 16px; height: 16px; display: block; }
.result-item.active .item-audible { color: var(--active-text); }
.item-group-dot {
  flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(var(--ink),0.12);
}

.empty { padding: 44px 24px; text-align: center; color: var(--t-empty); font-size: 13.5px; }
.empty strong { color: var(--t-empty-strong); font-weight: 500; }

.footer {
  padding: 8px 16px; border-top: 1px solid rgba(var(--ink),0.06);
  display: flex; gap: 14px; align-items: center; flex-shrink: 0;
  flex-wrap: nowrap;
}
.footer-hint {
  font-size: 13px; color: var(--t-footer-hint);
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0; white-space: nowrap;
}
@media (max-width: 640px) {
  .footer {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 20px;
    column-gap: 10px;
    padding: 16px 12px;
  }
  .footer-credits {
    margin-left: 0;
    flex-basis: 100%;
    justify-content: center;
  }
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(var(--ink),0.12);
  color: rgba(var(--ink),0.76);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--ui);
  line-height: 1;
}
.kbd svg {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
  color: inherit;
}
.footer-credits {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.footer-credit {
  font-size: 12px; font-weight: 500; color: var(--active-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--active-text) 45%, transparent);
  text-underline-offset: 2.5px;
  white-space: nowrap; cursor: pointer;
  transition: color 0.1s, text-decoration-color 0.1s, opacity 0.1s;
}
button.footer-credit {
  font-family: inherit; font-weight: 500; font-size: 12px;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--active-text);
}
.footer-credit:hover {
  text-decoration-color: var(--active-text);
  opacity: 0.85;
}
.footer-credit:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
  border-radius: 2px;
}
.footer-credit .love-flip {
  font: inherit; color: inherit; background: none; border: none; padding: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.footer-credit .love-flip:hover { opacity: 0.85; }
.footer-credit a { color: inherit; text-decoration: inherit; text-underline-offset: 2.5px; }
.footer-support { display: inline-flex; align-items: center; gap: 5px; }
.footer-support svg { width: 13px; height: 13px; flex-shrink: 0; display: block; }
.footer-credits-sep { color: rgba(var(--ink),0.45); font-size: 13px; font-weight: 600; user-select: none; }
