/* Admin Interface */
.wrap {
    margin: 20px;
}

.nav-tab-wrapper {
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
}

.nav-tab {
    background: #f0f0f1;
    border: 1px solid #ccc;
    border-bottom: none;
    margin-right: 5px;
    padding: 8px 15px;
    text-decoration: none;
    color: #1d2327;
}

.nav-tab-active {
    background: #fff;
    border-bottom-color: #fff;
}

.tab-content {
    display: none;
    background: #fff;
    border: 1px solid #ccc;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.form-table th {
    width: 250px;
    padding: 20px 10px 20px 0;
}

.form-table input[type="number"] {
    width: 120px;
}

/* Reading progress bar */
#ascac-progress-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

#ascac-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2271b1, #135e96);
    transition: width 0.15s linear;
}

/* Floating control panel */
#ascac-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    min-width: 170px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 13px;
    color: #1d2327;
    backdrop-filter: blur(6px);
}

#ascac-toggle,
#ascac-hold {
    appearance: none;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

#ascac-toggle {
    background: #2271b1;
    color: #fff;
}

#ascac-toggle:hover {
    background: #135e96;
}

#ascac-hold {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #dcdcde;
    user-select: none;
    touch-action: none;
}

#ascac-hold:hover {
    background: #e0e0e1;
}

#ascac-hold.ascac-holding {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.ascac-speed-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #50575e;
    font-size: 12px;
}

.ascac-speed-wrap span {
    flex-shrink: 0;
}

#ascac-speed {
    flex: 1;
    accent-color: #2271b1;
    cursor: pointer;
}

#ascac-meta {
    font-size: 11px;
    color: #646970;
    text-align: center;
    min-height: 1em;
}

/* Section mini-map */
#ascac-minimap {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 4px;
}

#ascac-minimap.ascac-hidden {
    display: none;
}

#ascac-minimap .ascac-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#ascac-minimap .ascac-dot:hover {
    transform: scale(1.4);
    background: rgba(34, 113, 177, 0.6);
}

#ascac-minimap .ascac-dot.ascac-active {
    background: #2271b1;
    transform: scale(1.35);
}

/* Focus reading mode */
body.ascac-focus-active p {
    opacity: 0.42;
    transition: opacity 0.35s ease;
}

body.ascac-focus-active p.ascac-focus-current {
    opacity: 1;
}

/* Feedback poll */
#ascac-poll {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #1d2327;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-family: system-ui, -apple-system, sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

#ascac-poll.ascac-show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

#ascac-poll button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
}

#ascac-poll button:hover {
    background: #2271b1;
    border-color: #2271b1;
}

@media (max-width: 600px) {
    #ascac-panel {
        right: 10px;
        bottom: 10px;
        min-width: 140px;
        padding: 10px;
    }

    #ascac-minimap {
        display: none;
    }

    #ascac-poll {
        left: 10px;
        right: 10px;
        transform: translate(0, 20px);
        bottom: 140px;
    }

    #ascac-poll.ascac-show {
        transform: translate(0, 0);
    }
}
