/* TOGOPEPTIDE — global search overlay (Cmd+K).
   Ships hidden until #togo-search-overlay is unhidden by JS. */

#togo-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: 80px 16px 16px;
  pointer-events: auto;
}
#togo-search-overlay[hidden] { display: none; }

.togo-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.togo-search__panel {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  background: #0e0e11;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: togo-search-pop 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes togo-search-pop {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.togo-search__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #9d9da5;
}

.togo-search__head input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 16px;
  outline: none;
  padding: 4px 0;
  font-family: inherit;
}
.togo-search__head input::placeholder { color: #6f6f7a; }

.togo-search__list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}

.togo-search__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #cbd5e1;
  transition: background 120ms ease, transform 120ms ease;
}
.togo-search__item.is-active,
.togo-search__item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.togo-search__item.is-active {
  background: rgba(224, 27, 27, 0.12);
}

.togo-search__thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.togo-search__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9d9da5;
  font-size: 14px;
  flex-shrink: 0;
}

.togo-search__main {
  flex: 1;
  min-width: 0;
}
.togo-search__name {
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.togo-search__desc {
  color: #8e8e98;
  font-size: 12.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.togo-search__type {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f6f7a;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}

.togo-search__empty {
  padding: 24px 12px;
  color: #8e8e98;
  text-align: center;
  font-size: 14px;
}

/* ── Toolbar: sort + surprise-me (cluster 02 items 53 + 76) ──── */
.togo-search__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}
.togo-search__sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #8e8e98;
}
.togo-search__sort-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6f6f7a;
}
.togo-search__sort select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #e3e3eb;
  border-radius: 6px;
  padding: 4px 7px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}
.togo-search__sort select:hover,
.togo-search__sort select:focus {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}
.togo-search__surprise {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(224, 27, 27, 0.10);
  border: 1px solid rgba(224, 27, 27, 0.30);
  color: var(--color-accent-text, #ff5e5e);
  border-radius: 999px;
  padding: 4px 11px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.togo-search__surprise:hover {
  background: rgba(224, 27, 27, 0.18);
  border-color: rgba(224, 27, 27, 0.50);
  color: #ff7777;
}
@media (prefers-color-scheme: light) {
  body[data-theme="light"] .togo-search__toolbar,
  body:not([data-theme]) .togo-search__toolbar {
    border-bottom-color: rgba(0, 0, 0, 0.07);
    background: rgba(0, 0, 0, 0.02);
  }
  body[data-theme="light"] .togo-search__sort select,
  body:not([data-theme]) .togo-search__sort select {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a20;
  }
}

/* ── Recently-viewed strip + what's-new feed (items 70 + 77) ─── */
.togo-search__extras {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px 12px;
  background: rgba(255, 255, 255, 0.01);
  max-height: 220px;
  overflow-y: auto;
}
.togo-search__extras[hidden] { display: none; }
.togo-search__strip-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f6f7a;
  margin: 4px 0 8px;
}
.togo-search__strip-items {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.togo-search__strip-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 5px 10px 5px 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 12px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.togo-search__strip-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.togo-search__strip-item img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
  background: #161616;
  flex-shrink: 0;
}
.togo-search__strip-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  flex-shrink: 0;
}
.togo-search__strip-name {
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.togo-search__news {
  margin-top: 14px;
}
.togo-search__news-item {
  display: block;
  padding: 7px 10px;
  margin-top: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.35;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.togo-search__news-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  color: #fff;
}
.togo-search__news-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  margin-right: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #9d9da5;
  vertical-align: middle;
}
@media (prefers-color-scheme: light) {
  body[data-theme="light"] .togo-search__extras,
  body:not([data-theme]) .togo-search__extras {
    border-top-color: rgba(0, 0, 0, 0.07);
    background: rgba(0, 0, 0, 0.015);
  }
  body[data-theme="light"] .togo-search__strip-item,
  body:not([data-theme]) .togo-search__strip-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
    color: #2a2a30;
  }
  body[data-theme="light"] .togo-search__news-tag,
  body:not([data-theme]) .togo-search__news-tag {
    background: rgba(0, 0, 0, 0.06);
    color: #555;
  }
}

/* Did-you-mean + popular-search banner (cluster 02 items 57 + 58) */
.togo-search__banner {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
  color: #b0b0b9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.togo-search__banner[hidden] { display: none; }
.togo-search__banner strong { color: #fff; font-weight: 600; }
.togo-search__banner-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6f6f7a;
}
.togo-search__banner-link {
  background: transparent;
  border: 0;
  color: var(--color-accent-text, #ff5e5e);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.togo-search__banner-link:hover { color: #ff7777; }
.togo-search__banner-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #cbd5e1;
  padding: 3px 9px;
  border-radius: 999px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.togo-search__banner-pill:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.20);
  color: #fff;
}

/* Light-mode parity: sane contrast for both banner blocks */
@media (prefers-color-scheme: light) {
  body[data-theme="light"] .togo-search__banner,
  body:not([data-theme]) .togo-search__banner {
    border-bottom-color: rgba(0, 0, 0, 0.07);
    color: #4a4a52;
  }
  body[data-theme="light"] .togo-search__banner-pill,
  body:not([data-theme]) .togo-search__banner-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
    color: #2a2a30;
  }
}

