/* ── TrueBible Viewer — immersive book layout ─────────────────────────────── */

#tbv-root {
    position: relative;
    width: 100%;
    /* Subtract WP admin bar height (--wp-admin--admin-bar--height set by WP when logged in) */
    height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
    user-select: none;
}

/* ── Home button ────────────────────────────────────────────────────────────── */

#tbv-home {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 0.2s;
}

#tbv-home:hover { background: rgba(255,255,255,0.22); }

/* ── Nav toggle ─────────────────────────────────────────────────────────────── */

#tbv-nav-toggle {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 30;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

#tbv-nav-toggle:hover { background: rgba(255,255,255,0.22); }

/* ── Slide-in nav panel ─────────────────────────────────────────────────────── */

#tbv-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.5);
}

#tbv-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 50;
    width: clamp(280px, 33vw, 600px);
    max-width: 92vw;
    height: 100%;
    background: #16213e;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: translateX(0);
    transition: transform 0.28s ease;
}

#tbv-nav[hidden] {
    display: flex !important;
    transform: translateX(100%);
    pointer-events: none;
}

#tbv-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

#tbv-nav-title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #aab;
}

#tbv-nav-close {
    background: none;
    border: none;
    color: #aab;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

#tbv-nav-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

#tbv-nav-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Nav tree items */
.tbv-book-list,
.tbv-chapter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tbv-book-row {
    display: flex;
    align-items: stretch;
}

.tbv-toggle-btn {
    flex-shrink: 0;
    width: 28px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    color: #556;
    font-size: 0.55rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbv-toggle-btn:hover { color: #aab; background: rgba(255,255,255,0.06); }

.tbv-toggle-placeholder {
    flex-shrink: 0;
    width: 28px;
}

.tbv-book-btn {
    flex: 1;
    min-width: 0;
    text-align: left;
    padding: 7px 14px 7px 0;
    margin: 0;
    background: none;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ccd;
    cursor: pointer;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbv-book-btn:hover { color: #fff; }

.tbv-chapter-list { padding-left: 12px; }

.tbv-chapter-btn {
    width: 100%;
    text-align: left;
    padding: 2px 12px;
    margin: 0;
    background: none;
    border: none;
    font-size: 0.78rem;
    color: #99a;
    cursor: pointer;
    border-radius: 3px;
}

.tbv-chapter-btn:hover  { background: rgba(255,255,255,0.06); color: #dde; }
.tbv-chapter-btn.active { background: rgba(100,160,255,0.2); color: #7aadff; }

/* ── Book stage ─────────────────────────────────────────────────────────────── */

#tbv-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4px 4px 36px;
    overflow: hidden;
    position: relative;
}

/* Mask flip-animation overflow that enters the controls gutter */
#tbv-stage::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(transparent, #1a1a2e 55%);
    pointer-events: none;
    z-index: 5;
}

/* ── Loading spinner ────────────────────────────────────────────────────────── */

#tbv-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: #1a1a2e;
}

#tbv-loading[hidden] { display: none !important; }

.tbv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: rgba(255,255,255,0.7);
    border-radius: 50%;
    animation: tbv-spin 0.8s linear infinite;
}

@keyframes tbv-spin { to { transform: rotate(360deg); } }

/* ── StPageFlip book container ──────────────────────────────────────────────── */

#tbv-book {
    position: relative;
}

/*
 * box-shadow (not filter) on #tbv-book: filter would force transform-style:flat on descendants,
 * breaking StPageFlip's preserve-3d hard-page rotateY animation (cover page, last page).
 */
#tbv-book {
    box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 2px 8px rgba(0,0,0,0.6);
}

/* Page divs inside the book */
/* position:relative removed — breaks StPageFlip 3D hard-page transform */
.tbv-pf-page {
    background: #f8f5ef;
}

.tbv-pf-page img {
    display: block;
    background: #f8f5ef;
}

.tbv-link-overlay,
.tbv-custom-link-overlay {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
}

.tbv-link-overlay a,
.tbv-custom-link-overlay a {
    display: block;
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
}

/* ── Go dialog ──────────────────────────────────────────────────────────────── */

#tbv-go-modal {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    z-index: 400;
}
#tbv-go-modal[hidden] { display: none; }

#tbv-go-box {
    background: #1a1c2e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 16px;
    min-width: 280px;
    color: #e0e0e0;
}

