/* ── Container ──────────────────────────────────────────────────────────── */
.vx-tidal-chart-widget {
	width: 100%;
	box-sizing: border-box;
}

.vx-tidal-chart-wrap {
	width: 100%;
	min-width: 0;
}

.vx-tidal-canvas {
	display: block;
	width: 100% !important;
}

/* ── State messages ─────────────────────────────────────────────────────── */
.vx-tidal-placeholder,
.vx-tidal-error {
	padding: 14px 16px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
}

.vx-tidal-placeholder {
	background: #f4f6f8;
	border: 1px dashed #ccc;
	color: #666;
}

.vx-tidal-error {
	background: #fff8e1;
	border: 1px solid #f0c040;
	color: #7a5c00;
}

.vx-tidal-placeholder p,
.vx-tidal-error p {
	margin: 0;
}

/* ── Tide events table ──────────────────────────────────────────────────── */
.vx-tidal-events {
	margin-top: 18px; /* default (below) spacing */
}

/* ── Table position variants ────────────────────────────────────────────── */

/* Above: column layout, table on top */
.vx-tidal--table-above {
	display: flex;
	flex-direction: column;
}
.vx-tidal--table-above .vx-tidal-events {
	order: -1;
	margin-top: 0;
	margin-bottom: 18px;
}

/* Below: natural stacking, no flex needed — margin-top on events handles spacing */

/* Left: row layout, table on left */
.vx-tidal--table-left {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 20px;
}
.vx-tidal--table-left .vx-tidal-events {
	order: -1;
	flex: 0 0 200px;
	margin-top: 0;
}
.vx-tidal--table-left .vx-tidal-chart-wrap {
	flex: 1;
}

/* Right: row layout, table on right */
.vx-tidal--table-right {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 20px;
}
.vx-tidal--table-right .vx-tidal-events {
	flex: 0 0 200px;
	margin-top: 0;
}
.vx-tidal--table-right .vx-tidal-chart-wrap {
	flex: 1;
}

/* Collapse side-by-side layouts on narrow screens */
@media (max-width: 600px) {
	.vx-tidal--table-left,
	.vx-tidal--table-right {
		flex-direction: column;
	}
	.vx-tidal--table-left .vx-tidal-events,
	.vx-tidal--table-right .vx-tidal-events {
		flex: none;
		width: 100%;
	}
	.vx-tidal--table-left .vx-tidal-events {
		margin-bottom: 18px;
	}
	.vx-tidal--table-right .vx-tidal-events {
		order: 1;
		margin-top: 18px;
	}
}

.vx-tidal-no-events {
	margin: 6px 0 0;
	font-size: 13px;
	color: #999;
}

.vx-tidal-station {
	margin: 10px 0 0;
	font-size: 12px;
	color: #888;
}

.vx-tidal-copyright {
	flex-basis: 100%; /* spans full width in left/right flex layouts */
	margin: 12px 0 0;
	padding-top: 8px;
	border-top: 1px solid #ebebeb;
	font-size: 11px;
	color: #aaa;
	text-align: left;
}

.vx-tidal-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.vx-tidal-table th,
.vx-tidal-table td {
	padding: 7px 12px;
	text-align: left;
	border-bottom: 1px solid #ebebeb;
}

.vx-tidal-table th {
	font-weight: 600;
	color: #555;
	background: #f8f9fa;
}

/* Right-align the height column */
.vx-tidal-table th:last-child,
.vx-tidal-table td:last-child {
	text-align: right;
}

.vx-tidal-table tr:last-child td {
	border-bottom: none;
}
