/* ------------------------------------------------------------
 | Suche
 * ------------------------------------------------------------ */

.hb-viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hb-search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.hb-search-input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid var(--hb-border, #e5e7eb);
    padding: 6px 26px 6px 12px;
    font-size: 13px;
    outline: none;
    font-family: var(--hb-pdf-font);
}

.hb-search-input:focus {
    border-color: var(--hb-red);
    box-shadow: 0 0 0 1px rgba(226, 0, 26, 0.4);
}

.hb-search-clear {
    position: absolute;
    right: 8px;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--hb-muted, #6b7280);
    display: none;
    font-family: var(--hb-pdf-font);
}

.hb-search-clear:hover {
    color: var(--hb-red);
}

.hb-search-status {
    font-size: 12px;
    color: var(--hb-muted, #6b7280);
    white-space: nowrap;
}

.hb-search-results {
    margin-bottom: 10px;
    font-size: 12px;
    max-height: 200px;
    overflow: auto;
}

.hb-search-result {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    margin-bottom: 2px;
    cursor: pointer;
    font: inherit;
}

.hb-search-result:hover {
    background: #f3f4f6;
}

.hb-search-result-page {
    font-weight: 600;
    margin-right: 6px;
}

.hb-search-result-text {
    color: #6b7280;
}

.hb-search-hit-line {
    background: #fef3f2;
    outline: 2px solid rgba(226, 0, 26, 0.6);
    outline-offset: 2px;
}

/* ------------------------------------------------------------
 | Inhaltsverzeichnis: aktiver Marker
 * ------------------------------------------------------------ */

.hb-toc-item {
    position: relative;
}

.hb-toc-link {
    position: relative;
}

.hb-toc-item.is-active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    width: 4px;
    height: calc(100% - 16px);
    min-height: 16px;
    border-radius: 999px;
    background: var(--hb-red);
    box-shadow: 0 0 0 3px rgba(226, 0, 26, 0.08);
}

.hb-toc-link.is-active {
    color: var(--hb-red);
    font-weight: 700;
    background: rgba(226, 0, 26, 0.06);
}

.hb-toc-link.is-active::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--hb-red);
    transform: translateY(-50%);
}

/* ------------------------------------------------------------
 | QR-Box
 * ------------------------------------------------------------ */

.hb-qr-float {
    position: fixed !important;
    right: 24px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 50 !important;

    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    padding: 6px 6px 7px !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;

    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(17, 24, 39, 0.08) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14) !important;
    color: #111827 !important;
    font-family: var(--hb-pdf-font) !important;
    text-align: center !important;
    overflow: hidden !important;
}

.hb-qr-title {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 8px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #6b7280 !important;
}

.hb-qr-code {
    display: block !important;
    width: 66px !important;
    height: 66px !important;
    min-width: 66px !important;
    min-height: 66px !important;
    max-width: 66px !important;
    max-height: 66px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

.hb-qr-code canvas,
.hb-qr-code img,
.hb-qr-code svg {
    display: block !important;
    width: 66px !important;
    height: 66px !important;
    max-width: 66px !important;
    max-height: 66px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    image-rendering: crisp-edges !important;
}

.hb-qr-caption {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 8px !important;
    line-height: 1.08 !important;
    font-weight: 300 !important;
    color: #4b5563 !important;
    white-space: normal !important;
}

.hb-qr-float::before,
.hb-qr-float::after {
    content: none !important;
    display: none !important;
}

@media (max-width: 1180px) {
    .hb-qr-float {
        display: none !important;
    }
}

/* ------------------------------------------------------------
 | Nach oben scrollen
 * ------------------------------------------------------------ */

.hb-back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 80;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #e2001a 0%, #b80016 100%);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 14px 32px rgba(226, 0, 26, 0.28);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.96);
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.hb-back-to-top span {
    display: block;
    transform: translateY(-1px);
}

.hb-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.hb-back-to-top:hover {
    box-shadow: 0 18px 38px rgba(226, 0, 26, 0.34);
    transform: translateY(-2px) scale(1.02);
}

.hb-back-to-top:active {
    transform: translateY(0) scale(0.98);
}