*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    background: #e8edf2;
    color: #222;
}

/* ---- Header ---- */
header {
    background: #1e4f7a;
    color: #fff;
    padding: 8px 16px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#clock {
    font-size: 17px;
    color: white;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

#title {
    text-align: center;
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

#time {
    text-align: right;
    font-size: 17px;
    color: white;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---- Main layout ---- */
main {
    padding: 14px;
    max-width: 100%;
}

#loading {
    padding: 24px 0;
    color: #555;
    font-size: 13px;
}

/* ---- Forecast wrapper (scroll container only) ---- */
.fcst-wrapper {
    overflow-x: auto;
}

/* Gap row between model blocks */
.model-gap td {
    height: 14px;
    padding: 0;
    border: none;
    background: #e8edf2;
}

/* Card borders around each model block */
.model-block > tr:first-child > th,
.model-block > tr:first-child > td {
    border-top: 1px solid #c4cdd6;
}
.model-block > tr:last-child > th,
.model-block > tr:last-child > td {
    border-bottom: 1px solid #c4cdd6;
}
.model-block > tr > th:last-child,
.model-block > tr > td:last-child {
    border-right: 1px solid #c4cdd6;
}
.model-block > tr:first-child > th:last-child,
.model-block > tr:first-child > td:last-child {
    border-top-right-radius: 4px;
}
.model-block > tr:last-child > th:last-child,
.model-block > tr:last-child > td:last-child {
    border-bottom-right-radius: 4px;
}

.model-label-cell {
    background: #1e4f7a;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    padding: 8px 5px;
    position: sticky;
    left: 0;
    z-index: 2;
    border: 1px solid #c4cdd6;
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.ml-inner {
    width: 64px; /* 68px total - 5px padding × 2 */
    word-break: break-word;
    text-wrap: wrap;
}

.ml-name {
    display: block;
    font-weight: bold;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
}

.ml-date {
    display: block;
    font-size: 10px;
    color: #a8d4f5;
    margin-top: 5px;
}

.ml-time {
    display: block;
    font-size: 10px;
    color: #a8d4f5;
}

.no-data {
    padding: 10px 14px;
    color: #888;
    font-style: italic;
}

.arrow-cell {
    padding: 2px 3px !important;
    background: #f8f8f8;
}

.dir-arrow {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0 auto;
}

/* ---- Forecast table ---- */
.fcst-table {
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
    font-size: 12px;
    background: #fff;
}

.fcst-table th,
.fcst-table td {
    /*border: 1px solid #d8dde3;*/
    padding: 4px 2px;
    text-align: center;
    /* min to have equal width for all cells, should do better */
    min-width: 26px;
}

.day-cell {
    background: #1e4f7a;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    border-color: #2a6090;
}

.day-cell.alt {
    background: #2e6f9e;
    border-color: #3a7aaa;
}

.fcst-table th.day-cell {
    border-color: #1e4f7a;
}

.fcst-table th.day-cell.alt {
    /*border-color: #2e6f9e;*/
}

.hour-cell {
    background: #1e4f7a;
    color: #fff;
    font-size: 11px;
    border-color: #ccccdd;
}

.hour-cell.alt {
    background: #2e6f9e;
    border-color: #ccccdd;
}

.day-boundary {
    border-left-color: #ccccdd !important;
    border-left-width: 2px !important;
}

td.past-hour {
    opacity: 0.35;
}

td.current-hour {
    border-left: 4px solid #1e4f7a !important;
    /*border-right: 2px solid #cc0000 !important;*/
}

/* ---- Station row: two equal blocks side by side ---- */
#stations {
    display: flex;
    gap: 16px;
    padding: 0 16px 16px;
}

.station-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.station-block-title {
    font-size: 12px;
    font-weight: bold;
    color: #555;
}

#station,
#wu-station {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #c4cdd6;
    border-radius: 4px;
    overflow: hidden;
}

#station-graph,
#wu-graph {
    flex: 1;
    min-width: 0;
    line-height: 0;
}

#station-info,
#wu-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #c4cdd6;
    font-size: 13px;
    white-space: nowrap;
}

.station-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.station-dir {
    padding: 10px 12px 6px;
}

.station-arrow {
    width: 40px;
    height: 40px;
    display: block;
}

.station-wind-avg {
    padding: 4px 14px;
    font-weight: bold;
    font-size: 18px;
}

.station-wind-range {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 12px;
    font-size: 11px;
    color: #555;
}

.station-temp {
    padding: 4px 14px 10px;
    font-size: 18px;
    font-weight: bold;
}

/* ---- Tide widget (sits between the two station columns) ---- */
.tide-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

#tides {
    flex: 1;
    display: flex;
}

.tide-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    border: 1px solid #c4cdd6;
    border-radius: 4px;
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
}

.tide-event {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.tide-event:last-child {
    border-bottom: none;
}

.tide-time {
    font-weight: bold;
    font-size: 14px;
    min-width: 3.2em;
}

.tide-height {
    font-size: 13px;
}

.tide-coeff {
    font-size: 11px;
    color: #555;
    min-width: 4em;
}

/* ---- Water level curve ---- */
#water-level {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid #c4cdd6;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
    align-self: stretch;
    position: relative;
}

.wl-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cc0000;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.wl-label {
    position: absolute;
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

.wl-label-high {
    color: #1e4f7a;
    transform: translate(-50%, calc(-100% - 14px));
}

.wl-label-low {
    color: #666;
    transform: translate(-50%, 14px);
}

/* ---- Pressure graph ---- */
#pressure {
    flex: 1;
    position: relative;
    background: #fff;
    border: 1px solid #c4cdd6;
    border-radius: 4px;
    overflow: hidden;
    line-height: 0;
}

.pressure-hpa-label {
    position: absolute;
    left: 3px;
    font-size: 11px;
    color: #aaa;
    transform: translateY(-50%);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1;
}

.pressure-hour-label {
    position: absolute;
    top: 3px;
    font-size: 11px;
    font-weight: bold;
    color: #888;
    transform: translateX(-50%);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1;
}

/* ---- Partner logos ---- */
#partners {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    padding: 0px 16px 32px;
}

#partners img {
    height: 48px;
    width: auto;
    object-fit: contain;
}
