html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

#reader-header {
    height: 52px;
    flex: 0 0 52px;

    display: grid;
    grid-template-columns: 112px 1fr 112px;
    align-items: center;

    border-bottom: 1px solid #ccc;
    background: #fff;
}

#reader-header button {
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 32px;
    cursor: pointer;
}

.reader-header-left,
.reader-header-right {
    display: flex;
    height: 100%;
    align-items: center;
}

.reader-header-left {
    justify-content: flex-start;
}

.reader-header-right {
    justify-content: flex-end;
}

.reader-header-left button,
.reader-header-right button {
    width: 56px;
    flex: 0 0 56px;
}

.sample-complete-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

.sample-complete-modal {
    width: min(420px, calc(100vw - 32px));
    padding: 28px;
    border-radius: 12px;
    background: #fff;
    color: #222;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.sample-complete-modal h2 {
    margin: 0 0 12px;
}

.sample-complete-modal p {
    margin: 0 0 22px;
    line-height: 1.45;
}

.sample-complete-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.sample-complete-actions button {
    padding: 10px 18px;
    cursor: pointer;
}

.sample-complete-close {
    margin-top: 16px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

#feral-home {
    font-size: 24px !important;
}


#book-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

#viewer {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #f7f5ef;
}

#reader-header {
    position: relative;
}

#reader-controls {
    position: absolute;
    top: 52px;
    right: 12px;
    z-index: 1000;

    display: none;
    width: 320px;

    padding: 12px;

    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

#reader-controls.open {
    display: block;
}

.reader-control-group + .reader-control-group {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e2e2;
}

.reader-control-label {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #555;
}

.reader-control-row {
    display: flex;
    gap: 8px;
}

#reader-controls button {
    min-width: 44px;
    height: 40px;

    border: 1px solid #bbb;
    border-radius: 6px;

    background: #fff;
    font-size: 18px;
    cursor: pointer;
}

.reader-level-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

#reader-controls .reader-level-button {
    min-width: 0;
    width: 100%;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
}

#reader-controls .reader-level-button.active {
    border-color: #111;
    background: #111;
    color: #fff;
}

#reader-controls .reader-level-button.locked {
    opacity: 0.55;
}

#type-controls-button {
    width: auto;
    min-width: 100px;
    padding: 0 14px;
    white-space: nowrap;
    font-size: 18px !important;
    font-weight: 600;
}

/* Physical page-turn zones live outside epub.js so their direction never
   depends on iframe/column geometry. */
.page-turn-zone {
    position: fixed;
    top: 52px;
    bottom: 0;
    width: 12vw;
    min-width: 48px;
    max-width: 140px;
    z-index: 40;

    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

#page-zone-left {
    left: 0;
}

#page-zone-right {
    right: 0;
}