#tbv-go-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#tbv-go-title { font-size: 0.95rem; font-weight: 600; }

#tbv-go-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin: 0;
    line-height: 1;
}

#tbv-go-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.tbv-go-tab {
    flex: 1;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    margin: 0;
}

.tbv-go-tab.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

#tbv-go-body { display: flex; gap: 6px; }

#tbv-go-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 0.95rem;
    padding: 6px 10px;
    outline: none;
}
#tbv-go-input:focus { border-color: rgba(255,255,255,0.5); }

#tbv-go-submit {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 12px;
    margin: 0;
}
#tbv-go-submit:hover { background: rgba(255,255,255,0.25); }

#tbv-go-error {
    font-size: 0.75rem;
    color: #ff8a80;
    margin-top: 6px;
    min-height: 16px;
}

/* ── Page controls ──────────────────────────────────────────────────────────── */

#tbv-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,12,30,0.92);
    border-top: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    z-index: 10;   /* above #tbv-stage::after gradient (z-index:5) */
}

#tbv-btn-group {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
}

#tbv-btn-group button {
    margin: 0;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    width: 26px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

#tbv-btn-group button:disabled { opacity: 0.3; cursor: default; }
#tbv-btn-group button:hover:not(:disabled) { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }

#tbv-version-select {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: rgba(255,255,255,0.85);
    font-size: 0.72rem;
    padding: 0 4px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 120px;
}
#tbv-version-select:hover { border-color: rgba(255,255,255,0.4); }
#tbv-version-select option { background: #2a2a2a; color: #fff; }

#tbv-help { font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.75); }

#tbv-forum {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.75rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
#tbv-forum:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}


#tbv-btn-group #tbv-page-info {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65);
    min-width: 80px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: default;
    text-align: center;
}

#tbv-btn-group .tbv-ctrl-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.18);
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    cursor: default;
    pointer-events: none;
}

/* ── Help modal ─────────────────────────────────────────────────────────────── */

#tbv-help-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

#tbv-help-modal[hidden] { display: none !important; }

#tbv-help-box {
    background: #16213e;
    color: #e0e0e0;
    border-radius: 8px;
    width: clamp(280px, 90vw, 440px);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}

#tbv-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #aab;
}

#tbv-help-close {
    background: none;
    border: none;
    color: #aab;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}
#tbv-help-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

#tbv-help-body { padding: 16px; }

.tbv-help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    line-height: 1.6;
    margin-bottom: 4px;
}

.tbv-help-table th {
    text-align: left;
    padding: 10px 0 4px;
    color: #7aadff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tbv-help-table td {
    padding: 3px 8px 3px 0;
    color: #ccd;
    vertical-align: top;
}

.tbv-help-table td:first-child {
    color: #fff;
    white-space: nowrap;
    padding-right: 16px;
    min-width: 130px;
}

.tbv-help-section { margin-bottom: 4px; }

.tbv-help-heading {
    padding: 10px 0 6px;
    color: #7aadff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 6px;
}

.tbv-help-scenario {
    background: rgba(100,160,255,0.06);
    border-left: 2px solid rgba(100,160,255,0.25);
    border-radius: 0 4px 4px 0;
    padding: 7px 10px;
    margin-bottom: 5px;
}

.tbv-help-q {
    color: #99aacc;
    font-size: 0.81rem;
    font-style: italic;
    margin-bottom: 3px;
}

.tbv-help-a {
    color: #dde;
    font-size: 0.84rem;
    line-height: 1.5;
}

.tbv-help-badge {
    display: inline-block;
    background: rgba(100,160,255,0.15);
    border: 1px solid rgba(100,160,255,0.3);
    border-radius: 3px;
    padding: 0 5px;
    font-size: 0.78em;
    color: #7aadff;
    margin-right: 5px;
    font-family: monospace;
    vertical-align: middle;
}

ul.tbv-help-bullets {
    margin: 4px 0 6px 0;
    padding-left: 18px;
    font-size: 0.84rem;
    line-height: 1.65;
    color: #ccd;
}

ul.tbv-help-bullets li { margin-bottom: 3px; }

kbd.tbv-help-kbd {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 0.85em;
    color: #fff;
    letter-spacing: 0.02em;
}

/* ── Bookmark panel (slides in from left) ───────────────────────────────────── */