/* Section header inside the search list (e.g., "Recent" / "Suggestions") */
.togo-search__section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
  border-radius: 0;
  pointer-events: none;
}
.togo-search__section + .togo-search__section { border-top: none; }
.togo-search__section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f6f7a;
}
.togo-search__section-clear {
  pointer-events: auto;
  background: transparent;
  border: 0;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #8e8e98;
  cursor: pointer;
  border-radius: 4px;
  transition: color 160ms ease, background 160ms ease;
}
.togo-search__section-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.togo-search__foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #6f6f7a;
}
.togo-search__foot kbd,
.togo-search__kbd {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin: 0 2px;
}
.togo-search__kbd { font-size: 11.5px; padding: 3px 8px; color: #8e8e98; }

body.togo-search--open { overflow: hidden; }

/* ── Header search-trigger button ─────────────────────────── */
.site-header__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #9d9da5;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.site-header__search:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.site-header__search svg { flex-shrink: 0; }
.site-header__search-kbd {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #6f6f7a;
}
@media (max-width: 768px) {
  .site-header__search-label,
  .site-header__search-kbd { display: none; }
  .site-header__search { padding: 8px; }
}

/* ── PWA install prompt (bottom-right card) ──────────────── */
#togo-pwa-install {
  position: fixed;
  right: 16px;
  bottom: 16px;
  /* z-index: was 90 (magic) → --z-floater-prompt (650). */
  z-index: var(--z-floater-prompt, 650);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 380px;
  padding: 14px 14px 14px 16px;
  background: #0e0e11;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 200ms ease;
}
#togo-pwa-install.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.togo-pwa-install__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: rgba(224, 27, 27, 0.12);
  color: var(--color-accent-text, #ff5e5e);
  border-radius: 10px;
  flex-shrink: 0;
}
.togo-pwa-install__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.togo-pwa-install__copy strong {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.togo-pwa-install__copy span {
  color: #9d9da5;
  font-size: 12.5px;
  line-height: 1.4;
}
.togo-pwa-install__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.togo-pwa-install__cta {
  padding: 8px 14px;
  background: var(--color-accent, #e01b1b);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease;
}
.togo-pwa-install__cta:hover {
  background: var(--color-accent-hover, #ff3030);
}
.togo-pwa-install__close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  color: #9d9da5;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.togo-pwa-install__close:hover {
  border-color: rgba(255, 255, 255, 0.20);
  color: #fff;
}
@media (max-width: 480px) {
  #togo-pwa-install {
    left: 12px;
    right: 12px;
    max-width: none;
    /* Stapelt boven bottom-nav (var --tgp-mn-height ≈ 64px) en boven feedback-FAB.
       Voorkomt dat de close-knop onbereikbaar wordt op mobiel. */
    bottom: calc(var(--tgp-mn-height, 64px) + env(safe-area-inset-bottom, 0px) + 70px);
    /* z-index: was 9996 (magic) → --z-floater-prompt (650). Consistent
       met desktop-waarde hierboven; media-query past alleen layout aan. */
    z-index: var(--z-floater-prompt, 650);
  }
}

/* ── Glossary tooltips (cluster 02 item 66) ──────────────── */
abbr.glossary-term {
  text-decoration: underline dotted rgba(255, 255, 255, 0.30);
  text-underline-offset: 3px;
  cursor: help;
  border: 0;
  font: inherit;
  color: inherit;
}
abbr.glossary-term:hover,
abbr.glossary-term:focus {
  text-decoration-color: var(--color-accent-text, #ff5e5e);
}
@media (prefers-color-scheme: light) {
  body[data-theme="light"] abbr.glossary-term,
  body:not([data-theme]) abbr.glossary-term {
    text-decoration-color: rgba(0, 0, 0, 0.32);
  }
}

/* ── Citation hover popover (cluster 02 item 67) ─────────── */
a.cite-ref {
  font-size: 0.78em;
  vertical-align: super;
  line-height: 1;
  color: var(--color-accent-text, #ff5e5e);
  text-decoration: none;
  padding: 0 1px;
  border-radius: 3px;
  transition: background 140ms ease;
}
a.cite-ref:hover,
a.cite-ref:focus {
  background: rgba(224, 27, 27, 0.10);
  text-decoration: none;
}
#togo-cite-pop {
  position: absolute;
  z-index: 1100;
  max-width: 320px;
  padding: 9px 12px;
  background: #15151a;
  color: #e3e3eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12.5px;
  line-height: 1.45;
  pointer-events: none;
}
#togo-cite-pop[hidden] { display: none; }
@media (prefers-color-scheme: light) {
  body[data-theme="light"] #togo-cite-pop,
  body:not([data-theme]) #togo-cite-pop {
    background: #ffffff;
    color: #1a1a20;
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
}
