.gcm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
}

.gcm-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gcm-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.gcm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gcm-legend-dot.shared { background: #22c55e; }
.gcm-legend-dot.partial { background: #f59e0b; }
.gcm-legend-dot.unique { background: #ef4444; }
.gcm-legend-dot.over-covered { background: #3b82f6; }
.gcm-legend-dot.selected { background: #8b5cf6; }

.gcm-cluster {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.gcm-cluster:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.gcm-cluster-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.gcm-cluster-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.gcm-cluster-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.gcm-cluster-overlap-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.gcm-cluster-body {
    padding: 16px 18px;
    position: relative;
}

.gcm-unit-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.gcm-unit-card {
    flex: 1;
    min-width: 240px;
    max-width: 380px;
    background: rgba(30, 27, 46, 0.7);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    position: relative;
}

.gcm-unit-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

.gcm-unit-card.gcm-highlight {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3), 0 4px 24px rgba(139, 92, 246, 0.15);
}

.gcm-unit-card.gcm-dim {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.gcm-unit-code {
    font-size: 13px;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.gcm-unit-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gcm-req-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gcm-req-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 22px;
}

.gcm-req-bar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 24px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
}

.gcm-req-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.gcm-req-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.gcm-req-bar-fill.type-pc { background: #3b82f6; }
.gcm-req-bar-fill.type-ke { background: #10b981; }
.gcm-req-bar-fill.type-pe { background: #f97316; }

.gcm-req-bar-fill.shared-portion {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #22c55e;
    opacity: 0.7;
    border-radius: 4px;
}

.gcm-req-bar-count {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.gcm-unit-stats {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gcm-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.gcm-stat-chip.shared {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.gcm-stat-chip.unique {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.gcm-shared-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.gcm-connection-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.gcm-connection-svg line,
.gcm-connection-svg path {
    stroke-linecap: round;
}

.gcm-req-detail {
    background: rgba(30, 27, 46, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    margin-top: 14px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.gcm-req-detail.gcm-expand {
    max-height: 600px;
    opacity: 1;
    padding: 14px;
}

.gcm-req-detail-header {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gcm-req-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gcm-req-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gcm-req-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.gcm-req-item-type {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 1px;
}

.gcm-req-item-type.pc { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.gcm-req-item-type.ke { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.gcm-req-item-type.pe { background: rgba(249, 115, 22, 0.2); color: #fb923c; }

.gcm-req-item-text {
    flex: 1;
    min-width: 0;
}

.gcm-req-item-units {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.gcm-req-unit-tag {
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 3px;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

.gcm-justification {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-top: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gcm-justification:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.gcm-justification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 8px;
}

.gcm-justification-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gcm-justification-toggle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease;
}

.gcm-justification.expanded .gcm-justification-toggle {
    transform: rotate(180deg);
}

.gcm-justification-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.gcm-justification.expanded .gcm-justification-body {
    max-height: 400px;
}

.gcm-justification-content {
    padding: 0 16px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
}

.gcm-assessment-card {
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.gcm-assessment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.gcm-assessment-icon {
    font-size: 18px;
}

.gcm-assessment-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.gcm-assessment-body {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
}

.gcm-assessment-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.gcm-assessment-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.gcm-assessment-item-icon {
    color: #22c55e;
    flex-shrink: 0;
    margin-top: 1px;
}

.gcm-savings-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.gcm-savings-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gcm-savings-value {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
}

.gcm-savings-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
}

.gcm-savings-divider {
    width: 1px;
    height: 30px;
    background: rgba(34, 197, 94, 0.2);
}

.gcm-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px;
    margin-top: 20px;
}

.gcm-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.gcm-summary-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.gcm-summary-actions {
    display: flex;
    gap: 8px;
}

.gcm-summary-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(124, 58, 237, 0.12);
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gcm-summary-btn:hover {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.5);
}

.gcm-summary-btn.primary {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-color: transparent;
    color: #fff;
}

.gcm-summary-btn.primary:hover {
    filter: brightness(1.1);
}

.gcm-summary-btn.text-only {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.gcm-summary-btn.text-only:hover {
    color: rgba(255, 255, 255, 0.7);
}

.gcm-summary-units {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.gcm-summary-unit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
}

.gcm-summary-unit-badge.planned {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.gcm-summary-unit-badge.partial {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.gcm-summary-unit-badge.defaults {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.3);
    color: #94a3b8;
}

.gcm-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.gcm-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(124, 58, 237, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.gcm-summary-chip-key {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.gcm-summary-bottom {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.gcm-summary-bottom strong {
    color: rgba(255, 255, 255, 0.8);
}

.gcm-error-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.gcm-error-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.gcm-error-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 14px;
}

.gcm-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(124, 58, 237, 0.12);
    color: #a78bfa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gcm-retry-btn:hover {
    background: rgba(124, 58, 237, 0.25);
}

.gcm-loading {
    text-align: center;
    padding: 40px 20px;
}

.gcm-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: gcm-spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes gcm-spin {
    to { transform: rotate(360deg); }
}

.gcm-loading-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.gcm-fade-in {
    animation: gcm-fade-in 0.3s ease forwards;
}

@keyframes gcm-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gcm-pulse {
    animation: gcm-pulse 1.5s ease-in-out infinite;
}

@keyframes gcm-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

.gcm-line-draw {
    animation: gcm-line-draw 0.8s ease forwards;
}

@keyframes gcm-line-draw {
    from {
        stroke-dashoffset: var(--gcm-line-length, 200);
    }
    to {
        stroke-dashoffset: 0;
    }
}

.gcm-empty {
    text-align: center;
    padding: 48px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.gcm-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.gcm-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.gcm-empty-text {
    font-size: 13px;
}

@media (max-width: 768px) {
    .gcm-unit-row {
        flex-direction: column;
    }

    .gcm-unit-card {
        max-width: none;
    }

    .gcm-legend {
        gap: 10px;
    }

    .gcm-savings-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .gcm-savings-divider {
        width: 100%;
        height: 1px;
    }

    .gcm-summary-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
