/* =========================
ðŸªŸ PANEL
========================= */

.adpai-analysis-panel{

    position:fixed;

    top:0;
    right:0;

    width:440px;
    max-width:100%;

    height:100vh;

    background:#ffffff;

    z-index:99999;

    overflow-y:auto;

    border-left:
        1px solid #e5e7eb;

    box-shadow:
        -10px 0 30px rgba(0,0,0,.08);

    transform:translateX(100%);

    opacity:0;

    visibility:hidden;

    pointer-events:none;

    transition:
        transform .3s ease,
        opacity .3s ease;

    padding:22px;
}

/* ACTIVE */

.adpai-analysis-panel.active{

    transform:translateX(0);

    opacity:1;

    visibility:visible;

    pointer-events:auto;
}

/* =========================
ðŸ§  HEADER
========================= */

.panel-header{

    display:flex;

    align-items:center;

    justify-content:space-between;

    margin-bottom:24px;
}

.panel-title{

    display:flex;

    align-items:center;

    gap:12px;

    margin:0;

    font-size:22px;

    font-weight:700;

    color:#111827;
}

.panel-title-icon{

    width:40px;
    height:40px;

    border-radius:14px;

    background:#f3f4f6;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#4b5563;
}

#adpai-panel-close{

    width:38px;
    height:38px;

    border-radius:12px;

    background:#f3f4f6;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    color:#6b7280;

    transition:.2s ease;
}

#adpai-panel-close:hover{

    background:#111827;

    color:#fff;
}

/* =========================
ðŸ“¦ SECTIONS
========================= */

.panel-section{

    background:#fff;

    border:1px solid #edf2f7;

    border-radius:20px;

    padding:20px;

    margin-bottom:18px;
}

/* =========================
ðŸ“Œ HEADINGS
========================= */

.panel-heading{

    display:flex;

    align-items:center;

    gap:10px;

    margin:0 0 18px;

    font-size:16px;

    font-weight:700;

    color:#111827;
}

.panel-heading-icon{

    width:34px;
    height:34px;

    border-radius:12px;

    background:#f3f4f6;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#4b5563;
}

/* =========================
ðŸ“Š SCORE
========================= */

.panel-score-badge{

    width:90px;
    height:90px;

    border-radius:50%;

    display:flex;

    align-items:center;

    justify-content:center;

    margin:auto;

    background:#111827;

    color:#fff;

    font-size:28px;

    font-weight:800;
}

/* =========================
ðŸ“ˆ METRICS
========================= */

.metrics-grid{

    display:grid;

    grid-template-columns:
        repeat(2,1fr);

    gap:14px;
}

.metric-card{

    background:#f9fafb;

    border-radius:16px;

    padding:16px;

    border:1px solid #edf2f7;
}

.metric-card span{

    display:block;

    font-size:13px;

    color:#6b7280;

    margin-bottom:8px;
}

.metric-card strong{

    font-size:18px;

    color:#111827;
}

/* =========================
ðŸŽ¯ SCORE GRID
========================= */

.score-grid{

    display:grid;

    grid-template-columns:
        repeat(2,1fr);

    gap:18px;
}

.score-card{

    text-align:center;
}

.score-circle{

    position:relative;

    width:110px;
    height:110px;

    margin:auto;
}

.score-circle canvas{

    width:110px !important;
    height:110px !important;
}

.score-center{

    position:absolute;

    inset:0;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:22px;

    font-weight:800;

    color:#111827;
}

/* =========================
ðŸ“Š ENTITY CHARTS
========================= */

.entity-charts-grid{

    display:grid;

    gap:18px;
}

.entity-chart-card{

    background:#f9fafb;

    border-radius:18px;

    padding:18px;

    border:1px solid #edf2f7;
}

.entity-chart-card h5{

    margin:0 0 16px;

    font-size:15px;

    color:#111827;
}

.entity-chart{

    width:100% !important;

    height:220px !important;
}

/* =========================
ðŸ§  INSIGHTS
========================= */

.problem-box{

    border-left:
        4px solid #ef4444;
}

.reason-box{

    border-left:
        4px solid #f59e0b;
}

.impact-box{

    border-left:
        4px solid #8b5cf6;
}

.quickfix-box{

    border-left:
        4px solid #3b82f6;
}

.expert-box{

    border-left:
        4px solid #10b981;
}

/* =========================
ðŸš€ CTA
========================= */

.expert-cta{

    display:flex;

    gap:12px;

    margin-top:18px;
}

.expert-cta button{

    flex:1;
}

.panel-footer-cta{

    position:sticky;

    bottom:0;

    background:#fff;

    padding-top:12px;
}
/* =========================
📈 RAIL CHARTS
========================= */

.rail-chart-grid{

    display:grid;

    grid-template-columns:
        repeat(2,1fr);

    gap:16px;
}

.rail-chart-card{

    background:#f8fafc;

    border:
        1px solid #e2e8f0;

    border-radius:24px;

    padding:18px;

    height:180px;

    position:relative;
}

.rail-chart-card canvas{

    width:100% !important;

    height:100% !important;
}
/* =========================
ðŸ“± MOBILE
========================= */

@media(max-width:768px){

    .adpai-analysis-panel{

        width:100%;
    }

    .metrics-grid{

        grid-template-columns:1fr;
    }

    .score-grid{

        grid-template-columns:1fr 1fr;
    }
}