/* Wings X Flipbook-Suche */

/* Markierung im Flipbook: gelb statt blau; der Textlayer ist sonst nur zu 25 % sichtbar */
.flipbook-page-html .textLayer:has(mark.mark-search),
.flipbook-page-html .textLayer:has(mark.wxf-pass) { opacity: .5 !important; }
/* Textabschnitt einer KI-Quelle: helles Gelb (ergibt mit der Deckkraft des Textlayers ein zartes Gelb) */
.flipbook-page-html .textLayer mark.wxf-pass { background: rgba(255,221,0,.55) !important; color: transparent !important; padding: 0 !important; }
.flipbook-page-html .textLayer mark.mark-search,
.flipbook-page-html .textLayer mark.wxf-mark { background: #ffdd00 !important; color: transparent !important; padding: 0 !important; }

.wxf-panel {
  position: absolute; z-index: 1000; top: 0; left: 0; bottom: 0;
  width: 360px; max-width: 100%;
  display: none; flex-direction: column;
  background: #fff; color: #4f4f4f; box-shadow: 4px 0 12px 0 rgba(0,0,0,.12);   /* wie das Inhaltsverzeichnis des Flipbooks */
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-align: left;
}
.wxf-panel.is-open { display: flex; }
.wxf-panel * { box-sizing: border-box; }
.wxf-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.wxf-title { font-weight: 600; font-size: 15px; }
.wxf-x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: #4f4f4f; padding: 0 4px; }
.wxf-form { display: flex; gap: 6px; padding: 0 12px 8px; }
.wxf-q { flex: 1; min-width: 0; height: 34px; padding: 4px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; color: #333; background: #fff; }
.wxf-q:focus { outline: none; border-color: #ffdd00; box-shadow: 0 0 0 2px rgba(255,221,0,.45); }
.wxf-word, .wxf-go { width: 34px; height: 34px; padding: 0; border: 1px solid #ccc; border-radius: 6px; background: #eee; color: #333; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.wxf-word[aria-pressed="true"] { background: #ffdd00; border-color: #e0c200; }
.wxf-go:hover, .wxf-word:hover { border-color: #999; }
.wxf-info { padding: 0 12px 6px; font-size: 12.5px; color: #777; min-height: 18px; }
.wxf-panel.is-busy .wxf-info::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; border: 2px solid #ccc; border-top-color: #4f4f4f; border-radius: 50%; animation: wxf-spin .8s linear infinite; vertical-align: -1px; }
@keyframes wxf-spin { to { transform: rotate(360deg); } }
.wxf-list { flex: 1; overflow-y: auto; padding: 0 0 12px; border-top: 1px solid #eee; overscroll-behavior: contain; }
.wxf-group { border-bottom: 1px solid #eee; }
.wxf-chap { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px 2px; font-weight: 600; font-size: 13px; color: #4f4f4f; }
.wxf-part { flex: none; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #4f4f4f; color: #fff; }
.wxf-hit { display: block; padding: 5px 12px 7px 12px; text-decoration: none !important; color: inherit !important; border-left: 3px solid transparent; }
.wxf-hit:hover { background: #fafafa; }
.wxf-hit.is-active { background: #fffbe0; border-left-color: #ffdd00; }
.wxf-hit-top { display: flex; justify-content: space-between; font-size: 12px; color: #888; }
.wxf-pg { font-weight: 600; color: #4f4f4f; }
.wxf-snip { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: #555; margin-top: 2px; }
.wxf-snip mark { background: #ffdd00; color: #222; padding: 0 1px; border-radius: 2px; }
@media (max-width: 699px) { .wxf-panel { width: 100%; } }

/* Bedienhilfe ("?"-Knopf) */
.wxf-help { flex: 1; overflow-y: auto; padding: 0 14px 14px; border-top: 1px solid #eee; overscroll-behavior: contain; font-size: 13.5px; }
.wxf-help .tip-h { font-weight: 600; font-size: 14px; margin: 10px 0 4px; color: #4f4f4f; }
.wxf-help .tip-h2 { margin-top: 14px; }
.wxf-help .tip-list { list-style: none; margin: 0; padding: 0; }
.wxf-help .tip-list li { display: flex; gap: 8px; align-items: flex-start; margin: 7px 0; line-height: 1.4; }
.wxf-help .tip-ico { flex: none; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 6px; background: #eee; color: #222; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.wxf-help .tip-ico svg { width: 16px; height: 16px; }
.wxf-help .tip-pill { flex: none; font-size: 12px; padding: 3px 8px; border-radius: 12px; background: #eee; color: #222; white-space: nowrap; }
.wxf-help .tip-box { display: inline-block; width: 14px; height: 14px; border-radius: 2px; }
.wxf-help .tip-grey { background: #d9d9d9; } .wxf-help .tip-yellow { background: #ffdd00; }

/* Theme-Stile fuer Knoepfe neutralisieren (Vergroessern/Verschieben beim Ueberfahren, runde Form, Schatten) */
.wxf-panel button.wxf-x, .wxf-panel button.wxf-x:hover, .wxf-panel button.wxf-x:focus, .wxf-panel button.wxf-x:active,
.wxf-panel button.wxf-word, .wxf-panel button.wxf-word:hover, .wxf-panel button.wxf-word:focus, .wxf-panel button.wxf-word:active,
.wxf-panel button.wxf-go, .wxf-panel button.wxf-go:hover, .wxf-panel button.wxf-go:focus, .wxf-panel button.wxf-go:active {
  transform: none !important; transition: none !important; animation: none !important;
  box-shadow: none !important; text-shadow: none !important; outline-offset: 0 !important;
  margin: 0 !important; min-width: 0 !important; min-height: 0 !important; letter-spacing: 0 !important; text-transform: none !important;
}
.wxf-panel button.wxf-x, .wxf-panel button.wxf-x:hover, .wxf-panel button.wxf-x:focus, .wxf-panel button.wxf-x:active {
  width: 28px !important; height: 28px !important; padding: 0 !important; border: 0 !important; border-radius: 4px !important;
  background: transparent !important; color: #4f4f4f !important; font-size: 24px !important; line-height: 28px !important;
}
.wxf-panel button.wxf-x:hover { background: #f0f0f0 !important; }
.wxf-panel button.wxf-word, .wxf-panel button.wxf-go,
.wxf-panel button.wxf-word:hover, .wxf-panel button.wxf-go:hover,
.wxf-panel button.wxf-word:focus, .wxf-panel button.wxf-go:focus {
  width: 34px !important; height: 34px !important; padding: 0 !important; border-radius: 6px !important;
  border: 1px solid #ccc !important; background: #eee !important; color: #333 !important; font-size: 16px !important; line-height: 1 !important;
}
.wxf-panel button.wxf-word[aria-pressed="true"], .wxf-panel button.wxf-word[aria-pressed="true"]:hover { background: #ffdd00 !important; border-color: #e0c200 !important; }
.wxf-panel button.wxf-go:hover, .wxf-panel button.wxf-word:hover { border-color: #999 !important; }
.wxf-panel button svg { transform: none !important; }
/* Suchfeld genau so hoch wie die Knoepfe (Theme setzt sonst eigene Hoehe, Innenabstand, Rand) */
.wxf-panel .wxf-form { align-items: center !important; }
.wxf-panel input.wxf-q, .wxf-panel input.wxf-q:focus, .wxf-panel input.wxf-q:hover {
  height: 34px !important; min-height: 0 !important; max-height: 34px !important; margin: 0 !important;
  padding: 0 10px !important; line-height: 32px !important; font-size: 14px !important;
  border: 1px solid #ccc !important; border-radius: 6px !important; box-sizing: border-box !important; background: #fff !important;
}
.wxf-panel input.wxf-q:focus { border-color: #ffdd00 !important; box-shadow: 0 0 0 2px rgba(255,221,0,.45) !important; outline: none !important; }

/* Abdeckung "lädt …" waehrend das Buch neu berechnet wird */
.wxf-busy { position: absolute; inset: 0; z-index: 1100; display: none; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.85); color: #444; font: 14px/1.4 Arial, Helvetica, sans-serif; cursor: wait; }
.wxf-busy.is-on { display: flex; }
.wxf-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #ddd; border-top-color: #ffdd00; animation: wxf-spin .8s linear infinite; }
@keyframes wxf-spin { to { transform: rotate(360deg); } }

/* Beste Treffer (Hintergrund wie der KI-Hinweis im Chat) */
.wxf-best { margin: 0 0 8px; padding: 4px 10px 2px; background: #fff8d5; border-radius: 8px; }
.wxf-best-head { font-weight: 700; color: #4f4f4f; font-size: 13px; margin: 4px 0 2px; }
.wxf-best .wxf-best-item { border-top: 1px solid #efe1a0; }
.wxf-best .wxf-best-item:first-of-type { border-top: 0; }
.wxf-best-t { display: block; font-weight: 600; color: #4f4f4f; margin: 0 0 1px; }
.wxf-best-t .wxf-part { margin-right: 6px; }
.wxf-best .wxf-best-snip { -webkit-line-clamp: 1; }

/* 1.32: aktiver Knopf (Suche / ?) wie beim offenen Inhaltsverzeichnis leicht dunkel hinterlegt */
.wxf-btn-active.flipbook-menu-btn-tint::after,
.flipbook-menu-btn-tint.flipbook-btn-active[data-name="btnWxfHelp"]::after { background-color: rgba(128,128,128,.16); }
.wxf-btn-active:not(.flipbook-menu-btn-tint) { background-color: rgba(128,128,128,.16) !important; border-radius: 8px; }