#tbv-bm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0,0,0,0.35);
}
#tbv-bm-backdrop[hidden] { display: none !important; }

#tbv-bm-panel {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: clamp(280px, 33vw, 600px);
    max-width: 92vw;
    height: 100%;
    background: #16213e;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: translateX(0);
    transition: transform 0.28s ease;
}

#tbv-bm-panel[hidden] {
    display: flex !important;
    transform: translateX(-100%);
    pointer-events: none;
}

#tbv-bm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

#tbv-bm-title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #aab;
}

#tbv-bm-close {
    margin: 0;
    background: none;
    border: none;
    color: #aab;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}
#tbv-bm-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

#tbv-bm-add-row {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

#tbv-bm-add {
    width: 100%;
    margin: 0;
    padding: 7px 12px;
    background: rgba(100,160,255,0.15);
    border: 1px solid rgba(100,160,255,0.3);
    border-radius: 5px;
    color: #7aadff;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
#tbv-bm-add:hover { background: rgba(100,160,255,0.28); }

#tbv-bm-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.tbv-bm-empty {
    padding: 20px 16px;
    color: #556;
    font-size: 0.82rem;
    text-align: center;
}

.tbv-bm-item {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 8px 12px;
}

.tbv-bm-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.tbv-bm-loc {
    flex: 1;
    min-width: 0;
    margin: 0;
    background: none;
    border: none;
    color: #ccd;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tbv-bm-loc:hover { color: #7aadff; }

.tbv-bm-del {
    flex-shrink: 0;
    margin: 0;
    background: none;
    border: 1px solid rgba(255,80,80,0.3);
    border-radius: 3px;
    color: rgba(255,100,100,0.7);
    font-size: 0.72rem;
    padding: 2px 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tbv-bm-del:hover { background: rgba(255,80,80,0.15); color: #f88; }

.tbv-bm-note {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: #bbc;
    font-size: 0.78rem;
    padding: 5px 8px;
    resize: vertical;
    min-height: 44px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.15s;
}
.tbv-bm-note:focus {
    outline: none;
    border-color: rgba(100,160,255,0.4);
    background: rgba(255,255,255,0.08);
}
.tbv-bm-note::placeholder { color: #445; }

/* ── Bookmark color categories ───────────────────────────────────────────────── */

.tbv-bm-cat-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 9px 12px;
    cursor: pointer;
    color: #99aabb;
    font-size: 0.8rem;
    text-align: left;
}
.tbv-bm-cat-hdr:hover { color: #dde; background: rgba(255,255,255,0.03); }

.tbv-bm-cat-name { flex: 1; }

.tbv-bm-chevron { font-size: 0.65rem; opacity: 0.7; }

.tbv-bm-cat-body.collapsed { display: none; }

/* color dot — category header */
.tbv-bm-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 3px rgba(0,0,0,0.4);
}

/* 3-dot color selector inside each item */
.tbv-bm-dots {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 1px;
}

.tbv-bm-dot-btn {
    background: none;
    border: none;
    padding: 2px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    line-height: 0;
}

/* active dot: larger ball, no pointer */
.tbv-bm-dot-btn.tbv-bm-dot-active {
    cursor: default;
    margin-right: 4px;   /* gap between active and the other two */
}

.tbv-bm-ball {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.tbv-bm-dot-btn.tbv-bm-dot-active .tbv-bm-ball {
    width: 8px;
    height: 8px;
}

.tbv-bm-dot-btn:not(.tbv-bm-dot-active) .tbv-bm-ball { opacity: 0.3; }
.tbv-bm-dot-btn:not(.tbv-bm-dot-active):hover { background: rgba(255,255,255,0.07); }
.tbv-bm-dot-btn:not(.tbv-bm-dot-active):hover .tbv-bm-ball { opacity: 0.8; }

/* ── Hymn button ─────────────────────────────────────────────────────────────── */

#tbv-hymn-btn { font-size: 1rem; color: rgba(255,255,255,0.75); }
#tbv-hymn-btn.tbv-has-media { color: #7cf; }
#tbv-hymn-btn.tbv-playing   { color: #7cf; text-shadow: 0 0 6px rgba(100,200,255,0.6); }

/* ── Hymn badge (nav tree) ───────────────────────────────────────────────────── */

.tbv-hymn-li { display: flex; align-items: center; }
.tbv-hymn-li .tbv-chapter-btn { width: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tbv-hymn-play-btn {
    font-size: 0.65rem;
    color: #7a9;
    margin: 0 0 0 3px;
    flex-shrink: 0;
    padding: 1px 3px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;
}
.tbv-hymn-play-btn:hover { color: #7cf; background: rgba(100,200,255,0.12); }

/* ── Persistent audio bar ────────────────────────────────────────────────────── */

#tbv-audio-bar {
    position: fixed;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(14,22,50,0.92);
    border: 1px solid rgba(100,180,255,0.25);
    border-radius: 20px;
    padding: 5px 6px 5px 14px;
    backdrop-filter: blur(12px);
    white-space: nowrap;
    max-width: 86vw;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#tbv-audio-bar[hidden] { display: none !important; }

#tbv-audio-bar-title {
    font-size: 0.78rem;
    color: #b0c8e8;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    cursor: grab;
    user-select: none;
}

#tbv-audio-bar-title:active { cursor: grabbing; }

#tbv-audio-select {
    font-size: 0.72rem;
    background: rgba(255,255,255,0.08);
    color: #9bc;
    border: 1px solid rgba(100,180,255,0.2);
    border-radius: 8px;
    padding: 2px 4px;
    cursor: pointer;
    max-width: 120px;
}

#tbv-audio-select option { background: #16213e; color: #cde; }

#tbv-audio-seek {
    flex: 1;
    min-width: 60px;
    max-width: 140px;
    height: 3px;
    accent-color: #7cf;
    cursor: pointer;
    opacity: 0.75;
    border-radius: 2px;
}
#tbv-audio-seek:hover { opacity: 1; }

#tbv-audio-bar-btns {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

#tbv-audio-bar-btns button {
    margin: 0;
    background: none;
    border: none;
    color: #7cf;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    line-height: 1;
}

#tbv-audio-bar-btns button:hover {
    background: rgba(100,200,255,0.15);
    color: #fff;
}

/* ── Media panel ────────────────────────────────────────────────────────────── */

#tbv-media {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    border-radius: 24px;
    padding: 5px 14px;
    white-space: nowrap;
}

