body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #e7eef4; color: #1f2937; }
a { color: #0f4c81; }
.page { max-width: 1380px; margin: 0 auto; padding: 14px 18px; }
.site-header { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(260px, 380px) minmax(220px, auto); gap: 18px; align-items: end; background: #f8fbfd; border-top: 5px solid #0f4c81; border-bottom: 1px solid #cbd8e4; padding: 14px 16px 13px; }
.site-kicker { color: #0f4c81; display: inline-block; font-size: 12px; font-weight: bold; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px; text-decoration: none; }
.site-kicker:hover, .site-kicker:focus { color: #145994; text-decoration: underline; text-underline-offset: 3px; }
.site-header h1 { margin: 0 0 4px; color: #0f2740; font-size: 28px; line-height: 1.05; letter-spacing: -0.02em; }
.site-title-link { color: inherit; text-decoration: none; }
.site-title-link:hover, .site-title-link:focus { color: #145994; text-decoration: underline; text-underline-offset: 4px; }
.site-header p { margin: 0; max-width: 780px; color: #475569; font-size: 14px; line-height: 1.35; }
.blacknight-logo { justify-self: center; align-self: center; display: block; max-width: 360px; width: 100%; text-decoration: none; }
.blacknight-logo img { display: block; width: 100%; height: auto; max-height: 82px; object-fit: contain; border-radius: 4px; }
.header-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; flex: 0 0 auto; }
.partner-credit { color: #475569; font-size: 14px; line-height: 1.35; text-align: right; }
.partner-credit a { color: #0f4c81; font-weight: bold; text-decoration: none; }
.top-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; }
.top-links a { color: #0f4c81; background: #e8f0f7; border: 1px solid #c7d7e6; border-radius: 999px; padding: 6px 10px; font-weight: bold; text-decoration: none; }
.top-links a:hover { background: #dbeaf6; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #d7e2ec; border-radius: 8px; margin-top: 10px; padding: 10px 14px; box-shadow: none; }
.toolbar-left { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1 1 720px; }
.toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 0 0 auto; }
.search-wrap { flex: 1 1 320px; }
.search-wrap input { width: 320px; max-width: 100%; padding: 9px 12px; border: 1px solid #c8d3df; border-radius: 10px; font-size: 14px; box-sizing: border-box; }
.toggle-group { display: inline-flex; background: #e7eef7; border-radius: 999px; padding: 4px; width: auto; }
.toggle-group button { border: 0; background: transparent; color: #27496d; padding: 7px 14px; border-radius: 999px; font-weight: bold; cursor: pointer; min-height: 38px; min-width: 82px; }
.toggle-group button.active { background: #0f4c81; color: #fff; }
.metric-group { display: inline-flex; background: #edf2f7; border-radius: 999px; padding: 4px; }
.metric-group button { border: 0; background: transparent; color: #27496d; padding: 7px 12px; border-radius: 999px; font-weight: bold; cursor: pointer; min-height: 36px; }
.metric-group button.active { background: #145994; color: #fff; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; background: #f8fafc; border: 1px solid #d6e0ea; border-radius: 999px; padding: 8px 12px; font-size: 13px; min-height: 38px; box-sizing: border-box; }
.check-pill input { width: 16px; height: 16px; }
.panel { margin-top: 12px; }
.panel.hidden { display: none; }
.map-shell { position: relative; }
#map { height: 730px; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1); }
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 600; max-width: calc(100% - 24px); background: rgba(255, 255, 255, 0.94); border: 1px solid rgba(203, 213, 225, 0.95); border-radius: 12px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16); color: #0f172a; pointer-events: none; }
.map-legend-title { font-size: 12px; font-weight: bold; margin-bottom: 6px; }
.map-legend-scale { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.legend-chip { width: 13px; height: 13px; border-radius: 4px; border: 1px solid rgba(15, 23, 42, 0.22); box-sizing: border-box; }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.info-card { background: #fff; border: 1px solid #d7e2ec; border-radius: 8px; padding: 10px 12px; box-shadow: none; }
.info-card .label { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.info-card .value { font-size: 18px; font-weight: bold; color: #0f172a; }
.table-card { background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08); margin-bottom: 18px; overflow: hidden; }
.table-card h2 { margin: 0 0 5px; font-size: 23px; color: #0f4c81; }
.legal-card { max-width: 980px; margin: 14px auto 18px; line-height: 1.55; }
.legal-card h2 { margin-top: 20px; }
.legal-card h2:first-child { margin-top: 0; }
.legal-card p { margin: 0 0 12px; }
.legal-card li { margin-bottom: 7px; }
.legal-updated { color: #64748b; font-size: 13px; }
.table-meta { color: #64748b; font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #dde7f0; text-align: left; font-size: 14px; vertical-align: top; }
th { background: #0f4c81; color: #fff; position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; padding-top: 13px; padding-bottom: 13px; }
th.sortable:hover { background: #145994; }
th.sortable:after { content: ' \2195'; font-size: 11px; opacity: 0.75; }
th.sortable.sort-asc:after { content: ' \2191'; opacity: 1; }
th.sortable.sort-desc:after { content: ' \2193'; opacity: 1; }
tr:hover { background: #f8fbff; }
.temp { font-weight: bold; }
.station-link { font-weight: bold; text-decoration: none; display: inline-block; }
.notice { background: #fff8df; border: 1px solid #f0dfa3; border-radius: 14px; padding: 12px 14px; margin-top: 18px; color: #7c5b00; }
.table-hidden { display: none; }
.marker-dot { width: 34px; height: 34px; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25); position: relative; }
.marker-dot.type-main { border-radius: 50%; }
.marker-dot.type-camp { border-radius: 10px; }
.marker-dot.type-buoy { border-radius: 4px; border-style: double; }
.marker-dot.type-ni_airport { border-radius: 6px; border-style: dashed; }
.marker-dot.type-ni_metoffice { border-radius: 6px; border-style: dotted; }
.marker-dot .temp-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 11px; font-weight: bold; color: #fff; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.popup-card { min-width: 180px; line-height: 1.45; }
.popup-title { font-weight: bold; font-size: 15px; margin-bottom: 4px; }
.popup-meta { color: #64748b; font-size: 12px; margin-bottom: 4px; }
.popup-list { display: grid; grid-template-columns: auto auto; gap: 4px 8px; margin: 8px 0; font-size: 13px; }
.popup-list dt { margin: 0; font-weight: bold; }
.popup-list dd { margin: 0; text-align: right; }
.popup-link { margin-top: 10px; font-size: 13px; }
.footer-note { margin-top: 8px; color: #64748b; font-size: 12px; line-height: 1.4; }
.site-footer { margin: 20px 0 8px; text-align: center; color: #64748b; font-size: 13px; line-height: 1.6; }
.site-footer a { color: #0f4c81; }
.footer-links { display: inline-block; margin-left: 10px; }
@media (max-width: 920px) {
    .info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
    #map { height: 600px; }
}
@media (max-width: 768px) {
    .page { padding: 6px; }
    .site-header { display: block; padding: 10px; border-top-width: 4px; }
    .site-kicker { font-size: 10px; margin-bottom: 3px; }
    .site-header h1 { font-size: 19px; margin-bottom: 3px; }
    .site-header p { font-size: 11px; line-height: 1.3; }
    .blacknight-logo { max-width: 260px; margin: 9px 0 0; justify-self: start; }
    .blacknight-logo img { max-height: 58px; }
    .header-side { align-items: flex-start; gap: 7px; margin-top: 8px; }
    .partner-credit { text-align: left; font-size: 12px; }
    .top-links { justify-content: flex-start; font-size: 12px; }
    .top-links a { padding: 5px 8px; }
    .toolbar { padding: 8px; gap: 8px; margin-top: 8px; border-radius: 8px; }
    .toolbar-left, .toolbar-right { width: 100%; flex: none; }
    .toolbar-left { flex-direction: column; align-items: stretch; }
    .toolbar-right { justify-content: stretch; }
    .search-wrap { width: 100%; flex: none; }
    .search-wrap input { width: 100%; }
    .check-row { width: 100%; }
    .metric-group { display: flex; width: 100%; }
    .metric-group button { flex: 1 1 25%; }
    .toggle-group { display: flex; width: 100%; }
    .toggle-group button { flex: 1 1 50%; }
    .info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
    .info-card { padding: 7px 6px; border-radius: 10px; }
    .info-card .label { font-size: 8px; letter-spacing: 0.02em; margin-bottom: 3px; }
    .info-card .value { font-size: 15px; }
    #map { height: 74vh; min-height: 560px; max-height: 760px; }
    .map-legend { left: 8px; right: 8px; bottom: 8px; max-width: none; padding: 6px 7px; border-radius: 10px; }
    .map-legend-title { font-size: 11px; margin-bottom: 4px; }
    .map-legend-scale { gap: 4px 6px; }
    .legend-item { font-size: 10px; gap: 3px; }
    .legend-chip { width: 10px; height: 10px; }
    .footer-note { font-size: 11px; line-height: 1.35; margin-top: 7px; }
    .marker-dot { width: 28px; height: 28px; }
    .marker-dot .temp-label { font-size: 10px; }
    .popup-card { min-width: 220px; }
    .popup-title { font-size: 16px; }
    .popup-meta, .popup-list, .popup-link { font-size: 14px; }
    .table-card { padding: 16px; }
    .table-card h2 { font-size: 21px; }
    .table-wrap { overflow: visible; }
    table { min-width: 0; }
    thead { display: block; margin-bottom: 10px; }
    thead tr { display: flex; flex-wrap: wrap; gap: 8px; }
    th { position: static; display: inline-flex; align-items: center; justify-content: center; width: auto; border-radius: 999px; padding: 10px 12px; font-size: 13px; line-height: 1.2; border-bottom: 0; }
    tbody, tr, td { display: block; width: 100%; box-sizing: border-box; }
    tbody { display: block; }
    tr { margin-bottom: 14px; border: 1px solid #dbe6f1; border-radius: 16px; overflow: hidden; background: #fbfdff; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05); }
    tr:last-child { margin-bottom: 0; }
    td { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 10px 14px; border-bottom: 1px solid #e9f0f7; font-size: 14px; }
    td:last-child { border-bottom: 0; }
    td:before { content: attr(data-label); display: block; flex: 0 0 44%; max-width: 44%; color: #64748b; font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.04em; }
    td.mobile-primary { display: block; padding-bottom: 8px; }
    td.mobile-primary:before { display: none; }
    td.mobile-primary .station-link { font-size: 17px; line-height: 1.3; margin-bottom: 6px; }
    td.mobile-primary .mobile-subtitle { color: #64748b; font-size: 13px; line-height: 1.45; }
    .mobile-optional { display: none; }
}
@media (max-width: 480px) {
    .page { padding: 5px; }
    .site-header { padding: 8px; }
    .site-header h1 { font-size: 17px; }
    .site-header p { font-size: 10px; }
    .blacknight-logo { max-width: 220px; }
    .blacknight-logo img { max-height: 50px; }
    .partner-credit { font-size: 11px; }
    .toolbar { padding: 7px; border-radius: 8px; }
    .check-row { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .check-pill { flex: 1 1 calc(50% - 6px); width: auto; justify-content: center; padding: 8px 6px; font-size: 12px; min-height: 38px; }
    .info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .info-card { padding: 6px 5px; border-radius: 10px; }
    .info-card .label { font-size: 8px; letter-spacing: 0.02em; }
    .info-card .value { font-size: 14px; }
    #map { height: 78vh; min-height: 620px; max-height: 820px; }
    td { padding: 10px 12px; gap: 10px; }
    td:before { flex-basis: 42%; max-width: 42%; font-size: 11px; }
    td.mobile-primary .station-link { font-size: 16px; }
}
