/* WEAM Manual Styles */
:root {
    --weam-navy-dark: #1E3763;
    --weam-navy-light: #3B5F8A;
    --weam-cyan: #64D2FF;
    --weam-cyan-light: #E8F6FF;
    --weam-white: #FFFFFF;
    --weam-gray-100: #F8F9FA;
    --weam-gray-200: #E9ECEF;
    --weam-gray-300: #DEE2E6;
    --weam-gray-600: #6C757D;
    --weam-gray-800: #343A40;
    --weam-green: #28A745;
    --weam-orange: #FD7E14;
    --sidebar-width: 300px;
}

* {
    box-sizing: border-box;
}

body.weam-manual {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--weam-gray-100);
    color: var(--weam-gray-800);
    line-height: 1.6;
}

/* Header */
.manual-header {
    background: linear-gradient(135deg, var(--weam-navy-dark) 0%, var(--weam-navy-light) 100%);
    color: var(--weam-white);
    padding: 20px 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.manual-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.manual-header h1 .logo {
    background: var(--weam-cyan);
    color: var(--weam-navy-dark);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-search {
    position: relative;
}

.header-search input {
    padding: 8px 15px 8px 40px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    color: var(--weam-white);
    width: 250px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.header-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.header-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
    width: 300px;
}

.header-search .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

.version-badge {
    background: var(--weam-cyan);
    color: var(--weam-navy-dark);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Layout */
.manual-container {
    display: flex;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.manual-sidebar {
    width: var(--sidebar-width);
    background: var(--weam-white);
    border-right: 1px solid var(--weam-gray-200);
    position: fixed;
    top: 70px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-chapter {
    margin-bottom: 5px;
}

.sidebar-chapter > a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--weam-gray-800);
    text-decoration: none;
    font-weight: 600;
    gap: 10px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-chapter > a:hover,
.sidebar-chapter.active > a {
    background: var(--weam-cyan-light);
    color: var(--weam-navy-dark);
    border-left-color: var(--weam-cyan);
}

.sidebar-chapter.active > a {
    font-weight: 700;
}

.sidebar-chapter > a .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--weam-navy-light);
}

.sidebar-chapter .chapter-toggle {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.sidebar-chapter.expanded .chapter-toggle {
    transform: rotate(90deg);
}

.sidebar-sections {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    background: var(--weam-gray-100);
}

.sidebar-chapter.expanded .sidebar-sections {
    display: block;
}

.sidebar-section > a {
    display: flex;
    align-items: center;
    padding: 8px 20px 8px 48px;
    color: var(--weam-gray-600);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sidebar-section > a:hover,
.sidebar-section.active > a {
    color: var(--weam-navy-dark);
    background: var(--weam-cyan-light);
}

.sidebar-section.active > a {
    font-weight: 700;
}

.sidebar-section .section-toggle {
    margin-left: auto;
    font-size: 10px;
    color: var(--weam-gray-600);
    transition: transform 0.2s ease;
}

.sidebar-section.expanded .section-toggle {
    transform: rotate(90deg);
}

.sidebar-subsections {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.sidebar-subsection > a {
    display: block;
    padding: 6px 20px 6px 64px;
    color: var(--weam-gray-600);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.sidebar-subsection > a:hover,
.sidebar-subsection.active > a {
    color: var(--weam-navy-dark);
}

.sidebar-subsection.active > a {
    font-weight: 700;
}

/* Main Content */
.manual-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 50px;
    max-width: 900px;
}

.content-section {
    background: var(--weam-white);
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.content-section h2 {
    color: var(--weam-navy-dark);
    font-size: 28px;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--weam-cyan);
}

.content-section h3,
.content-section h4 {
    position: relative;
    padding-top: 30px;
    margin-top: 30px;
}

.content-section h3::before,
.content-section h4::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, #DEE2E6, transparent);
}

.content-section h2 + h3,
.content-section h2 + .badge + h3 {
    padding-top: 15px;
    margin-top: 15px;
}

.content-section h2 + h3::before,
.content-section h2 + .badge + h3::before {
    display: none;
}
    color: var(--weam-navy-dark);
    font-size: 22px;
    margin: 30px 0 15px 0;
}

.content-section h4 {
    color: var(--weam-navy-light);
    font-size: 18px;
    margin: 25px 0 10px 0;
}

.content-section p {
    margin: 0 0 15px 0;
}

.content-section ul, 
.content-section ol {
    margin: 0 0 15px 0;
    padding-left: 25px;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section code {
    background: var(--weam-gray-200);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.content-section a {
    color: var(--weam-navy-light);
    text-decoration: none;
    border-bottom: 1px solid var(--weam-cyan);
}

.content-section a:hover {
    color: var(--weam-navy-dark);
    border-bottom-color: var(--weam-navy-dark);
}

/* Image Placeholder */
.image-placeholder {
    background: linear-gradient(135deg, var(--weam-gray-200) 0%, var(--weam-gray-100) 100%);
    border: 2px dashed var(--weam-gray-300);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--weam-gray-300);
    margin-bottom: 15px;
}

.image-placeholder .image-number {
    background: var(--weam-navy-dark);
    color: var(--weam-white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

.image-placeholder p {
    color: var(--weam-gray-600);
    margin: 0;
    font-size: 14px;
}

/* Actual Images */
.manual-image {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--weam-gray-200);
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manual-image:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.manual-image-container {
    margin: 20px 0;
}

.manual-image-container .image-caption {
    text-align: center;
    color: var(--weam-gray-600);
    font-size: 13px;
    margin-top: 8px;
}

/* Lightbox */
.weam-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.weam-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    z-index: 1;
}

.lightbox-image {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.5);
    }
    
    .lightbox-image {
        max-width: 100vw;
        max-height: 85vh;
        border-radius: 0;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
    vertical-align: middle;
}

.badge-free {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-pro {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-proplus {
    background: #FFF3E0;
    color: #E65100;
}

/* Feature Table */
.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.feature-table th,
.feature-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--weam-gray-200);
}

.feature-table th {
    background: var(--weam-navy-dark);
    color: var(--weam-white);
    font-weight: 600;
}

.feature-table th:first-child {
    border-radius: 8px 0 0 0;
}

.feature-table th:last-child {
    border-radius: 0 8px 0 0;
}

.feature-table tr:nth-child(even) {
    background: var(--weam-gray-100);
}

.feature-table tr:hover {
    background: var(--weam-cyan-light);
}

.feature-table td:not(:first-child) {
    text-align: center;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--weam-gray-600);
}

.breadcrumb a {
    color: var(--weam-gray-600);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--weam-navy-dark);
}

.breadcrumb .separator {
    color: var(--weam-gray-300);
}

/* Navigation Buttons */
.section-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 25px 0;
    padding: 15px 0;
    border-bottom: 1px solid var(--weam-gray-200);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--weam-white);
    border: 1px solid var(--weam-gray-200);
    border-radius: 8px;
    text-decoration: none;
    color: var(--weam-gray-800);
    transition: all 0.2s ease;
    max-width: 45%;
}

