.alert-panel{
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 1000;
    background: rgba(20, 20, 22, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 10px 12px;
    color: rgba(255,255,255,0.92);
    overflow: hidden;
}
.alert-list{
    width: 100%;
    max-height: 140px;
    overflow: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: 10px;
}
.alert-list.fade{
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0));
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0));
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}
.alert-list.alert-pad{
    padding-bottom: 20px;
}

.alert-item{
    position: relative;
    padding: 10px 12px 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
}
.alert-header{
    font-weight: 700;
    font-size: 1.05em;
    line-height: 1.25;
    color: rgba(255,255,255,0.96);
    padding-left: 8px;
}
.alert-desc{
    margin-top: 6px;
    padding-left: 8px;
    color: rgba(255,255,255,0.82);
    line-height: 1.35;
}
.alert-top{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.alert-spacer{
    flex: 1;
}
.alert-target{
    font-weight: 700;
    font-size: 0.9em;
    color: rgba(255,255,255,0.80);
    padding-left: 8px;
}
.chip{
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.86);
    white-space: nowrap;
}

/* -----------------------------
   Chip role split (target vs effect)
------------------------------ */
.chip-effect{
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* -----------------------------
   Default (neutral gray)
   - for missing/unknown effect, or fallback
------------------------------ */
.alert-item::before{
    content: "";
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 4px;
    border-radius: 8px;
    background: rgba(190, 190, 200, 0.85);
}
.alert-item .chip-effect{
    background: rgba(190, 190, 200, 0.10);
    border: 1px solid rgba(190, 190, 200, 0.20);
    color: rgba(255,255,255,0.80);
}

/* -----------------------------
   RED: NO_SERVICE (1)
------------------------------ */
.alert-item.effect-1::before{
    background: rgba(255, 80, 80, 0.95);
}
.alert-item.effect-1 .chip-effect{
    background: rgba(255, 80, 80, 0.20);
    border-color: rgba(255, 80, 80, 0.42);
    color: rgba(255,255,255,0.92);
}

/* -----------------------------
   ORANGE: REDUCED(2), SIGNIFICANT(3)
------------------------------ */
.alert-item.effect-2::before,
.alert-item.effect-3::before{
    background: rgba(255, 165, 60, 0.95);
}
.alert-item.effect-2 .chip-effect,
.alert-item.effect-3 .chip-effect{
    background: rgba(255, 165, 60, 0.18);
    border-color: rgba(255, 165, 60, 0.40);
    color: rgba(255,255,255,0.92);
}

/* -----------------------------
   YELLOW (soft): DETOUR(4), ADDITIONAL(5), MODIFIED(6), STOP_MOVED(9)
   - soft yellow to avoid "too bright" on dark UI
------------------------------ */
.alert-item.effect-4::before,
.alert-item.effect-5::before,
.alert-item.effect-6::before,
.alert-item.effect-9::before{
    background: rgba(245, 215, 110, 0.95);
}
.alert-item.effect-4 .chip-effect,
.alert-item.effect-5 .chip-effect,
.alert-item.effect-6 .chip-effect,
.alert-item.effect-9 .chip-effect{
    background: rgba(245, 215, 110, 0.14);
    border-color: rgba(245, 215, 110, 0.28);
    color: rgba(255,255,255,0.90);
}

/* -----------------------------
   GREEN (subtle): NO_EFFECT(10)
------------------------------ */
.alert-item.effect-10::before{
    background: rgba(120, 220, 120, 0.85);
}
.alert-item.effect-10 .chip-effect{
    background: rgba(120, 220, 120, 0.12);
    border-color: rgba(120, 220, 120, 0.26);
    color: rgba(255,255,255,0.80);
}

/* -----------------------------
   GRAY: OTHER(7), UNKNOWN(8)
   - same as default, but explicitly stated
------------------------------ */
.alert-item.effect-7::before,
.alert-item.effect-8::before{
    background: rgba(190, 190, 200, 0.85);
}
.alert-item.effect-7 .chip-effect,
.alert-item.effect-8 .chip-effect{
    background: rgba(190, 190, 200, 0.10);
    border-color: rgba(190, 190, 200, 0.20);
    color: rgba(255,255,255,0.78);
}

/* -----------------------------
   BLUE/PURPLE: ACCESSIBILITY_ISSUE(11)
------------------------------ */
.alert-item.effect-11::before{
    background: rgba(170, 140, 255, 0.95);
}
.alert-item.effect-11 .chip-effect{
    background: rgba(170, 140, 255, 0.16);
    border-color: rgba(170, 140, 255, 0.34);
    color: rgba(255,255,255,0.90);
}

.alert-link,
.alert-link:link,
.alert-link:visited{
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 2px;
}
.alert-link:hover{
    text-decoration-color: rgba(255, 255, 255, 0.75);
}
