html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.toc-link.active {
    color: #0099d9;
    font-weight: 600;
    border-left-color: #0099d9;
}

.hotspot-tooltip {
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px) translateX(-50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 50;
}

.hotspot:hover .hotspot-tooltip,
.hotspot:focus-within .hotspot-tooltip,
.hotspot.is-active .hotspot-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) translateX(-50%);
}

.hotspot:hover .hotspot-tooltip[style*="translateY"],
.hotspot:focus-within .hotspot-tooltip[style*="translateY"],
.hotspot.is-active .hotspot-tooltip[style*="translateY"] {
    transform: translateY(-50%) scale(1) !important;
}

.panel-card {
    transition: all 0.25s ease;
}

.panel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -12px rgba(15, 23, 42, 0.25);
}

.check-item::before {
    content: "✓";
    color: #10b981;
    font-weight: 700;
    margin-right: 0.5rem;
}

.app-sidebar {
    width: 20rem;
    flex-shrink: 0;
    transition: transform 0.25s ease, margin-left 0.25s ease;
}

.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 21rem;
    z-index: 140;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #0099d9;
    border: 1px solid rgba(0, 153, 217, 0.25);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    transition: left 0.25s ease, background 0.2s ease, color 0.2s ease;
    pointer-events: auto;
}

.sidebar-toggle:hover {
    background: #0099d9;
    color: #ffffff;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.45);
}

body.sidebar-collapsed .app-sidebar {
    margin-left: -20rem;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 1rem;
}

#main-scroll-area {
    min-width: 0;
    width: 100%;
}

#main-scroll-area > div {
    box-sizing: border-box;
    width: 100%;
}

@media (min-width: 769px) {
    body {
        overflow: hidden;
    }

    #main-scroll-area {
        flex: 1 1 auto;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    body {
        display: block !important;
        min-height: 100vh;
        height: auto !important;
        overflow-y: auto !important;
    }

    body.sidebar-open {
        overflow: hidden !important;
        height: 100vh !important;
        touch-action: none;
    }

    .sidebar-toggle {
        top: 0.75rem;
        left: 0.75rem;
        z-index: 140;
    }

    body.sidebar-open .sidebar-toggle {
        left: calc(min(20rem, 86vw) - 3.5rem);
    }

    .app-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(20rem, 86vw);
        max-width: 86vw;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 130;
        margin-left: 0 !important;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
        pointer-events: auto !important;
    }

    .app-sidebar * {
        pointer-events: auto;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    body.sidebar-open #main-scroll-area {
        pointer-events: none;
        user-select: none;
    }

    #main-scroll-area {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        position: relative;
        z-index: 1;
    }

    #main-scroll-area > div {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 4.5rem 1rem 3rem !important;
        box-sizing: border-box;
    }

    #main-scroll-area > div > * {
        min-width: 0;
        max-width: 100%;
    }

    header h1 {
        font-size: 2rem;
        line-height: 1.25;
    }

    header h1 span {
        display: block;
        font-size: 1.25rem;
        line-height: 1.5;
        margin-top: 0.5rem;
    }

    section h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .gap-6,
    .gap-8 {
        gap: 1rem !important;
    }

    .overflow-x-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .hotspot-tooltip {
        display: none !important;
    }
}