.nav-btn:hover {
    border-color: var(--weam-cyan);
    background: var(--weam-cyan-light);
}

.nav-btn.prev {
    margin-right: auto;
}

.nav-btn.next {
    margin-left: auto;
    text-align: right;
}

.nav-btn .label {
    display: block;
    font-size: 12px;
    color: var(--weam-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-btn .title {
    display: block;
    font-weight: 600;
    color: var(--weam-navy-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.nav-btn .dashicons {
    color: var(--weam-cyan);
    font-size: 20px;
}

/* Chapter intro */
.chapter-intro {
    font-size: 18px;
    color: var(--weam-gray-600);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Topic Cards - for chapter overview */
.topic-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.topic-card {
    display: block;
    padding: 24px;
    background: var(--weam-white);
    border: 1px solid var(--weam-gray-200);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-card:hover {
    border-color: var(--weam-cyan);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.topic-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--weam-navy-dark);
}

.topic-card p {
    margin: 0;
    font-size: 14px;
    color: var(--weam-gray-600);
    line-height: 1.5;
}

.topic-card .topic-count {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 10px;
    background: var(--weam-gray-100);
    border-radius: 12px;
    font-size: 12px;
    color: var(--weam-gray-600);
}

/* Subsection Cards - for section pages */
.subsection-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--weam-gray-200);
}

.subsection-card {
    display: block;
    padding: 18px;
    background: var(--weam-gray-100);
    border: 1px solid var(--weam-gray-200);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.subsection-card:hover {
    background: var(--weam-cyan-light);
    border-color: var(--weam-cyan);
}

.subsection-card h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: var(--weam-navy-dark);
}

.subsection-card p {
    margin: 0;
    font-size: 13px;
    color: var(--weam-gray-600);
    line-height: 1.4;
}

.subsection-card .badge {
    margin-left: 8px;
    font-size: 10px;
    padding: 2px 6px;
}

/* Admin Panel */
.admin-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #FFFFFF !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 20px;
    z-index: 9998;
    display: none;
    width: 350px;
    border: 1px solid #DEE2E6;
}

.admin-panel.active {
    display: block;
}

.admin-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1E3763 !important;
}

.admin-panel .btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    background: #F8F9FA !important;
    color: #343A40 !important;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    background: #E8F6FF !important;
    border-color: #64D2FF;
}

