:root {
    --low: #2E8B57;
    --medium: #FF8C00;
    --high: #DC143C;
    --very-high: #8B0000;
    --blue: #007CE0;
    --gray: #888888;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    overflow: hidden;
}
body {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    background: #fff;
    display: flex;
}
.sidebar {
    width: 30%;
    height: 100%;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.header {
    flex-shrink: 0;
    margin-bottom: 20px;
}
.logos {
    display: flex;
    gap: 16px;
}
.logos img { height: 40px; }
h1 { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.legend-count { color: var(--gray); }
#ipc-stats-container { margin-bottom: 14px; }
#detail-ipc-stats { font-size: 14px; margin-top: 4px; }
#details { display: none; flex: 1; overflow-y: auto; min-height: 0; }
#details.visible { display: block; }
#details h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.detail-item label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 2px;
    text-transform: uppercase;
}
.detail-item span { font-size: 14px; font-weight: 600; }
.alert-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: capitalize;
}
.alert-low { background: var(--low); }
.alert-medium { background: var(--medium); }
.alert-high { background: var(--high); }
.alert-very-high { background: var(--very-high); }
.summary-text {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}
.summary-text a { color: var(--blue); }
.placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 16px;
    min-height: 0;
}
.placeholder.hidden { display: none; }
.footer-links {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
}
.source {
    font-size: 12px;
    color: var(--gray);
}
.source a { color: var(--blue); text-decoration: none; }
.source a:hover { text-decoration: underline; }
.map-container {
    width: 70%;
    height: 100%;
    position: relative;
}
#map { width: 100%; height: 100%; }
.legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255,255,255,0.9);
    padding: 12px 14px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.legend-title { font-weight: 600; margin-bottom: 4px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-color { width: 14px; height: 14px; border-radius: 2px; }
.legend-toggle {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}
.legend-toggle button {
    flex: 1;
    background: white;
    border: 1px solid #ccc;
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
}
.legend-toggle button:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.legend-toggle button.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}
.loading { text-align: center; padding: 40px; color: var(--gray); }
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.hidden { display: none; }
.modal {
    background: white;
    padding: 32px 40px;
    max-width: 800px;
    font-family: inherit;
}
.modal h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}
.modal p {
    font-size: 18px;
    margin-bottom: 24px;
    color: #333;
    text-align: left;
}
.modal button {
    background: none;
    border: 1px solid var(--gray);
    color: var(--gray);
    padding: 8px 16px;
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}
.modal button:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* Info tooltip styles */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--gray);
    color: white;
    font-size: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 3px;
    vertical-align: middle;
}
.info-icon:hover { background: var(--blue); }
.info-modal {
    background: white;
    padding: 24px;
    width: 500px;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 4px;
}
.info-modal h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #333;
}
.info-modal p {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}
.threshold-diagram {
    margin-bottom: 12px;
}
.threshold-scale {
    display: flex;
    height: 28px;
    border-radius: 3px;
    overflow: hidden;
}
.threshold-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}
.threshold-labels {
    display: flex;
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}
.threshold-labels span {
    text-align: left;
}
.condition-box {
    padding: 8px 10px;
    margin: 8px 0;
    font-size: 11px;
}
.condition-box strong {
    color: #333;
}
.condition-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.condition-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 2px;
    color: white;
    font-size: 10px;
    font-weight: 600;
}
.info-modal .close-btn {
    background: none;
    border: 1px solid var(--gray);
    color: var(--gray);
    padding: 8px 16px;
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}
.info-modal .close-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}
