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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#top-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}

#title-section h1 { font-size: 18px; font-weight: 600; }
#title-section .subtitle { font-size: 12px; color: #8899aa; margin-left: 8px; }

#main {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

#cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 12px;
}

.comm-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}
.comm-card:hover { border-color: #3498db; }
.comm-card.expanded { border-color: #3498db; }

.comm-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 12px;
}

.comm-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comm-title {
    flex: 1;
}

.comm-title h3 { font-size: 14px; font-weight: 600; }
.comm-title .comm-subtitle { font-size: 12px; color: #aabbcc; margin-top: 3px; line-height: 1.4; }

.comm-bars {
    padding: 6px 14px 10px;
}

.comm-period-label {
    font-size: 11px;
    color: #667788;
    margin-top: 4px;
}

.comm-size {
    font-size: 22px;
    font-weight: 700;
    color: #3498db;
}

.comm-size span { font-size: 11px; color: #667788; font-weight: 400; }

.comm-details {
    display: none;
    padding: 12px 14px;
    border-top: 1px solid #0f3460;
}

.comm-card.expanded .comm-details { display: block; }

.comm-details h4 {
    font-size: 11px;
    color: #667788;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 0 6px;
}

.comm-details h4:first-child { margin-top: 0; }

.region-bar {
    display: flex;
    height: 16px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.region-segment {
    height: 100%;
    position: relative;
}

.region-segment:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f1a2e;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 5;
    color: #eee;
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.member-chip {
    padding: 2px 8px;
    background: #0f1a2e;
    border-radius: 3px;
    font-size: 11px;
    color: #aabbcc;
}

.contributor-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
}

.contributor-row .count { color: #667788; }
