        /* Lia Diplomat font for chart tooltips only */
        
        @font-face {
            font-family: 'Lia Diplomat';
            src: url('/fonts/LiaDiplomat-Regular.woff2') format('woff2');
            font-weight: 400;
            font-style: normal;
            font-display: swap;
        }
        @font-face {
            font-family: 'Lia Diplomat';
            src: url('/fonts/LiaDiplomat-Bold.woff2') format('woff2');
            font-weight: 700;
            font-style: normal;
            font-display: swap;
        }

        body {
            font-family: 'Assistant', sans-serif;
        }
        .glass-panel {
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(166, 234, 199, 0.2);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
        }
        .sidebar-link.active {
            background-color: #F0FDFA;
            color: #0F766E;
            border-right: 3px solid #A6EAC7;
        }
        /* v2130: Mobile sidebar is always dark (#1C2734) — force light text regardless of theme toggle */
        #sidebar-mobile .sidebar-link {
            color: #C8D8E4 !important;
        }
        #sidebar-mobile .sidebar-link:hover,
        #sidebar-mobile .sidebar-link:active {
            background: rgba(255,255,255,0.07) !important;
            color: #E8EFF6 !important;
        }
        #sidebar-mobile .sidebar-link.active {
            background: rgba(166,234,199,0.15) !important;
            color: #A6EAC7 !important;
            border-right-color: #7AC4A4 !important;
        }
        /* Section headers in mobile sidebar */
        #sidebar-mobile .text-slate-400 {
            color: #6B8494 !important;
        }
        /* Disabled nav items */
        #sidebar-mobile span.cursor-not-allowed {
            color: #4A6070 !important;
        }

        .custom-scroll::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        .custom-scroll::-webkit-scrollbar-track {
            background: transparent;
        }
        .custom-scroll::-webkit-scrollbar-thumb {
            background: #CBD5E1;
            border-radius: 3px;
        }
        
        /* Custom Icon Animations */
        .dashboard-bar {
            transform-origin: bottom;
            transition: transform 0.3s ease;
        }
        .sidebar-link:hover .dashboard-bar-1 {
            animation: bar-grow 1.2s ease-in-out infinite;
        }
        .sidebar-link:hover .dashboard-bar-2 {
            animation: bar-grow 1.2s ease-in-out 0.2s infinite;
        }
        .sidebar-link:hover .dashboard-bar-3 {
            animation: bar-grow 1.2s ease-in-out 0.4s infinite;
        }
        @keyframes bar-grow {
            0%, 100% { transform: scaleY(1); }
            50% { transform: scaleY(0.7); }
        }
        
        .search-icon {
            transition: transform 0.3s ease;
        }
        .sidebar-link:hover .search-icon {
            animation: search-scan 1.5s ease-in-out infinite;
        }
        @keyframes search-scan {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        
        .sidebar-link:hover .trend-line {
            animation: line-draw 1.5s ease-in-out infinite;
        }
        @keyframes line-draw {
            0% { stroke-dasharray: 0 100; }
            50% { stroke-dasharray: 100 0; }
            100% { stroke-dasharray: 0 100; }
        }
        
        .clock-hand {
            transform-origin: 12px 12px;
        }
        .sidebar-link:hover .clock-hand-minute {
            animation: clock-spin-minute 2s linear infinite;
        }
        .sidebar-link:hover .clock-hand-hour {
            animation: clock-spin-hour 4s linear infinite;
        }
        @keyframes clock-spin-minute {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes clock-spin-hour {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        .article-line {
            stroke-dasharray: 8;
            stroke-dashoffset: 8;
        }
        .sidebar-link:hover .article-line-1 {
            animation: write-line 0.6s ease-out forwards;
        }
        .sidebar-link:hover .article-line-2 {
            animation: write-line 0.6s ease-out 0.2s forwards;
        }
        .sidebar-link:hover .article-line-3 {
            animation: write-line 0.4s ease-out 0.4s forwards;
        }
        @keyframes write-line {
            from { stroke-dashoffset: 8; }
            to { stroke-dashoffset: 0; }
        }
        
        .gear-icon {
            transform-origin: 10px 10px;
        }
        .sidebar-link:hover .gear-icon {
            animation: gear-rotate 2s linear infinite;
        }
        @keyframes gear-rotate {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        /* v1168: new sidebar icon animations */

        /* אסטרטגיית תוכן — target pulse */
        .target-icon { transform-box: fill-box; transform-origin: center; }
        .sidebar-link:hover .target-icon {
            animation: target-focus 1.5s ease-in-out infinite;
        }
        @keyframes target-focus {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.12); opacity: 0.85; }
        }

        /* תוכן קיים — dots wave */
        .content-dot { transform-box: fill-box; transform-origin: center; }
        .sidebar-link:hover .content-dot-1 { animation: dot-wave 1.2s ease-in-out infinite; }
        .sidebar-link:hover .content-dot-2 { animation: dot-wave 1.2s ease-in-out 0.14s infinite; }
        .sidebar-link:hover .content-dot-3 { animation: dot-wave 1.2s ease-in-out 0.28s infinite; }
        .sidebar-link:hover .content-dot-4 { animation: dot-wave 1.2s ease-in-out 0.42s infinite; }
        .sidebar-link:hover .content-dot-5 { animation: dot-wave 1.2s ease-in-out 0.56s infinite; }
        @keyframes dot-wave {
            0%, 100% { opacity: 0.4; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.4); }
        }

        /* אופטימיזציה — bolt flash */
        .bolt-icon { transform-box: fill-box; transform-origin: center; }
        .sidebar-link:hover .bolt-icon {
            animation: bolt-flash 0.9s ease-in-out infinite;
        }
        @keyframes bolt-flash {
            0%, 100% { opacity: 1; transform: scale(1); }
            40% { opacity: 0.6; transform: scale(1.1); filter: brightness(1.6); }
        }

        /* GEO — outer ring spin */
        .geo-ring { transform-box: fill-box; transform-origin: center; }
        .sidebar-link:hover .geo-ring {
            animation: geo-spin 4s linear infinite;
        }
        @keyframes geo-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* חשבון — head bob */
        .account-head { transform-box: fill-box; transform-origin: center; }
        .sidebar-link:hover .account-head {
            animation: account-bob 1.5s ease-in-out infinite;
        }
        @keyframes account-bob {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-2px); }
        }

        
        /* v340: Fix fetch credentials for SameSite cookies - v21: Achievement Animations */
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }
        
        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }
        
        .shimmer {
            background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.8) 50%, transparent 100%);
            animation: shimmer 2.5s infinite linear;
        }
        
        .tooltip-achievements {
            visibility: hidden;
            opacity: 0;
            transition: opacity 0.2s, transform 0.2s;
        }
        .group:hover .tooltip-achievements {
            visibility: visible;
            opacity: 1;
        }

        header h1{font-size:18px !important;font-weight:700 !important;}
