* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #f4f5f7;

    color: #222;
}

.site-header {
    height: 72px;

    background: #ffffff;

    border-bottom:
        1px solid #e5e7eb;

    display: flex;
    align-items: center;

    padding: 0 24px;
}


.header-content {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;
}


.brand {
    display: flex;

    align-items: center;

    gap: 12px;
}


.brand-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff1f0;

    border-radius: 6px;

    font-size: 23px;
}


.brand h1 {
    margin: 0;

    font-size: 20px;

    font-weight: 700;

    line-height: 1.2;
}


.brand p {
    margin: 3px 0 0;

    color: #6b7280;

    font-size: 13px;
}


.app-layout {
    width: 100%;

    max-width: 1600px;

    height:
        calc(100vh - 72px);

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        320px minmax(0, 1fr);

    gap: 0;
}


.sidebar {
    background: #ffffff;

    border-right:
        1px solid #e5e7eb;

    padding: 24px;

    overflow-y: auto;
}


.panel {
    background: #ffffff;
}


.panel + .panel {
    margin-top: 30px;

    padding-top: 24px;

    border-top:
        1px solid #e5e7eb;
}


.panel h2 {
    margin: 0 0 10px;

    font-size: 20px;

    font-weight: 700;
}


.panel h3 {
    margin: 0 0 18px;

    font-size: 15px;

    font-weight: 700;
}


.panel-description {
    margin: 0;

    color: #6b7280;

    font-size: 14px;

    line-height: 1.6;
}


.alert-settings {
    margin-top: 24px;

    display: flex;

    flex-direction: column;

    gap: 16px;
}


.setting-group {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


.setting-group label {
    font-size: 13px;

    font-weight: 600;

    color: #374151;
}


select {
    width: 100%;

    min-height: 42px;

    padding:
        0 12px;

    border:
        1px solid #d1d5db;

    border-radius: 9px;

    background: #ffffff;

    color: #222;

    font-size: 14px;

    cursor: pointer;
}


select:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.12);
}


button {
    font-family: inherit;
}


.primary-button {
    width: 100%;

    min-height: 44px;

    border: none;

    border-radius: 9px;

    background: #dc2626;

    color: white;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}


.primary-button:hover {
    background: #b91c1c;
}


.primary-button:active {
    transform: translateY(1px);
}


.status {
    min-height: 20px;

    font-size: 13px;

    line-height: 1.4;

    color: #4b5563;
}


.instruction {
    display: flex;

    gap: 12px;

    margin-bottom: 18px;
}


.instruction:last-child {
    margin-bottom: 0;
}


.instruction-icon {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #FA8072;

    border-radius: 5px;
}


.instruction strong {
    display: block;

    margin-bottom: 4px;

    font-size: 13px;
}


.instruction p {
    margin: 0;

    color: #6b7280;

    font-size: 12px;

    line-height: 1.5;
}


.map-area {
    position: relative;

    min-width: 0;

    min-height: 0;

    padding: 16px;

    display: flex;

    flex-direction: column;

    background: #eef0f2;
}


.map-toolbar {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;

    flex-wrap: wrap;
}


.map-mode-buttons {
    display: flex;

    align-items: center;

    gap: 6px;

    padding: 4px;

    background: #ffffff;

    border:
        1px solid #e5e7eb;

    border-radius: 10px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.06);
}


.map-mode-button {
    min-height: 38px;

    padding:
        0 14px;

    border: none;

    border-radius: 7px;

    background: transparent;

    color: #4b5563;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.map-mode-button:hover {
    background: #f3f4f6;
}


.map-mode-button.active {
    background: #FA8072;

    color: #ffffff;
}

.footer-description {
    margin-right: 30%;
    margin-left: 30%;
}

.site-footer {
    width: 100%;
    padding: 18px 24px;

    text-align: center;

    background: #111827;
    color: #9ca3af;

    border-top: 1px solid #374151;

    font-size: 13px;
}

.site-footer p {
    margin: 0;
}

.location-controls {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 4px;

    background: #ffffff;

    border:
        1px solid #e5e7eb;

    border-radius: 10px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.06);

    transition:
        opacity 0.15s ease;
}


