:root {
    --bg: #e4e7ec;
    --panel: #f5f7fa;
    --panel-strong: #ffffff;
    --ink: #1d2f4a;
    --muted: #4a5b73;
    --accent: #0f3f86;
    --accent-dark: #0b2f63;
    --accent-soft: #d8e2f3;
    --line: #c4cfde;
    --topbar: #0f3f86;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #f0f2f5 0%, #e4e7ec 260px, #e4e7ec 100%);
}

body[data-page="home"] {
    background: linear-gradient(180deg, #edf1f7 0%, #dfe5ef 260px, #dfe5ef 100%);
}

h1, h2, h3 {
    margin: 0 0 0.6rem;
    line-height: 1.2;
    font-family: "Merriweather", Georgia, serif;
    color: #112d57;
}

a {
    color: inherit;
}

.public-layout {
    min-height: 100vh;
}

.public-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 232px;
    height: 100vh;
    z-index: 60;
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(15, 63, 134, 0.12);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 0.9rem 0.85rem;
    transition: transform 0.25s ease;
}

.public-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.public-logo-link {
    display: block;
}

.public-logo {
    width: 170px;
    max-width: 100%;
    height: auto;
}

.public-menu-close {
    display: none;
    border: 1px solid rgba(15, 63, 134, 0.2);
    background: #fff;
    color: var(--accent);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
}

.public-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1rem;
    flex: 1;
    overflow-y: auto;
}

.public-nav-item {
    text-decoration: none;
    color: #3b4b61;
    border-radius: 10px;
    padding: 0.58rem 0.72rem;
    border: 1px solid transparent;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.public-nav-item:hover {
    background: rgba(15, 63, 134, 0.08);
    border-color: rgba(15, 63, 134, 0.12);
    color: var(--accent-dark);
}

.public-nav-item.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 7px 16px rgba(15, 63, 134, 0.25);
}

.public-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.public-nav-subitem {
    margin-left: 0.9rem;
    font-size: 0.95rem;
    padding-top: 0.46rem;
    padding-bottom: 0.46rem;
    position: relative;
}

.public-nav-subitem::before {
    content: '↳';
    position: absolute;
    left: -0.62rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7f9c;
    font-size: 0.82rem;
}

.public-sidebar-footer {
    border-top: 1px solid rgba(15, 63, 134, 0.12);
    padding-top: 0.8rem;
}

.public-sidebar .lang-switch {
    border-color: rgba(15, 63, 134, 0.24);
    margin-left: 0;
}

.public-sidebar .lang-switch button {
    color: var(--accent-dark);
}

.public-sidebar .lang-switch button.active {
    background: var(--accent);
    color: #fff;
}

.public-main {
    margin-left: 232px;
    width: calc(100% - 232px);
    padding: 1.15rem 1.35rem 1.7rem;
}

.public-topbar {
    border: 1px solid rgba(15, 63, 134, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    padding: 0.95rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.public-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.public-topbar .page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-dark);
}

.public-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.public-top-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(15, 63, 134, 0.15);
    color: var(--accent-dark);
    font-weight: 700;
}

.public-menu-toggle {
    display: none;
    border: 1px solid rgba(15, 63, 134, 0.2);
    background: #fff;
    color: var(--accent-dark);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.public-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.public-home-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
}

body[data-page="home"] .hero h1 {
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
}

@media (max-width: 1100px) {
    .public-home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .public-sidebar {
        transform: translateX(-100%);
        width: 270px;
    }

    .public-main {
        margin-left: 0;
        width: 100%;
    }

    .public-menu-toggle,
    .public-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.public-menu-open .public-sidebar {
        transform: translateX(0);
    }

    body.public-menu-open .public-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 620px) {
    .public-main {
        padding: 0.8rem 0.75rem 1rem;
    }

    .public-topbar {
        padding: 0.75rem;
    }

    .public-topbar .page-title {
        font-size: 1rem;
        line-height: 1.25;
    }
}

.site-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--topbar);
    border-bottom: 3px solid #0a2d5d;
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.18);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.brand {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    text-decoration: none;
    color: #fff;
}

.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(
        180deg,
        #1f1f1f 0%,
        #1f1f1f 33.333%,
        #c03434 33.333%,
        #c03434 66.666%,
        #f0c53a 66.666%,
        #f0c53a 100%
    );
}

.brand-text {
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.94rem;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.pill {
    border: 1px solid transparent;
    color: #fff;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.lang-switch {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    overflow: hidden;
    margin-left: 0.2rem;
}

.lang-switch button {
    border: none;
    background: transparent;
    color: #fff;
    padding: 0.3rem 0.55rem;
    font-weight: 700;
    cursor: pointer;
}

.lang-switch button.active {
    background: #fff;
    color: var(--accent);
}

.hero {
    margin-top: 0.9rem;
    background: linear-gradient(180deg, #fafbfc 0%, #edf2f8 100%);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.6rem;
    display: grid;
    gap: 0.7rem;
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        118deg,
        transparent 0%,
        transparent 62%,
        rgba(15, 63, 134, 0.08) 84%,
        rgba(15, 63, 134, 0.16) 100%
    );
    pointer-events: none;
}

.hero > * {
    position: relative;
}

.hero-kicker {
    margin: 0;
    color: var(--accent);
    font-family: "Merriweather", Georgia, serif;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4.7vw, 3rem);
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
    max-width: 760px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
}

