.device-mobile .nav-buttons,
.device-mobile .right-buttons {
    position: fixed;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px;
    gap: 8px;
    top: auto !important;
    bottom: 10px;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100%;
}

.device-mobile .nav-button,
.device-mobile .right-button {
    min-width: 120px;
    font-size: 0.85em;
    padding: 8px 12px;
    margin: 2px;
}

.device-tablet .reading-box {
    width: calc(100vw - 100px) !important;
    max-width: 700px;
}

.device-mobile .reading-box {
    width: calc(100vw - 30px) !important;
    height: 75vh !important;
    padding: 15px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Prevent background scroll when reading box is open */
.reading-box-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Better touch scrolling */
.touch-device .reading-box {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Adjust header for mobile */
.device-mobile .site-header {
    font-size: 1.1em;
    text-align: center;
    padding: 10px 0;
}

/* Adjust footer for mobile */
.device-mobile .footer-message {
    bottom: 80px;
    font-size: 1em;
}

.device-mobile .last-updated,
.device-mobile .copyright {
    font-size: 12px;
    bottom: 10px;
}