#tbv-media[hidden] { display: none !important; }

#tbv-audio-wrap audio {
    height: 28px;
    vertical-align: middle;
}

#tbv-video-wrap iframe {
    border: none;
    border-radius: 4px;
}

/* ── Magnifier button (active state) ────────────────────────────────────────── */

#tbv-mag-btn.active {
    background: rgba(100,180,255,0.22);
    border-color: rgba(100,180,255,0.6);
    color: #7acdff;
}

/* custom magnifier cursor when mag is active */
#tbv-root.tbv-mag-active,
#tbv-root.tbv-mag-active * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Ccircle cx='9' cy='9' r='7' fill='none' stroke='black' stroke-width='3.5' stroke-opacity='.35'/%3E%3Cline x1='14.5' y1='14.5' x2='20' y2='20' stroke='black' stroke-width='4' stroke-linecap='round' stroke-opacity='.35'/%3E%3Ccircle cx='9' cy='9' r='7' fill='none' stroke='white' stroke-width='1.8'/%3E%3Cline x1='14.5' y1='14.5' x2='20' y2='20' stroke='white' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") 9 9, crosshair !important;
}

/* ── Magnifier panel ────────────────────────────────────────────────────────── */

#tbv-mag-panel {
    position: fixed;
    bottom: 36px;                         /* sits just above the controls bar */
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 1200px);
    height: calc(83.333vh - 30px);
    overflow: hidden;
    background: #f4f0e8;
    border: 2px solid rgba(160,200,255,0.55);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -6px 32px rgba(0,0,0,0.55), 0 -1px 6px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 120;
}

#tbv-mag-panel[hidden] { display: none !important; }

#tbv-mag-img {
    position: absolute;
    top: 0;
    left: 0;
    image-rendering: auto;
    user-select: none;
}

/* centre crosshair */
#tbv-mag-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}
#tbv-mag-crosshair::before,
#tbv-mag-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(60,120,255,0.3);
}
#tbv-mag-crosshair::before {   /* vertical */
    width: 1px;
    height: 24px;
    top: -12px;
    left: 0;
}
#tbv-mag-crosshair::after {    /* horizontal */
    width: 24px;
    height: 1px;
    top: 0;
    left: -12px;
}
