html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
}

body {
    display: flex;
    flex-direction: column;
}

header {
    background: #ffffff;
    border-bottom: 1px solid #d9d9d9;
    padding: 12px 18px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    font-size: 22px;
}

.subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

#updated {
    font-size: 13px;
    color: #555;
}

.controls {
    background: #ffffff;
    border-bottom: 1px solid #ddd;

    padding: 8px 18px;

    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.controls label {
    font-size: 13px;
    font-weight: bold;
}

.controls select {
    margin-left: 6px;
    padding: 5px;
}

#stats {
    margin-left: auto;
    font-size: 13px;
    font-weight: bold;
}

#map {
    flex: 1;
    min-height: 400px;
}

footer {
    background: #ffffff;
    border-top: 1px solid #ddd;

    padding: 6px 12px;

    text-align: center;
    font-size: 11px;
    color: #666;
}

.popup-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 6px;
}

.popup-row {
    margin: 3px 0;
}

@media (max-width: 700px) {

    header {
        align-items: flex-start;
        gap: 8px;
        flex-direction: column;
    }

    h1 {
        font-size: 18px;
    }

    .controls {
        gap: 8px;
    }

    #stats {
        width: 100%;
        margin-left: 0;
    }
}

#updated {
    color: #b00020;
    font-weight: bold;
}

#infoButton {
    padding: 6px 10px;
    border: 1px solid #999;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

#infoButton:hover {
    background: #f2f2f2;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.45);
}

.modal.show {
    display: block;
}

.modal-content {
    background: #fff;
    margin: 5vh auto;
    padding: 22px;
    width: min(850px, 92%);
    border-radius: 8px;
    position: relative;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.criteria-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

.criteria-table th,
.criteria-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
    text-align: left;
}

.criteria-table th {
    background: #f3f3f3;
}

.criteria-note {
    margin-top: 14px;
    font-size: 12px;
    color: #666;
}

.popup-tsunami {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #ddd;
    font-weight: bold;
}