.admin-btn .dashicons {
    color: #3B5F8A !important;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.admin-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1E3763 !important;
    color: #FFFFFF !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: all 0.2s ease;
}

.admin-toggle:hover {
    background: #3B5F8A !important;
    transform: scale(1.1);
}

.admin-toggle .dashicons {
    color: #FFFFFF !important;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.admin-toggle.hidden {
    display: none;
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--weam-white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--weam-gray-200);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: var(--weam-cyan-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item .result-title {
    font-weight: 600;
    color: var(--weam-navy-dark);
    margin-bottom: 4px;
}

.search-result-item .result-path {
    font-size: 12px;
    color: var(--weam-gray-600);
}

.search-result-item mark {
    background: var(--weam-cyan);
    color: var(--weam-navy-dark);
    padding: 0 2px;
    border-radius: 2px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .manual-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 150;
    }
    
    .manual-sidebar.open {
        transform: translateX(0);
    }
    
    .manual-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 30px;
    }
    
    .back-text {
        display: none;
    }
}

@media (max-width: 768px) {
    .manual-header {
        padding: 15px 20px;
    }
    
    .manual-header h1 {
        font-size: 18px;
    }
    
    .title-text {
        display: none;
    }
    
    .header-search {
        display: none;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .content-section h2 {
        font-size: 22px;
    }
    
    .admin-toggle {
        bottom: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }
    
    .admin-panel {
        left: 15px;
        right: 15px;
        bottom: 70px;
        width: auto;
    }
    
    .section-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        max-width: 100%;
    }
    
    .nav-btn .title {
        max-width: 100%;
    }
    
    .topic-cards {
        grid-template-columns: 1fr;
    }
    
    .subsection-cards {
        grid-template-columns: 1fr;
    }
    
    .chapter-intro {
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .manual-header,
    .manual-sidebar,
    .admin-panel,
    .admin-toggle,
    .section-nav {
        display: none !important;
    }
    
    .manual-content {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    
    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.content-section {
    animation: fadeIn 0.3s ease;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--weam-gray-600);
}

.loading-indicator .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--weam-cyan);
    margin-bottom: 15px;
}

.loading-indicator .dashicons.spin {
    animation: spin 1s linear infinite;
}

/* Mobile Menu Toggle - HIDDEN on desktop */
.mobile-menu-toggle {
    display: none !important;
    position: fixed;
    top: 80px;
    left: 15px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--weam-white);
    border: 1px solid var(--weam-gray-200);
    cursor: pointer;
    z-index: 200;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-menu-toggle .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--weam-navy-dark);
}

/* Only show mobile menu toggle on small screens */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Nav Badges */
.nav-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-badge.pro {
    background: #E3F2FD;
    color: #1565C0;
}

.nav-badge.proplus {
    background: #FFF3E0;
    color: #E65100;
}

/* Admin Panel Close */
.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.admin-panel-header h3 {
    margin: 0;
}

.admin-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--weam-gray-600);
}

.admin-panel-close:hover {
    color: var(--weam-gray-800);
}