h1,h2,h3{font-family:'LiaElement',sans-serif !important;font-weight:900 !important;}h1{font-size:32px !important;}h2{font-size:26px !important;}h3{font-size:22px !important;}

        /* Star Logo Animation */
        .star-anchor {
            position: relative;
            width: 25px;
        }

        .stars-wrapper {
            position: absolute;
            top: 50%;
            transform: translateY(calc(-50% + 0.5px));
            right: 0;
            display: flex;
            align-items: center;
            gap: 0;
            width: 25px;
            height: 21px;
            overflow: hidden;
            padding: 0 2px;
            transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
            border-radius: 50px;
        }

        .trigger-container:hover .stars-wrapper {
            width: 112px;
        }

        .star-icon {
            width: 21px;
            height: 21px;
            min-width: 21px;
            color: #A6EAC7;
            fill: currentColor;
            transition: opacity 0.8s ease-out, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
        }

        .star-icon:not(:first-child) {
            opacity: 0;
            transform: translateX(20px) scale(0.1);
        }

        .trigger-container:hover .star-icon {
            opacity: 1;
            transform: translateX(0) scale(1);
        }

        .trigger-container:hover .star-icon:nth-child(2) { transition-delay: 0.1s; }
        .trigger-container:hover .star-icon:nth-child(3) { transition-delay: 0.2s; }
        .trigger-container:hover .star-icon:nth-child(4) { transition-delay: 0.3s; }
        .trigger-container:hover .star-icon:nth-child(5) { transition-delay: 0.4s; }

        .star-icon:nth-child(5) { transition-delay: 0s; }
        .star-icon:nth-child(4) { transition-delay: 0.05s; }
        .star-icon:nth-child(3) { transition-delay: 0.1s; }
        .star-icon:nth-child(2) { transition-delay: 0.15s; }

    
        /* Hide achievement in circles if it's already shown as next achievement */
        <?php if (isset($next_achievement) && isset($next_achievement['id'])): ?>
        [data-achievement-id="<?= $next_achievement['id'] ?>"] {
            display: none !important;
        }
        <?php endif; ?>
    </style>