.location-control-group {
    display: flex;

    align-items: center;

    gap: 7px;

    padding-left: 8px;
}


.location-control-group label {
    color: #6b7280;

    font-size: 12px;

    font-weight: 600;
}


.location-control-group select {
    width: 90px;

    min-height: 36px;

    border: none;

    box-shadow: none;

    background: #f3f4f6;

    border-radius: 7px;

    padding: 0 8px;

    font-size: 12px;
}


.location-button {
    min-height: 36px;

    padding:
        0 13px;

    border: none;

    border-radius: 7px;

    background: #f3f4f6;

    color: #374151;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;
}


.location-button:hover {
    background: #e5e7eb;
}

.map-mode-status {
    align-self: flex-start;

    margin-bottom: 10px;

    padding:
        7px 11px;

    background:
        rgba(255, 255, 255, 0.94);

    border:
        1px solid #e5e7eb;

    border-radius: 8px;

    box-shadow:
        0 2px 6px
        rgba(0, 0, 0, 0.05);

    color: #6b7280;

    font-size: 12px;
}

#map {
    flex: 1;

    min-height: 0;

    width: 100%;

    border-radius: 12px;

    overflow: hidden;

    box-shadow:
        0 3px 15px
        rgba(0, 0, 0, 0.12);
}

.leaflet-container {
    font-family: inherit;
}


.leaflet-popup-content {
    line-height: 1.5;
}

@media (max-width: 900px) {

    .site-header {
        height: 64px;

        padding: 0 16px;
    }


    .brand h1 {
        font-size: 17px;
    }


    .brand p {
        display: none;
    }


    .app-layout {
        height:
            calc(100vh - 64px);

        grid-template-columns:
            1fr;

        grid-template-rows:
            auto minmax(0, 1fr);
    }


    .sidebar {
        border-right: none;

        border-bottom:
            1px solid #e5e7eb;

        padding: 16px;
    }


    .panel + .panel {
        display: none;
    }


    .panel h2 {
        font-size: 17px;
    }


    .panel-description {
        display: none;
    }


    .alert-settings {
        margin-top: 14px;

        display: grid;

        grid-template-columns:
            1fr 1fr;

        gap: 10px;
    }


    .setting-group {
        grid-column: 1;
    }


    .primary-button {
        grid-column: 2;

        align-self: end;
    }


    .status {
        grid-column: 1 / -1;
    }


    .map-area {
        padding: 10px;
    }


    .map-toolbar {
        align-items: stretch;

        flex-direction: column;
    }


    .map-mode-buttons {
        width: 100%;
    }


    .map-mode-button {
        flex: 1;
    }


    .location-controls {
        width: 100%;

        justify-content: space-between;
    }


    .location-button {
        flex: 1;
    }


    .map-mode-status {
        max-width: 100%;

        margin-bottom: 8px;
    }

    .footer-description {
        margin-right: 10%;
        margin-left: 10%;
    }

}


@media (max-width: 500px) {

    .alert-settings {
        grid-template-columns: 1fr;
    }


    .setting-group,
    .primary-button,
    .status {
        grid-column: 1;
    }


    .map-mode-button {
        padding: 0 8px;

        font-size: 12px;
    }


    .location-controls {
        flex-wrap: wrap;
    }


    .location-control-group {
        flex: 1;
    }


    .location-button {
        flex: 1 1 100%;
    }

    .footer-description {
        margin-right: 5%;
        margin-left: 5%;
    }

}

.emergency-section {
    text-align: center;

    margin: 20px;
    padding: 22px;

    background: #FA8072;
    border-radius: 6px;
}

.emergency-section h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.emergency-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 16px;
    justify-content: center;
}

.emergency-number {
    display: flex;
    flex-direction: column;

    min-width: 130px;

    padding: 12px 16px;

    text-decoration: none;

    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;

    color: #222;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.emergency-number:hover {
    transform: translateY(-2px);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12);
}

.emergency-number strong {
    font-size: 24px;
}

.emergency-number span {
    font-size: 13px;
    margin-top: 2px;
}

.primary-emergency {
    border: 2px solid #dc2626;
}

.emergency-warning {
    margin-bottom: 0;
    margin-top: 16px;

    font-size: 13px;
    font-weight: 600;
}