.admin-note {
    font-size: 12px;
    color: var(--weam-gray-600);
    margin-top: 15px;
    margin-bottom: 0;
}

/* Header improvements */
.logo-link {
    text-decoration: none;
    color: inherit;
}

.back-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 1;
}

/* Admin Dropdown in Header */
.admin-dropdown {
    position: relative;
}

.admin-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #64D2FF;
    color: #1E3763;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-dropdown-toggle:hover {
    background: #FFFFFF;
}

.admin-dropdown-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.admin-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 180px;
    z-index: 1000;
}

.admin-dropdown-menu.active {
    display: block;
}

.admin-dropdown-menu .admin-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #343A40;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.admin-dropdown-menu .admin-btn:hover {
    background: #E8F6FF;
}

.admin-dropdown-menu .admin-btn .dashicons {
    color: #3B5F8A;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Scrollbar Styling */
.manual-sidebar::-webkit-scrollbar {
    width: 6px;
}

.manual-sidebar::-webkit-scrollbar-track {
    background: var(--weam-gray-100);
}

.manual-sidebar::-webkit-scrollbar-thumb {
    background: var(--weam-gray-300);
    border-radius: 3px;
}

.manual-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--weam-gray-600);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--weam-cyan);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   WEAM Manual v2.0 Additions
   Preview banner, staging notice, status badges,
   rollback modal, admin image controls
   ═══════════════════════════════════════════════════ */

/* Preview Banner */
.preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: linear-gradient(90deg, #E65100, #F57C00);
    color: #FFFFFF;
    padding: 10px 30px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.3);
}

.preview-banner .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.preview-banner-link {
    margin-left: auto;
    color: #FFFFFF;
    text-decoration: underline;
    font-weight: 600;
}

.preview-banner-link:hover {
    opacity: 0.9;
}

body.is-preview .manual-header {
    top: 42px;
}

body.is-preview .manual-container {
    margin-top: 112px;
}

body.is-preview .manual-sidebar {
    top: 112px;
}

body.is-preview .mobile-menu-toggle {
    top: 122px;
}

/* Staging Notice */
.staging-notice {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
    background: #E3F2FD;
    color: #1565C0;
    padding: 10px 30px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #90CAF9;
}

.staging-notice .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.staging-notice a {
    color: #1565C0;
    font-weight: 600;
    margin-left: 10px;
}
.staging-notice a.staging-review-link {
    color: #b26200;
    border: 1px solid #b26200;
    padding: 2px 8px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
}
.staging-notice a.staging-review-link:hover {
    background: #b26200;
    color: #fff;
}

body:has(.staging-notice) .manual-container {
    margin-top: 108px;
}

body:has(.staging-notice) .manual-sidebar {
    top: 108px;
}

/* Status Badges (admin/preview only) */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
}

.status-badge.status-new {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-badge.status-changed {
    background: #FFF3E0;
    color: #E65100;
}

.status-badge.status-removed {
    background: #FFEBEE;
    color: #C62828;
}

.status-badge.status-needs-review {
    background: #FFF8E1;
    color: #F57F17;
}

/* Status-colored cards */
.topic-card.card-status-new,
.subsection-card.card-status-new {
    border-left: 4px solid #2E7D32;
}

.topic-card.card-status-changed,
.subsection-card.card-status-changed {
    border-left: 4px solid #E65100;
}

.topic-card.card-status-removed,
.subsection-card.card-status-removed {
    border-left: 4px solid #C62828;
    opacity: 0.6;
}

.topic-card.card-status-needs-review,
.subsection-card.card-status-needs-review {
    border-left: 4px solid #F57F17;
}

/* Admin Image Controls */
.admin-img-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--weam-gray-100);
    border: 1px solid var(--weam-gray-200);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
}

.admin-img-filename {
    color: var(--weam-gray-600);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
}

.admin-img-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--weam-gray-600);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.admin-img-delete:hover {
    color: #C62828;
    background: #FFEBEE;
}

.admin-img-delete .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.admin-img-controls + .manual-image {
    border-radius: 0 0 8px 8px;
    margin-top: 0;
}

