* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: aliceblue;
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

#network {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

#title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    background: rgba(240, 248, 255, 0.9);
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    white-space: nowrap;
}

#legend {
    position: absolute;
    top: 55px;
    left: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    min-width: 160px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.legend-edge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.legend-line {
    width: 20px;
    height: 3px;
    display: inline-block;
    flex-shrink: 0;
    border-radius: 2px;
}

.legend-instructions {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
    border-top: 1px solid #ddd;
    padding-top: 6px;
    line-height: 1.4;
}

#right-panel {
    position: absolute;
    top: 55px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 12px 16px;
    width: 250px;
    font-size: 13px;
    line-height: 1.5;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

#panel-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-bottom: 6px;
}

#panel-body {
    color: #555;
}

#panel-body .loop-path {
    margin-top: 8px;
    padding-left: 0;
    list-style: none;
}

#panel-body .loop-path li {
    padding: 3px 0;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

#panel-body .loop-path li:last-child {
    border-bottom: none;
}

.loop-arrow {
    font-weight: bold;
    margin: 0 4px;
}

.loop-arrow.positive {
    color: #FF7043;
}

.loop-arrow.negative {
    color: #607D8B;
}

#loop-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    text-align: center;
}

#loop-label .loop-r {
    font-size: 36px;
    font-weight: bold;
    color: rgba(255, 112, 67, 0.35);
    line-height: 1;
}

#loop-label .loop-subtitle {
    font-size: 11px;
    color: rgba(255, 112, 67, 0.45);
    margin-top: 2px;
}
