/* basic reset for this plugin's elements */
#fbp-root { position: fixed; left: 16px; bottom: 16px; z-index: 99999; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }

/* Toggle button */
#fbp-toggle {
    display:flex;
    align-items:center;
    gap:8px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    min-height: 44px;

    /* start hidden (JS will reveal when ready) to avoid flicker */
    opacity: 0;
}
#fbp-toggle .fbp-icon { font-size: 16px; line-height: 1; }
#fbp-toggle:focus { outline: 3px solid rgba(0,115,170,0.18); }

/* label: keep visible by default (JS will hide if needed) */
#fbp-toggle .fbp-label { display:inline-block; }

/* panel container (initially hidden) */
.fbp-panel {
    position: fixed;
    left: calc(16px + 56px);
    bottom: 16px;
    width: var(--fbp-panel-width, 320px);
    max-width: calc(100vw - 72px);
    max-height: 60vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.22);
    overflow: hidden;
    transform-origin: left bottom;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: all 220ms ease;
    display:flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.06);
    z-index: 99999;
}

/* when open */
#fbp-root.open .fbp-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* header */
.fbp-panel-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    background: linear-gradient(180deg,#fff,#fbfbfb);
    font-size:14px;
}

/* body (scrollable) */
.fbp-panel-body {
    padding: 10px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex:1 1 auto;
}

/* pages list */
.fbp-pages-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display:flex;
    flex-direction: column;
    gap: 6px;
}
.fbp-pages-list a {
    display:block;
    padding: 8px 10px;
    border-radius:6px;
    text-decoration:none;
    color:#222;
    background: transparent;
}
.fbp-pages-list a:hover, .fbp-pages-list a:focus {
    background: rgba(0,115,170,0.06);
    outline: none;
}

/* footer */
.fbp-panel-footer {
    padding: 8px 12px;
    border-top: 1px solid rgba(0,0,0,0.04);
    text-align: center;
}

/* small-screen adjustments */
@media (max-width:720px) {
    .fbp-panel {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: calc(100vw - 24px);
        bottom: 70px;
    }
}

/* positioning: left-30pct mode - root container shifted to left, toggle adjusted by JS */
.fbp-root.left-30pct {
    left: 0;
    bottom: auto;
    top: 30vh;
}
.fbp-root.left-30pct #fbp-toggle {
    position: fixed;
    left: 12px;
    top: 30vh;
    bottom: auto;
    transform: translateY(-50%);
    border-radius: 8px;
}

/* vertical orientation */
.fbp-root.vertical #fbp-toggle {
    display:flex;
    flex-direction: column;
    padding: 8px;
    gap:6px;
    width:48px;
    align-items:center;
    justify-content:center;
}
.fbp-root.vertical #fbp-toggle .fbp-label {
    font-size:11px;
    line-height:1;
    margin:0;
}

/* if vertical and showing label: write vertical text */
.fbp-root.vertical .fbp-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Button label on very small screens: keep visible (we don't hide by default) */
@media (max-width:420px) {
    #fbp-toggle { padding:10px; min-width:44px; }
}

/* ensure panel header shows clearly */
.fbp-panel-header .fbp-panel-title { font-size:15px; }
@media (max-width:420px) {
    .fbp-panel { bottom: 70px; }
    .fbp-panel-header .fbp-panel-title { font-size:16px; }
}

/* keep panel compact but scrollable */
.fbp-panel { max-height: 55vh; }
.fbp-panel-body { overflow-y:auto; max-height: 40vh; }
