/* EPUB layout */
#ptn-epub-layout {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

#ptn-epub-toc {
    flex: 0 0 260px;
    background: #020617;
    overflow-y: auto;
    padding: 12px;
    color: #e2e8f0;
    border-right: 1px solid #1e293b;
    box-sizing: border-box;
}

/* TOC: force horizontal, readable text even if theme tries to rotate it */
#ptn-epub-toc,
#ptn-epub-toc * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal !important;
    transform: none !important;
    letter-spacing: normal !important;
}

/* TOC text styles */
#ptn-epub-toc h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #facc15;
}

#ptn-epub-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#ptn-epub-toc li {
    margin-bottom: 6px;
}

#ptn-epub-toc a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    display: block;
}

#ptn-epub-toc a:hover {
    color: #facc15;
}

/* Main EPUB page area */
#ptn-epub-viewer-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow-y: auto;      /* allow vertical scroll for scrolled-doc */

}

#ptn-epub-viewer {
    width: 100%;
    height: 100%;
}

/* Prev / Next controls */
.ptn-epub-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    gap: 10px;
}

.ptn-epub-controls button {
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
}

.ptn-epub-controls button:hover {
    background: #334155;
}

@media (max-width: 768px) {
    #ptn-epub-toc {
        flex: 0 0 180px;
    }
}