<style>
/* v340: Fix fetch credentials for SameSite cookies - v295: Confetti Animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--seo-mint);
    animation: confetti-fall 3s ease-out forwards;
}

/* v340: Fix fetch credentials for SameSite cookies - v295: Progress Bar Pulse */
@keyframes progress-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(122, 196, 164, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(122, 196, 164, 0);
    }
}

.progress-celebrating {
    animation: progress-pulse 0.6s ease-out 2;
}

/* v340: Fix fetch credentials for SameSite cookies - v295: Success Message */
@keyframes success-fade {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(0) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
}

.success-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--seo-mint) 0%, var(--seo-mint-dark) 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: success-fade 2.5s ease-out forwards;
    pointer-events: none;
}

        /* Hide achievement in circles if it's already shown as next achievement */
        <?php if (isset($next_achievement) && isset($next_achievement['id'])): ?>
        [data-achievement-id="<?= $next_achievement['id'] ?>"] {
            display: none !important;
        }
        <?php endif; ?>

/* v603: Toast Notification Styles - Fixed positioning */
#toast-container {
    position: fixed !important;
    top: 24px !important;
    left: 24px !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    max-width: 420px !important;
    right: auto !important;  /* v605: Override any right positioning */
}

.toast {
    display: block !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(28, 39, 52, 0.12);
    margin-bottom: 12px;
    opacity: 0;
    transform: translateX(-400px);  /* v604: Negative for RTL (slide from left) */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid;  /* v604: Changed from right to left for RTL */
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-family: 'Assistant', sans-serif;
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1C2734;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #91A0AF;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #1C2734;
}

/* Toast type colors */
.toast-success {
    border-left-color:  /* v604: RTL */ #A6EAC7;
}

.toast-success .toast-icon {
    color: #A6EAC7;
}

.toast-error {
    border-left-color:  /* v604: RTL */ #EF4444;
}

.toast-error .toast-icon {
    color: #EF4444;
}

.toast-warning {
    border-left-color:  /* v604: RTL */ #F9D99A;
}

.toast-warning .toast-icon {
    color: #F9D99A;
}

.toast-info {
    border-left-color:  /* v604: RTL */ #3B82F6;
}

.toast-info .toast-icon {
    color: #3B82F6;
}

/* ── Mobile Responsive ─────────────────────────────── */
@media (max-width: 767px) {
    /* Reduce main content padding */
    main.flex-1 {
        padding: 12px !important;
    }
    /* Tighten spacing */
    .space-y-6 > * + * {
        margin-top: 12px !important;
    }
    /* Make glass-panel cards feel better on mobile */
    .glass-panel {
        padding: 16px !important;
    }
}

