*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{
    --sidebar:#1f1f1f;
    --sidebar-hover:#2f2f2f;
    --sidebar-active:#0b84ff;
    --border:#333;
    --topbar:#fafafa;
}

html,
body{
    width:100%;
    height:100%;
    overflow:hidden;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
    background:#181818;
}

.container{
    display:flex;
    width:100%;
    height:100dvh;
}

/* SIDEBAR */

.sidebar{

    width:340px;

    background:var(--sidebar);

    color:white;

    overflow-y:auto;

    border-right:1px solid var(--border);

    flex-shrink:0;

    transition:.25s;

}

.sidebar h1{

    text-align:center;

    font-size:30px;

    padding:24px;

}

#search{

    width:90%;

    margin:0 5% 20px;

    padding:14px;

    border:none;

    border-radius:10px;

    outline:none;

    font-size:16px;

}

.chapter{

    padding:16px 20px;

    cursor:pointer;

    border-top:1px solid var(--border);

    transition:.15s;

    font-size:17px;

}

.chapter:hover{

    background:var(--sidebar-hover);

}

.chapter.active{

    background:var(--sidebar-active);

}

/* CONTENT */

.content{

    flex:1;

    display:flex;

    flex-direction:column;

    background:white;

    min-width:0;

}

.topbar{

    height:58px;

    background:var(--topbar);

    border-bottom:1px solid #ddd;

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:0 18px;

    flex-shrink:0;

}

.topbar button{

    border:none;

    background:#0b84ff;

    color:white;

    padding:9px 16px;

    border-radius:8px;

    cursor:pointer;

}

.topbar button:hover{

    background:#0066cb;

}

#chapterTitle{

    flex:1;

    text-align:center;

    font-weight:700;

    padding:0 20px;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

}

#reader{

    width:100%;

    height:100%;

    flex:1;

    border:none;

    background:white;

}

/* MENU */

#menuButton{

    display:none;

}

/* OVERLAY */

#overlay{

    display:none;

}

/* MOBILE */

@media(max-width:900px){

#menuButton{

display:block;

position:fixed;

left:12px;

top:10px;

width:50px;

height:50px;

border:none;

border-radius:10px;

background:#0b84ff;

color:white;

font-size:28px;

z-index:10001;

}

.sidebar{

position:fixed;

left:-340px;

top:0;

width:320px;

height:100%;

z-index:10000;

box-shadow:0 0 30px rgba(0,0,0,.5);

}

.sidebar.open{

left:0;

}

.content{

width:100%;

height:100dvh;

}

.topbar{

padding-left:70px;

}

#reader{

height:calc(100dvh - 58px);

}

#overlay{

display:block;

position:fixed;

inset:0;

background:rgba(0,0,0,.45);

opacity:0;

pointer-events:none;

transition:.25s;

z-index:9999;

}

#overlay.show{

opacity:1;

pointer-events:auto;

}

}