/* Rollback Modal */
.rollback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.rollback-modal.active {
    display: flex;
}

.rollback-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.rollback-modal-content {
    position: relative;
    background: var(--weam-white);
    border-radius: 12px;
    padding: 30px;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.rollback-modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: var(--weam-navy-dark);
}

.rollback-modal-content > p {
    margin: 0 0 20px 0;
    color: var(--weam-gray-600);
    font-size: 14px;
}

.rollback-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.rollback-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid var(--weam-gray-200);
    border-radius: 8px;
    background: var(--weam-gray-100);
    transition: all 0.2s ease;
}

.rollback-item:hover {
    border-color: var(--weam-cyan);
    background: var(--weam-cyan-light);
}

.rollback-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rollback-info strong {
    font-size: 14px;
    color: var(--weam-gray-800);
}

.rollback-meta {
    font-size: 12px;
    color: var(--weam-gray-600);
}

.rollback-file {
    font-size: 11px;
    color: var(--weam-gray-600);
    font-family: 'Monaco', 'Consolas', monospace;
}

.rollback-restore {
    padding: 8px 16px;
    border: 1px solid var(--weam-navy-light);
    border-radius: 6px;
    background: var(--weam-white);
    color: var(--weam-navy-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rollback-restore:hover {
    background: var(--weam-navy-dark);
    color: var(--weam-white);
}

.rollback-actions {
    display: flex;
    justify-content: flex-end;
}

.rollback-cancel {
    padding: 10px 24px;
    border: 1px solid var(--weam-gray-300);
    border-radius: 6px;
    background: var(--weam-white);
    color: var(--weam-gray-800);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rollback-cancel:hover {
    background: var(--weam-gray-100);
}

/* Admin Dropdown Extras */
.admin-dropdown-divider {
    height: 1px;
    background: var(--weam-gray-200);
    margin: 6px 0;
}

.admin-btn-accent {
    color: #1565C0 !important;
}

.admin-btn-accent .dashicons {
    color: #1565C0 !important;
}

.admin-btn-publish {
    color: #2E7D32 !important;
}

.admin-btn-publish .dashicons {
    color: #2E7D32 !important;
}

.admin-btn-danger {
    color: #C62828 !important;
}

.admin-btn-danger .dashicons {
    color: #C62828 !important;
}

/* ─────────────── Inline Editing ─────────────── */

.inline-edit-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 8px;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s;
    color: #666;
    line-height: 1;
}

.content-section:hover .inline-edit-btn,
.chapter-intro:hover .inline-edit-btn {
    opacity: 1;
}

.inline-edit-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
    color: #0073aa;
}

.inline-edit-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.inline-delete-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 2px;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s;
    color: #999;
    line-height: 1;
}
.content-section:hover .inline-delete-btn,
.chapter-intro:hover .inline-delete-btn {
    opacity: 1;
}
.inline-delete-btn:hover {
    background: #fef0f0;
    border-color: #d63638;
    color: #d63638;
}
.inline-delete-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* Editor overlay */
.inline-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.inline-editor {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.inline-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.inline-editor-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-editor-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.inline-editor-close:hover {
    color: #333;
    background: #f0f0f0;
}

.inline-editor-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.inline-editor-body label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 6px 0;
}

.inline-editor-body label:not(:first-child) {
    margin-top: 16px;
}

.editor-hint {
    font-weight: 400;
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

/* ── Rich Text Editor (RTE) ─────────────────── */
.rte-toolbar {
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: #f7f7f7;
    padding: 0;
    user-select: none;
}
.rte-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px 6px;
    gap: 2px;
}
.rte-toolbar-row + .rte-toolbar-row {
    border-top: 1px solid #e0e0e0;
}
.rte-group {
    display: flex;
    align-items: center;
    gap: 1px;
}
.rte-sep {
    width: 1px;
    height: 22px;
    background: #d0d0d0;
    margin: 0 4px;
    flex-shrink: 0;
}
.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 5px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: none;
    color: #444;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}
