:root {
    --navy: #003a63;
    --navy-dark: #002d4d;
    --sky: #e9f2f9;
    --gold: #f2a900;
    --slate: #475569;
    --text: #1f2937;
    --muted: #64748b;
    --border: #d5dde5;
    --panel: #ffffff;
    --shadow: 0 14px 30px rgba(0, 37, 63, 0.12);
}

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

body {
    font-family: 'Source Sans 3', system-ui, sans-serif;
    background: #f7f8f9;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 6px;
}

.brand-title {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
}

.header-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    color: var(--navy);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.nav-link:hover {
    background: var(--sky);
}

.nav-cta {
    background: var(--navy);
    color: #fff;
}

.nav-cta:hover {
    background: var(--navy-dark);
}

.hero {
    background: linear-gradient(135deg, #f7fbff 0%, #e7f0f7 100%);
    padding: 4.5rem 0 3.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: clamp(2rem, 3vw, 3rem);
    color: var(--navy);
    margin-bottom: 1rem;
}

.hero-lede {
    font-size: 1.1rem;
    color: var(--slate);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.button.primary {
    background: var(--navy);
    color: #fff;
}

.button.primary:hover {
    background: var(--navy-dark);
}

.button.secondary {
    border: 2px solid var(--navy);
    color: var(--navy);
}

.hero-note {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-panel {
    display: flex;
    justify-content: center;
}

.hero-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-width: 280px;
}

.hero-card-header {
    background: var(--navy);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.pill {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pill-secondary {
    background: var(--navy-dark);
    color: #fff;
}

.hero-card-body {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}

.preview-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
}

.preview-dot.warning { background: #f59e0b; }
.preview-dot.ok { background: #16a34a; }

.preview-title {
    font-weight: 700;
    color: var(--navy);
}

.preview-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.hero-card-footer {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    color: var(--muted);
    background: #f5f7fb;
}

.section {
    padding: 3.5rem 0;
}

.section-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.section h2 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1.75rem;
    color: var(--navy);
    margin-bottom: 0.75rem;
}

.section p {
    color: var(--slate);
    line-height: 1.6;
}

.callout {
    background: #fff;
    padding: 1.5rem;
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.callout h3 {
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-weight: 600;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    font-weight: 600;
}

.footer-links a {
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--navy);
}

/* Live feed layout */

.live-feed {
    background: #f2f4f7;
}

.feed-main {
    padding-bottom: 3rem;
}

.feed-hero {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 0 1.5rem;
}

.feed-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.feed-hero h1 {
    font-family: 'Libre Franklin', sans-serif;
    color: var(--navy);
    font-size: 2.2rem;
}

.feed-hero p {
    color: var(--slate);
    max-width: 520px;
    margin-top: 0.5rem;
}

.feed-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.feed-body {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.6fr);
    gap: 2rem;
    margin-top: 2rem;
}

.feed-panel {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
}

.feed-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.feed-panel-header h2 {
    font-family: 'Libre Franklin', sans-serif;
    color: var(--navy);
}

.count-pill {
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--sky);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.disclaimer.compact {
    margin-bottom: 1.5rem;
}

.disclaimer .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.loading,
.error,
.no-incidents {
    text-align: center;
    padding: 2rem 0;
    color: var(--muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #ccd6e0;
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.incidents-container {
    display: grid;
    gap: 1rem;
}

.incident-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.incident-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 42, 68, 0.12);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.incident-title {
    font-weight: 700;
    color: var(--navy);
    font-size: 1rem;
}

.incident-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

.incident-location {
    margin-top: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.status-call_added {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.status-responding {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.status-on_scene {
    background: rgba(22, 163, 74, 0.15);
    color: #15803d;
}

.status-cancelled,
.status-cleared {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

.incident-details {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--slate);
    display: grid;
    gap: 0.35rem;
}

.mutual-aid-label {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.8rem;
}

.map-panel {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.map-header h2 {
    font-family: 'Libre Franklin', sans-serif;
    color: var(--navy);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.blue { background: #2563eb; }
.legend-dot.amber { background: #f59e0b; }
.legend-dot.green { background: #16a34a; }
.legend-dot.slate { background: #64748b; }

.map-canvas {
    width: 100%;
    min-height: 520px;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 560px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
}

.modal-header h2 {
    font-family: 'Libre Franklin', sans-serif;
    color: var(--navy);
}

.modal-section {
    margin-top: 1.5rem;
}

.modal-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.agency-item,
.update-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.update-message {
    font-weight: 600;
    color: var(--navy);
}

@media (max-width: 980px) {
    .feed-body {
        grid-template-columns: 1fr;
    }

    .map-canvas {
        min-height: 420px;
    }

    .header-inner {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .feed-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