/* ── Stat Card Hover — Lift + Accent Bar + Icon Glow (v1138) ── */
.glass-panel {
    transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1),
                box-shadow 0.28s ease,
                background 0.28s ease,
                border-color 0.28s ease !important;
}
.glass-panel .w-10.rounded-xl {
    transition: transform 0.28s cubic-bezier(0.34, 1.5, 0.64, 1),
                box-shadow 0.28s ease;
}
.glass-panel:hover .w-10.rounded-xl {
    transform: scale(1.14);
}
.glass-panel:has(.bg-purple-100):hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 20px 40px -8px rgba(196, 181, 253, 0.35),
                0 4px 16px -4px rgba(0, 0, 0, 0.05),
                inset 0 -3px 0 #C4B5FD !important;
}
.glass-panel:has(.bg-purple-100):hover .w-10.rounded-xl {
    box-shadow: 0 6px 18px rgba(196, 181, 253, 0.5);
}
.glass-panel:has(.bg-emerald-100):hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 20px 40px -8px rgba(110, 231, 183, 0.35),
                0 4px 16px -4px rgba(0, 0, 0, 0.05),
                inset 0 -3px 0 #6EE7B7 !important;
}
.glass-panel:has(.bg-emerald-100):hover .w-10.rounded-xl {
    box-shadow: 0 6px 18px rgba(110, 231, 183, 0.5);
}
.glass-panel:has(.bg-blue-100):hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 20px 40px -8px rgba(147, 197, 253, 0.35),
                0 4px 16px -4px rgba(0, 0, 0, 0.05),
                inset 0 -3px 0 #93C5FD !important;
}
.glass-panel:has(.bg-blue-100):hover .w-10.rounded-xl {
    box-shadow: 0 6px 18px rgba(147, 197, 253, 0.5);
}
.glass-panel:has(.bg-orange-100):hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 20px 40px -8px rgba(253, 186, 116, 0.35),
                0 4px 16px -4px rgba(0, 0, 0, 0.05),
                inset 0 -3px 0 #FDBA74 !important;
}
.glass-panel:has(.bg-orange-100):hover .w-10.rounded-xl {
    box-shadow: 0 6px 18px rgba(253, 186, 116, 0.5);
}

/* v1312: Hamburger button — mobile only (md:hidden not in Tailwind build) */
@media (min-width: 768px) {
    .hamburger-mobile-only { display: none !important; }
}

/* v1969: Quick Actions Bar */
.quick-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-action-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F9D99A;
  color: #1C2734;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.quick-action-primary:hover {
  background: #F2C982;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,217,154,0.4);
}
.quick-action-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: #344354;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid #7AC4A4;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.quick-action-secondary:hover {
  background: #A6EAC7;
  color: #1C2734;
  transform: translateY(-1px);
}

/* v2004: Publishing Queue Widget — light card, ms-card style */
.pq-card {
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid rgba(166,234,199,0.2);
  box-shadow: 0 8px 32px -8px rgba(28,39,52,0.07);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}