.rte-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}
.rte-btn.active {
    background: #d4e7f6;
    border-color: #0073aa;
    color: #0073aa;
}
.rte-btn.rte-disabled,
.rte-btn[disabled] {
    opacity: 0.4;
    pointer-events: none;
}
.rte-select {
    height: 28px;
    padding: 0 4px;
    font-size: 12px;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
    color: #333;
    cursor: pointer;
    max-width: 120px;
}
.rte-select.rte-disabled,
.rte-select[disabled] {
    opacity: 0.4;
    pointer-events: none;
}
.rte-color-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.1s;
}
.rte-color-wrap:hover {
    background: #e8e8e8;
    border-color: #ccc;
}
.rte-color-icon {
    font-weight: 700;
    font-size: 14px;
    color: #c00;
    pointer-events: none;
}
.rte-color-icon.rte-bg-icon {
    background: #ff0;
    color: #333;
    padding: 0 2px;
    border-radius: 2px;
    font-size: 12px;
}
.rte-color {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    padding: 0;
}
.rte-color.rte-disabled,
.rte-color[disabled] {
    pointer-events: none;
}
.rte-source-toggle {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    letter-spacing: -1px;
}
/* Contenteditable area */
.rte-editor {
    display: block;
    width: 100%;
    min-height: 180px;
    max-height: 45vh;
    overflow-y: auto;
    padding: 10px 14px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
    background: #fff;
    color: #1d2327;
    outline: none;
    transition: border-color 0.15s;
}
.rte-editor:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}
.rte-editor p { margin: 0 0 0.8em 0; }
.rte-editor h1, .rte-editor h2, .rte-editor h3, .rte-editor h4 {
    margin: 0.6em 0 0.3em 0;
    line-height: 1.3;
}
.rte-editor ul, .rte-editor ol { margin: 0.3em 0; padding-left: 1.5em; }
.rte-editor pre {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    overflow-x: auto;
}
.rte-editor a { color: #0073aa; text-decoration: underline; }
.rte-editor img { max-width: 100%; height: auto; }
/* Source textarea (shown when toggled) */
.rte-source {
    display: none;
    width: 100%;
    min-height: 180px;
    max-height: 45vh;
    padding: 10px 14px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    line-height: 1.6;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
    resize: vertical;
    background: #2d2d2d;
    color: #e6e6e6;
    outline: none;
    tab-size: 2;
}
.rte-source:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* ── Image Picker Popup ─────────────────────── */
.rte-image-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}
.rte-image-popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease;
}
.rte-image-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e0e0e0;
}
.rte-image-popup-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}
.rte-image-popup-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 1;
}
.rte-image-popup-close:hover { color: #333; background: #f0f0f0; }
/* Tabs */
.rte-image-popup-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 18px;
    gap: 0;
}
.rte-img-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.rte-img-tab:hover { color: #1d2327; }
.rte-img-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}
/* Panels */
.rte-image-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    min-height: 200px;
}
.rte-img-panel { display: none; }
.rte-img-panel.active { display: block; }
/* Browse grid */
.rte-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.rte-img-grid-loading,
.rte-img-empty {
    text-align: center;
    padding: 30px 0;
    color: #999;
    font-size: 13px;
}
.rte-img-thumb {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
    background: #fafafa;
}
.rte-img-thumb:hover {
    border-color: #999;
}
.rte-img-thumb.selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}
.rte-img-thumb img {
    display: block;
    width: 100%;
    height: 80px;
    object-fit: cover;
}
.rte-img-thumb-name {
    display: block;
    font-size: 10px;
    color: #666;
    padding: 3px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Upload tab */
.rte-img-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.rte-img-upload-zone:hover,
.rte-img-upload-zone.dragover {
    border-color: #0073aa;
    background: #f0f7fc;
}
.rte-img-upload-label {
    font-size: 14px;
    color: #555;
    pointer-events: none;
}
.rte-img-upload-label small {
    color: #999;
    font-size: 12px;
}
.rte-img-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.rte-img-upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}
.rte-img-upload-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.rte-img-upload-fill {
    height: 100%;
    width: 0;
    background: #0073aa;
    border-radius: 4px;
    transition: width 0.2s;
}
.rte-img-upload-status {
    font-size: 12px;
    color: #666;
    min-width: 36px;
}
.rte-img-upload-result {
    text-align: center;
    padding: 10px 0;
}
.rte-img-upload-result img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.rte-img-upload-result span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}
/* URL tab */
.rte-img-url-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    display: block;
    margin-bottom: 6px;
}
.rte-img-url-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.rte-img-url-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}
.rte-img-url-preview {
    margin-top: 12px;
    text-align: center;
}
.rte-img-url-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
/* Footer */
.rte-image-popup-footer {
    border-top: 1px solid #e0e0e0;
    padding: 12px 18px;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}