.section {
    margin-top: 1rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1rem;
}

.article-copy h1 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.article-copy h2 {
    font-size: 1.5rem;
    margin-top: 1.2rem;
}

.article-copy p {
    margin: 0 0 0.95rem;
    line-height: 1.65;
}

.article-copy ul {
    margin: 0 0 0.95rem 1.15rem;
    padding: 0;
    list-style: disc;
}

.article-copy ul ul {
    margin-top: 0.5rem;
}

.article-copy li {
    margin: 0.35rem 0;
}

.article-copy a {
    color: #1a5ea8;
    text-decoration: underline;
}

.article-copy iframe {
    display: block;
}

.badge {
    display: inline-block;
    background: #e7eef9;
    color: #12386f;
    border: 1px solid #cad8ef;
    border-radius: 999px;
    font-size: 0.77rem;
    padding: 0.2rem 0.55rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.event-item {
    border: 1px solid #d2dbe8;
    border-radius: 6px;
    padding: 0.72rem;
    background: var(--panel-strong);
}

.event-item .meta {
    color: var(--muted);
    font-size: 0.93rem;
}

.cta {
    display: inline-block;
    margin-top: 0.55rem;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    padding: 0.57rem 0.85rem;
    border: 1px solid var(--accent);
    font-weight: 700;
}

.cta:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.cta.secondary {
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid #b4c5de;
}

.cta.secondary:hover {
    background: #f2f6fc;
}

.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.7rem;
}

.archive-item {
    border: 1px solid #d2dbe8;
    border-radius: 6px;
    padding: 0.8rem;
    background: var(--panel-strong);
}

.report-points {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
}

.report-points li {
    margin: 0.35rem 0;
}

.muted {
    color: var(--muted);
}

.footer {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font-size: 0.92rem;
}

.incident-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.incident-form input,
.incident-form select,
.incident-form textarea {
    width: 100%;
    border: 1px solid #c5cfde;
    border-radius: 6px;
    padding: 0.55rem 0.65rem;
    font: inherit;
    background: var(--panel-strong);
}

.incident-form textarea {
    resize: vertical;
}

.incident-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.7rem;
}

.incident-block {
    margin-top: 0.75rem;
}

.incident-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.7rem;
}

.incident-map-card {
    margin-top: 0.75rem;
    border: 1px solid #c8d2e1;
    border-radius: 6px;
    background: var(--panel-strong);
    overflow: hidden;
}

#incident-map {
    min-height: 340px;
}

.incident-map-warning {
    border-top: 1px solid var(--line);
    padding: 0.55rem 0.7rem;
    color: #92400e;
    background: #fffbeb;
    font-size: 0.9rem;
}

.map-mode-placeholder {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.4rem;
    color: #4b5563;
    background: repeating-linear-gradient(
        45deg,
        #f8fafc,
        #f8fafc 14px,
        #eef2f7 14px,
        #eef2f7 28px
    );
}

.security-map-shell .hero {
    margin-bottom: 0.2rem;
}

.security-map-filter-bar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.security-map-filter-bar select {
    min-width: 170px;
}

.security-map-status {
    margin-top: 0.55rem;
    min-height: 1.25rem;
}

.security-map-canvas {
    margin-top: 0.65rem;
    min-height: 480px;
    border: 1px solid #c8d2e1;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.security-map-share {
    margin-top: 0.65rem;
    color: var(--muted);
    font-size: 0.92rem;
    word-break: break-word;
}

.security-map-code {
    display: block;
    margin-top: 0.55rem;
    padding: 0.7rem;
    border: 1px solid #c8d2e1;
    border-radius: 6px;
    background: #f8fafc;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

body.embed-mode .topbar,
body.embed-mode .hero,
body.embed-mode .footer,
body.embed-mode .security-map-shell .section:last-of-type {
    display: none;
}

body.embed-mode .site-shell {
    max-width: 100%;
    padding: 0;
}

body.embed-mode .site-shell .section {
    margin-top: 0;
}

body.embed-mode .site-shell .card {
    border-radius: 0;
    border: none;
}

@media (max-width: 980px) {
    .brand-text {
        font-size: 0.82rem;
    }

    .hero {
        padding: 1.25rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

@media (max-width: 860px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }

    .top-actions {
        width: 100%;
        gap: 0.35rem;
    }

    .pill {
        padding: 0.32rem 0.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    #incident-map {
        min-height: 260px;
    }

    .security-map-canvas {
        min-height: 360px;
    }
}