.pq-title {
  font-size: 20px;
  font-weight: 800;
  font-family: 'LiaElement', sans-serif !important;
  color: #1C2734;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pq-title > span { display: flex; flex-direction: column; gap: 3px; }
.pq-title svg { display: none; }
.pq-title a {
  font-size: 11px;
  font-weight: 700;
  color: #A6EAC7;
  background: rgba(166,234,199,0.1);
  border: 1px solid rgba(166,234,199,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.pq-title a:hover { background: rgba(166,234,199,0.18); color: #7AC4A4; }
.pq-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background 0.15s ease;
  margin-bottom: 2px;
}
.pq-row:hover { background: rgba(166,234,199,0.07); }
.pq-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pq-row-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1C2734;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pq-row-title a {
  color: inherit;
  text-decoration: none;
}
.pq-row-title a:hover { color: #7AC4A4; }
.pq-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.pq-badge-published {
  background: rgba(166,234,199,0.15);
  color: #3DB88A;
  border: 1px solid rgba(166,234,199,0.3);
}
.pq-badge-planned {
  background: rgba(249,217,154,0.15);
  color: #B88A20;
  border: 1px solid rgba(249,217,154,0.3);
}
.pq-date {
  font-size: 11px;
  color: #91A0AF;
  flex-shrink: 0;
}
.pq-divider {
  height: 1px;
  background: rgba(28,39,52,0.07);
  margin: 8px 0;
}
.pq-empty {
  font-size: 13px;
  color: #91A0AF;
  text-align: center;
  padding: 20px 0;
}

/* v1971: Keyword Distribution Widget */
.kw-dist-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(166,234,199,0.3);
  box-shadow: 0 4px 6px rgba(28,39,52,0.06);
}
.kw-dist-title {
  font-size: 15px;
  font-weight: 700;
  font-family: 'LiaElement', sans-serif !important;
  color: #1C2734;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kw-dist-title a { font-size: 12px; color: #7AC4A4; text-decoration: none; font-weight: 600; }
.kw-dist-title a:hover { color: #A6EAC7; }
.kw-dist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.kw-dist-row { display: flex; flex-direction: column; gap: 6px; }
.kw-dist-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #91A0AF;
}
.kw-dist-count { font-size: 22px; font-weight: 800; color: #1C2734; line-height: 1; }
.kw-dist-bar-track {
  height: 6px;
  background: rgba(28,39,52,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.kw-dist-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.kw-insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(249,217,154,0.12);
  border: 1px solid rgba(249,217,154,0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #344354;
  font-weight: 500;
}

/* v1973: Plan Usage Widget */
.plan-usage-card {
  background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid rgba(166,234,199,0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.plan-usage-badge {
  font-size: 11px; font-weight: 800;
  background: #F9D99A; color: #1C2734;
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em;
}
.plan-usage-label { font-size: 12px; color: rgba(255,248,242,0.45); font-weight: 600; }
.plan-usage-numbers { font-size: 20px; font-weight: 800; color: #FFF8F2; }
.plan-usage-numbers span { color: #A6EAC7; }
.plan-usage-bar-wrap { flex: 1; min-width: 120px; }
.plan-usage-bar-track {
  height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 999px; overflow: hidden; margin-top: 8px;
}
.plan-usage-bar-fill { height: 100%; border-radius: 999px; transition: width 0.8s ease; }
.plan-usage-renewal { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px; }
.plan-usage-upgrade {
  font-size: 13px; font-weight: 700;
  background: rgba(249,217,154,0.12); color: #F9D99A;
  border: 1px solid rgba(249,217,154,0.25);
  padding: 8px 16px; border-radius: 8px;
  text-decoration: none; white-space: nowrap;
  transition: all 0.2s ease; flex-shrink: 0;
}
.plan-usage-upgrade:hover { background: rgba(249,217,154,0.2); }


/* v2003: Keyword Distribution Donut — ms-card style (from research-dashboard) */
.kd-donut-card {
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid rgba(166,234,199,0.2);
  box-shadow: 0 8px 32px -8px rgba(28,39,52,0.07);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}
.kd-donut-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}
.kd-donut-title {
  font-size: 20px;
  font-weight: 800;
  font-family: 'LiaElement', sans-serif !important;
  color: #1C2734;
  line-height: 1.1;
}
.kd-donut-subtitle {
  font-size: 13px;
  color: #91A0AF;
  margin-top: 3px;
}
.kd-donut-header a {
  font-size: 11px;
  font-weight: 700;
  color: #A6EAC7;
  background: rgba(166,234,199,0.1);
  border: 1px solid rgba(166,234,199,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.kd-donut-header a:hover { background: rgba(166,234,199,0.18); color: #7AC4A4; }
.kd-donut-body {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}
.kd-chart-wrap {
  position: relative;
  width: 190px;
  height: 190px;
  flex-shrink: 0;
}
.kd-chart-wrap canvas {
  width: 190px !important;
  height: 190px !important;
  display: block !important;
}
.kd-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: all 0.2s ease;
}
.kd-center-num {
  font-size: 34px;
  font-weight: 900;
  color: #1C2734;
  line-height: 1;
  letter-spacing: -1px;
}
.kd-center-label {
  font-size: 12px;
  font-weight: 600;
  color: #91A0AF;
  margin-top: 4px;
}
.kd-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kd-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: default;
  transition: background 0.15s ease;
}
.kd-legend-item:hover { background: rgba(166,234,199,0.08); }
.kd-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kd-legend-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #344354;
}
.kd-legend-val {
  font-size: 18px;
  font-weight: 800;
  color: #1C2734;
  min-width: 32px;
  text-align: left;
}
.kd-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(249,217,154,0.1);
  border: 1px solid rgba(249,217,154,0.25);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  color: #344354;
  font-weight: 500;
  margin-top: 12px;
  line-height: 1.5;
}

/* v1972: GSC Performance Chart */
.gsc-chart-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(166,234,199,0.3);
  box-shadow: 0 4px 6px rgba(28,39,52,0.06);
}
.gsc-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.gsc-chart-title { font-size: 15px; font-weight: 700; color: #1C2734; }
.gsc-chart-subtitle { font-size: 12px; color: #91A0AF; margin-top: 2px; }
.gsc-kpi-row { display: flex; gap: 20px; flex-wrap: wrap; }
.gsc-kpi { text-align: right; }
.gsc-kpi-value { font-size: 22px; font-weight: 800; color: #1C2734; line-height: 1; }
.gsc-kpi-label { font-size: 11px; font-weight: 600; color: #91A0AF; margin-top: 3px; }
.gsc-kpi-delta { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; display: inline-block; margin-top: 4px; }
.gsc-legend { display: flex; gap: 16px; margin-top: 10px; }
.gsc-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #91A0AF; font-weight: 600; }
.gsc-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* v2005: Keyword Movers Widget */
.kw-movers-card {
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid rgba(166,234,199,0.2);
  box-shadow: 0 8px 32px -8px rgba(28,39,52,0.07);
  padding: 28px 32px;
}
.kw-movers-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.kw-movers-title {
  font-size: 20px;
  font-weight: 800;
  color: #1C2734;
}
.kw-movers-subtitle {
  font-size: 13px;
  color: #91A0AF;
  margin-top: 3px;
}
.kw-movers-header a {
  font-size: 11px;
  font-weight: 700;
  color: #A6EAC7;
  background: rgba(166,234,199,0.1);
  border: 1px solid rgba(166,234,199,0.2);
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.kw-movers-header a:hover { background: rgba(166,234,199,0.18); color: #7AC4A4; }
.kw-movers-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 32px;
}
.kw-movers-divider {
  background: rgba(28,39,52,0.07);
  width: 1px;
}
.kw-movers-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #344354;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 14px 12px;
  border-bottom: 1px solid rgba(28,39,52,0.06);
  margin-bottom: 4px;
}
.kw-movers-up-header { color: #3DB88A; }
.kw-movers-down-header { color: #C97070; }
.kw-movers-col-count {
  margin-right: auto;
  background: rgba(61,184,138,0.1);
  color: #3DB88A;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
}
.kw-movers-col-count-down {
  background: rgba(201,112,112,0.1);
  color: #C97070;
}
.kw-movers-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  transition: background 0.15s;
}
.kw-movers-row:hover { background: rgba(166,234,199,0.07); }
.kw-movers-keyword {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #1C2734;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.kw-movers-pos {
  font-size: 13px;
  font-weight: 700;
  color: #91A0AF;
  flex-shrink: 0;
}
.kw-movers-change {
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  min-width: 44px;
  text-align: left;
}
.kw-movers-change-up { color: #3DB88A; }
.kw-movers-change-down { color: #C97070; }
.kw-movers-empty {
  font-size: 12px;
  color: #91A0AF;
  padding: 16px 14px;
}


#sidebar-desktop { overflow: hidden; }


/* ── Dark Sidebar Theme v2015 ─────────────────────────────────────────────── */
body.dark-sidebar #sidebar-desktop,
body.dark-sidebar #sidebar-mobile {
    background: #0B0F1C !important;
}
body.dark-sidebar #sidebar-desktop {
    border-color: #161B2E !important;
}
body.dark-sidebar #sidebar-mobile {
    background: #0B0F1C !important;
    box-shadow: -4px 0 24px rgba(0,0,0,0.4) !important;
}
/* Inner borders */
body.dark-sidebar #sidebar-desktop .border-b,
body.dark-sidebar #sidebar-desktop .border-t,
body.dark-sidebar #sidebar-mobile .border-b,
body.dark-sidebar #sidebar-mobile .border-t {
    border-color: #161B2E !important;
}
/* Logo text — override inline color */
body.dark-sidebar #sidebar-desktop .trigger-container .font-bold {
    color: #FFFFFF !important;
}
body.dark-sidebar #sidebar-mobile .font-bold.text-xl {
    color: #FFFFFF !important;
}
/* Section category labels */
body.dark-sidebar #sidebar-desktop nav .text-slate-400,
body.dark-sidebar #sidebar-mobile nav .text-slate-400 {
    color: #4E6070 !important;
}
/* Nav links — default */
body.dark-sidebar #sidebar-desktop .sidebar-link,
body.dark-sidebar #sidebar-mobile .sidebar-link {
    color: #A8BCC8 !important;
}
/* Nav links — hover */
body.dark-sidebar #sidebar-desktop .sidebar-link:hover,
body.dark-sidebar #sidebar-mobile .sidebar-link:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #E8EFF6 !important;
}
/* Nav links — active */
body.dark-sidebar #sidebar-desktop .sidebar-link.active,
body.dark-sidebar #sidebar-mobile .sidebar-link.active {
    background: rgba(166,234,199,0.12) !important;
    color: #A6EAC7 !important;
}
/* User profile footer */
body.dark-sidebar #sidebar-desktop .border-t.border-cream-200,
body.dark-sidebar #sidebar-mobile .border-t.border-cream-200 {
    border-color: #161B2E !important;
}
body.dark-sidebar #sidebar-desktop .bg-cream-50,
body.dark-sidebar #sidebar-mobile .bg-cream-50 {
    background: #162030 !important;
}
/* User name */
body.dark-sidebar #sidebar-desktop .text-forest-900,
body.dark-sidebar #sidebar-mobile .text-forest-900 {
    color: #E8EFF6 !important;
}
/* User email */
body.dark-sidebar #sidebar-desktop .text-slate-500,
body.dark-sidebar #sidebar-mobile .text-slate-500 {
    color: #5E7383 !important;
}
/* Avatar initial circle */
body.dark-sidebar #sidebar-desktop .bg-mint-100,
body.dark-sidebar #sidebar-mobile .bg-mint-100 {
    background: #263342 !important;
}
body.dark-sidebar #sidebar-desktop .text-mint-700,
body.dark-sidebar #sidebar-mobile .text-mint-700 {
    color: #A6EAC7 !important;
}
/* Logout button */
body.dark-sidebar #sidebar-desktop a[href="/logout.php"],
body.dark-sidebar #sidebar-mobile a[href="/logout.php"] {
    background: rgba(255,255,255,0.06) !important;
    border-color: #344354 !important;
    color: #7A909F !important;
}
body.dark-sidebar #sidebar-desktop a[href="/logout.php"]:hover,
body.dark-sidebar #sidebar-mobile a[href="/logout.php"]:hover {
    background: rgba(239,68,68,0.12) !important;
    border-color: rgba(239,68,68,0.3) !important;
    color: #fc8181 !important;
}
/* Mobile close button */
body.dark-sidebar #sidebar-mobile .flex-shrink-0 button {
    color: rgba(232,239,246,0.6) !important;
}
body.dark-sidebar #sidebar-mobile .flex-shrink-0 button:hover {
    background: rgba(255,255,255,0.08) !important;
}
/* Disabled items (locked features) on dark sidebar */
body.dark-sidebar #sidebar-desktop span.cursor-not-allowed,
body.dark-sidebar #sidebar-mobile span.cursor-not-allowed {
    color: #4E6070 !important;
    opacity: 0.7 !important;
}
/* ── End Dark Sidebar Theme ────────────────────────────────────────────────── */
/* ── Collapsed Sidebar Theme v2015c ─────────────────────────────────────────── */
body.sidebar-collapsed #sidebar-desktop {
    width: 64px !important;
    min-width: 64px !important;
}
body.sidebar-collapsed #sidebar-desktop .trigger-container .font-bold {
    display: none !important;
}
body.sidebar-collapsed #sidebar-desktop .logo-area-content {
    justify-content: center !important;
    padding: 0 !important;
    min-height: 40px !important;
}
body.sidebar-collapsed #sidebar-desktop .star-anchor {
    display: block !important;
    overflow: visible !important;
    width: 30px !important;
    height: 30px !important;
}
body.sidebar-collapsed #sidebar-desktop .stars-wrapper {
    position: static !important;
    display: block !important;
    overflow: visible !important;
    width: 30px !important;
    height: 30px !important;
}
body.sidebar-collapsed #sidebar-desktop .star-icon:not(:first-child) {
    display: none !important;
}
body.sidebar-collapsed #sidebar-desktop .star-icon {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    width: 28px !important;
    height: 28px !important;
    color: #A6EAC7 !important;
}
body.sidebar-collapsed #sidebar-desktop nav {
    padding-left: 6px !important;
    padding-right: 6px !important;
}
body.sidebar-collapsed #sidebar-desktop nav .text-xs.font-semibold {
    display: none !important;
}
body.sidebar-collapsed #sidebar-desktop .sidebar-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 0 !important;
    font-size: 0 !important;
    position: relative;
}
body.sidebar-collapsed #sidebar-desktop .sidebar-link svg {
    flex-shrink: 0;
    width: 22px !important;
    height: 22px !important;
}
body.sidebar-collapsed #sidebar-desktop .sidebar-link > span {
    display: none !important;
}
body.sidebar-collapsed #sidebar-desktop .sidebar-link[data-tour-step]:hover::after {
    content: attr(data-nav-label);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #0B0F1C;
    color: #E8EFF6;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    pointer-events: none;
}
body.sidebar-collapsed #sidebar-desktop .border-t.p-4 {
    padding: 8px 6px !important;
}
body.sidebar-collapsed #sidebar-desktop .border-t .flex-1,
body.sidebar-collapsed #sidebar-desktop .border-t .text-sm.font-medium,
body.sidebar-collapsed #sidebar-desktop .border-t .text-xs.text-slate-500,
body.sidebar-collapsed #sidebar-desktop .border-t a[href^="/upgrade"],
body.sidebar-collapsed #sidebar-desktop #theme-toggle-btn span,
body.sidebar-collapsed #sidebar-desktop a[href="/logout.php"] span {
    display: none !important;
}
body.sidebar-collapsed #sidebar-desktop .border-t .flex.items-center.gap-3.mb-3 {
    justify-content: center !important;
    margin-bottom: 6px !important;
}
body.sidebar-collapsed #sidebar-desktop a[href="/logout.php"] {
    justify-content: center !important;
    padding: 8px !important;
}
body.sidebar-collapsed #sidebar-desktop #theme-toggle-btn {
    justify-content: center !important;
    padding: 8px !important;
}
body.sidebar-collapsed #sidebar-desktop .collapse-toggle-btn span {
    display: none !important;
}
body.sidebar-collapsed #sidebar-desktop .px-4.pb-3 {
    padding-left: 6px !important;
    padding-right: 6px !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 6px !important;
}
body.sidebar-collapsed #sidebar-desktop #collapse-toggle-btn {
    width: 32px !important;
    height: 32px !important;
    justify-content: center !important;
}
body.sidebar-collapsed #sidebar-desktop #sidebar-bottom-btns {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 4px 0 12px !important;
    gap: 8px !important;
}
/* ── End Collapsed Sidebar ───────────────────────────────────────────────────── */


/* ── Mobile horizontal overflow fix ─────────────────────────────────────────── */
@media (max-width: 768px) {
    html { overflow-x: hidden; }
    main { overflow-x: hidden; overscroll-behavior-x: none; }
    #notif-panel { width: calc(100vw - 40px) !important; left: 20px !important; right: 20px !important; }
    #toast-container { max-width: calc(100vw - 48px) !important; left: 16px !important; }
}

/* v2621: LTR logo stars — expand rightward, not over text */
html[dir="ltr"] .stars-wrapper {
    right: auto;
    left: 0;
}
html[dir="ltr"] .star-icon:not(:first-child) {
    transform: translateX(-20px) scale(0.1);
}
html[dir="ltr"] .trigger-container:hover .star-icon {
    transform: translateX(0) scale(1);
}