.rte-img-size-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.rte-img-size-row label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rte-img-size-row input {
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 80px;
}
.rte-img-size-row input:focus {
    outline: none;
    border-color: #0073aa;
}
.rte-img-size-row label:last-child input {
    width: 160px;
}
.rte-img-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.rte-img-cancel {
    padding: 7px 14px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
}
.rte-img-cancel:hover { background: #f0f0f0; }
.rte-img-insert {
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.rte-img-insert:hover { background: #005a87; }
.rte-img-insert:disabled {
    background: #999;
    cursor: not-allowed;
}

.inline-editor-title {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.inline-editor-title:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.inline-editor-content {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    line-height: 1.6;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.15s;
}

.inline-editor-content:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.inline-editor-version {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.inline-editor-version:focus {
    outline: none;
    border-color: #0073aa;
}

.inline-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.inline-editor-cancel {
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
}

.inline-editor-cancel:hover {
    background: #f0f0f0;
}

.inline-editor-save {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.inline-editor-save:hover {
    background: #005a87;
}

.inline-editor-save:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Save toast */
.inline-edit-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2E7D32;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100001;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.inline-edit-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Scan Progress Overlay ───────────────────── */
.scan-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 100003;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}
.scan-progress-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 32px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    animation: slideUp 0.2s ease;
}
.scan-progress-icon {
    color: #0073aa;
    margin-bottom: 12px;
}
.scan-progress-title {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 700;
    color: #1d2327;
}
.scan-progress-status {
    font-size: 13px;
    color: #666;
    margin: 0 0 18px 0;
    line-height: 1.4;
}
.scan-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 18px;
}
.scan-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 3px;
    transition: width 0.8s ease;
}
.scan-progress-cancel {
    padding: 7px 18px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
}
.scan-progress-cancel:hover { background: #f0f0f0; }
.scan-result-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}
.scan-btn-review {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.scan-btn-review:hover { background: #005a87; }
.scan-btn-download {
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid #0073aa;
    border-radius: 4px;
    background: #fff;
    color: #0073aa;
    cursor: pointer;
    transition: background 0.15s;
}
.scan-btn-download:hover { background: #f0f7fc; }
.scan-btn-close {
    padding: 8px 16px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
}
.scan-btn-close:hover { background: #f0f0f0; }

/* ── Diff Review Panel ───────────────────────── */
.diff-review-overlay {
    position: fixed;
    inset: 0;
    z-index: 100003;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}
.diff-review-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s ease;
}
.diff-review-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}
.diff-review-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1d2327;
    white-space: nowrap;
}
.diff-review-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}
.diff-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.diff-badge-new { background: #e8f5e9; color: #2e7d32; }
.diff-badge-changed { background: #fff3e0; color: #e65100; }
.diff-badge-unchanged { background: #f5f5f5; color: #888; }
.diff-badge-local_only { background: #e3f2fd; color: #1565c0; }
.diff-badge-removed { background: #fce4ec; color: #c62828; }
.diff-review-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.diff-review-close:hover { color: #333; background: #f0f0f0; }
/* Toolbar: filters + bulk actions */
.diff-review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 8px;
}
.diff-filter-tabs {
    display: flex;
    gap: 2px;
}
.diff-filter {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}
.diff-filter:hover { background: #f0f0f0; }
.diff-filter.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}
.diff-bulk-actions {
    display: flex;
    gap: 6px;
}
.diff-bulk-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
}
.diff-bulk-btn:hover { background: #f0f0f0; border-color: #999; }
/* Body: scrollable diff rows */
.diff-review-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.diff-row {
    border-bottom: 1px solid #eee;
    transition: background 0.1s;
}
.diff-row:hover { background: #fafafa; }
.diff-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
}
.diff-indent-1 .diff-row-header { padding-left: 44px; }
.diff-indent-2 .diff-row-header { padding-left: 68px; }
.diff-row-icon { font-size: 14px; flex-shrink: 0; }
.diff-row-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.diff-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.diff-status-new { background: #e8f5e9; color: #2e7d32; }
.diff-status-changed { background: #fff3e0; color: #e65100; }
.diff-status-unchanged { background: #f5f5f5; color: #aaa; }
.diff-status-local_only { background: #e3f2fd; color: #1565c0; }
.diff-status-removed { background: #fce4ec; color: #c62828; }
.diff-action-select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.diff-action-select:focus { outline: none; border-color: #0073aa; }
.diff-lock {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 4px;
    opacity: 0.35;
    transition: opacity 0.15s;
}
.diff-lock:hover { opacity: 0.7; }
.diff-lock:has(.diff-lock-cb:checked) { opacity: 1; color: #d63638; }
.diff-lock .dashicons { font-size: 14px; width: 14px; height: 14px; line-height: 14px; }
.diff-lock-cb { display: none; }
.diff-expand-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    flex-shrink: 0;
}
.diff-expand-btn:hover { background: #f0f0f0; border-color: #999; }
/* Side-by-side comparison */
.diff-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid #e8e8e8;
    background: #f9f9f9;
}
.diff-side {
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
}
.diff-side-current { border-right: 1px solid #e0e0e0; }
.diff-side-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}
.diff-side-current .diff-side-label { color: #1565c0; }
.diff-side-incoming .diff-side-label { color: #e65100; }
.diff-side-content { font-size: 12px; color: #333; }
.diff-field { margin-bottom: 8px; }
.diff-field strong { color: #555; font-size: 11px; text-transform: uppercase; }
.diff-content-preview {
    margin-top: 4px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
}
.diff-empty { color: #999; }
/* Row status left-border accents */
.diff-row-new { border-left: 3px solid #4caf50; }
.diff-row-changed { border-left: 3px solid #ff9800; }
.diff-row-unchanged { border-left: 3px solid #eee; }
.diff-row-local_only { border-left: 3px solid #2196f3; }
.diff-row-removed { border-left: 3px solid #ef5350; }
/* Footer */
.diff-review-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 0 0 10px 10px;
}
.diff-cancel-btn {
    padding: 8px 18px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
}
.diff-cancel-btn:hover { background: #f0f0f0; }
.diff-apply-btn {
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.diff-apply-btn:hover { background: #005a87; }
.diff-apply-btn:disabled { background: #999; cursor: not-allowed; }

/* Mobile */
@media (max-width: 768px) {
    .inline-editor {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 8px 8px 0 0;
    }
    .inline-editor-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .rte-toolbar-row {
        flex-wrap: wrap;
        gap: 2px;
        padding: 3px 4px;
    }
    .rte-sep {
        display: none;
    }
    .rte-select {
        max-width: 90px;
        font-size: 11px;
    }
    .rte-btn {
        min-width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .rte-editor,
    .rte-source {
        min-height: 140px;
    }
    .rte-image-popup {
        max-width: 100%;
        max-height: 90vh;
    }
    .rte-image-popup-overlay {
        padding: 10px;
    }
    .rte-img-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }
    .rte-img-size-row {
        flex-direction: column;
        gap: 8px;
    }
    .rte-img-size-row label:last-child input {
        width: 100%;
    }
    /* Diff review mobile */
    .diff-review-panel {
        max-width: 100%;
        max-height: 95vh;
    }
    .diff-review-overlay {
        padding: 10px;
    }
    .diff-review-header {
        flex-wrap: wrap;
    }
    .diff-filter-tabs {
        flex-wrap: wrap;
    }
    .diff-comparison {
        grid-template-columns: 1fr;
    }
    .diff-side-current {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .diff-row-header {
        flex-wrap: wrap;
    }
    .diff-indent-1 .diff-row-header { padding-left: 30px; }
    .diff-indent-2 .diff-row-header { padding-left: 44px; }
}
