body {
    margin: 0;
    background: #e8eff5;
    color: #08233d;
    font-family: Arial, sans-serif;
}

a {
    color: #0f4c81;
    font-weight: bold;
}

.page {
    max-width: 1380px;
    margin: 0 auto;
    padding: 12px 18px 28px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #0f4c81, #0f766e);
    color: #fff;
    border-radius: 0 0 18px 18px;
    padding: 18px 22px;
    box-shadow: 0 10px 24px rgba(15, 76, 129, 0.16);
}

.site-header a {
    color: #fff;
}

.site-kicker {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    text-decoration: none;
}

.site-header h1 {
    margin: 4px 0;
    font-size: 30px;
    line-height: 1.1;
}

.site-header h1 a {
    text-decoration: none;
}

.site-header p {
    margin: 0;
    max-width: 760px;
    line-height: 1.45;
}

.header-side {
    text-align: right;
    min-width: 260px;
}

.partner-credit {
    line-height: 1.35;
    margin-bottom: 10px;
}

.top-links {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.top-links a {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 7px 12px;
    text-decoration: none;
}

.notice {
    margin: 18px 0;
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    border-radius: 12px;
    padding: 14px 16px;
    color: #075985;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 18px 0 12px;
}

.info-card,
.toolbar,
.table-card {
    background: #fff;
    border: 1px solid #d5e1ec;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.info-card {
    padding: 12px 14px;
}

.label {
    color: #49627c;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.value {
    font-size: 22px;
    font-weight: bold;
    margin-top: 4px;
}

.small-value {
    font-size: 15px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 12px;
}

#waterSearch {
    width: 360px;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8d3df;
    border-radius: 9px;
    font-size: 14px;
}

.map-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #b9d5e6;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

#waterMap {
    height: 68vh;
    min-height: 560px;
    background: #a9d6df;
}

.water-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 500;
    background: rgba(255,255,255,0.92);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    padding: 10px 12px;
    font-weight: bold;
    max-width: calc(100% - 28px);
    box-sizing: border-box;
}

.water-legend-title {
    margin-bottom: 6px;
}

.water-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    font-weight: normal;
}

.water-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.water-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.water-legend-note {
    margin-top: 6px;
    color: #49627c;
    font-size: 11px;
    font-weight: normal;
}

.water-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 36px;
    box-sizing: border-box;
    flex-direction: column;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #0f4c81;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.26);
}

.water-marker span {
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.water-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #0f4c81;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.28);
}

.water-popup h3 {
    margin: 0 0 6px;
}

.water-popup table {
    border-collapse: collapse;
    width: 100%;
}

.water-popup th,
.water-popup td {
    text-align: left;
    padding: 3px 8px 3px 0;
    white-space: nowrap;
    vertical-align: top;
}

.table-card {
    margin-top: 16px;
    padding: 16px;
}

.table-card h2 {
    margin: 0 0 12px;
    color: #0f4c81;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #0f4c81;
    color: #fff;
    text-align: left;
    padding: 10px 12px;
}

td {
    border-bottom: 1px solid #dbe6f0;
    padding: 10px 12px;
}

.context-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 9px;
    white-space: nowrap;
    font-weight: bold;
    font-size: 12px;
}

.context-green { background: #dcfce7; color: #14532d; }
.context-yellow { background: #fef9c3; color: #713f12; }
.context-orange { background: #ffedd5; color: #9a3412; }
.context-red { background: #fee2e2; color: #991b1b; }
.context-unknown { background: #e2e8f0; color: #334155; }

.hidden-row {
    display: none;
}

.site-footer {
    text-align: center;
    color: #49627c;
    font-size: 13px;
    margin-top: 18px;
}

@media (max-width: 768px) {
    .page {
        padding: 8px;
    }

    .site-header {
        display: block;
        padding: 14px;
        border-radius: 0 0 14px 14px;
    }

    .site-header h1 {
        font-size: 25px;
    }

    .header-side {
        text-align: left;
        min-width: 0;
        margin-top: 12px;
    }

    .top-links {
        justify-content: flex-start;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .toolbar {
        display: block;
    }

    #waterSearch {
        width: 100%;
        box-sizing: border-box;
    }

    #waterMap {
        height: 60vh;
        min-height: 430px;
    }
}

@media (max-width: 520px) {
    .water-popup table { table-layout: fixed; }
    .water-popup th, .water-popup td { white-space: normal; overflow-wrap: anywhere; }
    .water-popup th { width: 52%; }
}
