/* ── Widget container ───────────────────────────────────────────────────── */
.vwr-widget {
	display: block;
	width: 100%;
	box-sizing: border-box;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Anchorage name heading ─────────────────────────────────────────────── */
.vwr-heading {
	font-size: 13px;
	font-weight: 700;
	color: #2d3748;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	text-align: center;
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e2e8f0;
}

/* ── Layout: rose + legend ──────────────────────────────────────────────── */
.vwr-layout {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: center;
	gap: 24px;
}

/* Top / Bottom: stack vertically, rose and legend both centered */
.vwr-layout--top,
.vwr-layout--bottom {
	flex-direction: column;
	align-items: center;
}

/* Left / Right: side-by-side (flex-wrap still active for narrow screens) */
.vwr-layout--left,
.vwr-layout--right {
	flex-direction: row;
	align-items: flex-start;
}

/* Legend comes before the rose for top/left positions */
.vwr-layout--top .vwr-legend,
.vwr-layout--left .vwr-legend {
	order: -1;
}

/* ── Rose ───────────────────────────────────────────────────────────────── */
.vwr-rose-wrap {
	display: flex;
	justify-content: center;
	/* flex and max-width are set inline via JS using the configured size */
}

.vwr-rose-wrap svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ── Legend ─────────────────────────────────────────────────────────────── */
.vwr-legend {
	flex: 0 1 230px;
	min-width: 160px;
}

.vwr-legend-title {
	font-size: 10px;
	font-weight: 700;
	color: #718096;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 10px;
}

.vwr-legend-grid {
	display: flex;
	flex-direction: column;
}

.vwr-legend-row {
	display: grid;
	grid-template-columns: 16px 22px 80px 1fr;
	align-items: center;
	gap: 6px;
	padding: 6px 0;
	border-bottom: 1px solid #f0f4f8;
}

.vwr-legend-row:last-child {
	border-bottom: none;
}

.vwr-swatch {
	display: block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	flex-shrink: 0;
}

.vwr-legend-num {
	font-size: 13px;
	font-weight: 700;
	color: #2d3748;
	text-align: center;
}

.vwr-legend-label {
	font-size: 12px;
	font-weight: 600;
	color: #4a5568;
}

.vwr-legend-desc {
	font-size: 11px;
	color: #718096;
	line-height: 1.4;
}

.vwr-legend-note {
	margin: 12px 0 0;
	font-size: 11px;
	font-style: italic;
	color: #718096;
	line-height: 1.55;
}

/* ── Summary view ───────────────────────────────────────────────────────── */
.vwr-summary {
	display: inline-block;
	width: 100%;
}

.vwr-summary-score {
	display: flex;
	align-items: baseline;
	gap: 6px;
	padding-bottom: 14px;
	margin-bottom: 12px;
	border-bottom: 1px solid #e2e8f0;
}

.vwr-summary-num {
	font-size: 36px;
	font-weight: 700;
	line-height: 1;
	color: #2d3748;
}

.vwr-summary-outof {
	font-size: 13px;
	color: #718096;
	font-weight: 500;
}

/* All rows get consistent left/right padding so they align with the
   outlined active row. */
.vwr-summary .vwr-legend-grid {
	overflow: visible;
}

.vwr-summary .vwr-legend-row {
	padding-left: 6px;
	padding-right: 6px;
}

/* Highlighted tier: magnify by enlarging content in-flow rather than
   scaling the rendered element, so nothing overflows the container.
   Border is applied via inline style (admin settings) to override theme CSS. */
.vwr-summary .vwr-legend-row--active {
	border-radius: 4px;
	background: rgba(45, 55, 72, 0.05);
	padding-top: 9px;
	padding-bottom: 9px;
}

.vwr-summary .vwr-legend-row--active .vwr-swatch {
	width: 18px;
	height: 18px;
}

.vwr-summary .vwr-legend-row--active .vwr-legend-num {
	font-size: 17px;
}

.vwr-summary .vwr-legend-row--active .vwr-legend-label {
	font-size: 14px;
	font-weight: 700;
}

.vwr-summary .vwr-legend-row--active .vwr-legend-desc {
	font-size: 12px;
}

/* ── Tooltip ────────────────────────────────────────────────────────────── */
.vwr-tooltip {
	position: fixed;
	z-index: 999999;
	background: #1a202c;
	color: #ffffff;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 13px;
	max-width: 240px;
	pointer-events: none;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
	line-height: 1.4;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.vwr-tt-dir {
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 6px;
}

.vwr-tt-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.vwr-tt-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	flex: 0 0 14px;
}

.vwr-tt-num {
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}

.vwr-tt-lbl {
	font-size: 13px;
	font-weight: 600;
	opacity: 0.9;
}

.vwr-tt-desc {
	font-size: 12px;
	opacity: 0.75;
	line-height: 1.45;
}


/* ── Forecast band pulse animation ─────────────────────────────────────── */
@keyframes vwr-fc-pulse {
	0%, 100% { opacity: 1.0; }
	50%       { opacity: 0.25; }
}

.vwr-fc-band {
	animation: vwr-fc-pulse 2s ease-in-out infinite;
}

.vwr-fc-band:hover {
	animation-play-state: paused;
	opacity: 0.85;
	cursor: pointer;
}

/* ── Forecast gust legend outer wrapper (left / right positions) ─────────── */
.vwr-fc-outer {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: center;
	gap: 12px;
	width: 100%;
}

.vwr-fc-outer .vwr-layout {
	gap: 12px;
	flex-wrap: nowrap;
}

.vwr-fc-outer .vwr-legend {
	min-width: 100px;
}

/* ── Three-column layout: legend | rose | legend ─────────────────────────── */
/* CSS grid with display:contents on the inner layout lets all three items    */
/* (protection legend, rose, forecast legend) participate directly in the     */
/* grid — legends share remaining space equally, rose keeps its natural size. */
.vwr-fc-outer--three-col {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	gap: 12px;
	width: 100%;
}

.vwr-fc-outer--three-col > .vwr-layout {
	display: contents;
}

@media (max-width: 480px) {
	.vwr-fc-outer {
		flex-wrap: wrap;
		gap: 16px;
	}
	.vwr-fc-outer .vwr-layout {
		flex-wrap: wrap;
		gap: 16px;
	}
	.vwr-fc-outer .vwr-legend {
		min-width: unset;
		width: 100%;
		max-width: 380px;
	}

	.vwr-fc-outer--three-col {
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.vwr-fc-outer--three-col > .vwr-layout {
		display: flex;
		width: 100%;
		flex-direction: column;
		align-items: center;
	}
}

/* ── Forecast legend rows ────────────────────────────────────────────────── */
.vwr-legend-divider {
	border: none;
	border-top: 1px solid #e2e8f0;
	margin: 10px 0 8px;
}

.vwr-legend-row--fc {
	grid-template-columns: 16px 1fr;
}

/* ── Forecast alerts ────────────────────────────────────────────────────── */
.vwr-alerts {
	margin-top: 16px;
}

.vwr-alert {
	background: #fff8e1;
	border: 1px solid #f0c040;
	border-left: 4px solid #e09b00;
	border-radius: 4px;
	margin-bottom: 8px;
	overflow: hidden;
}

.vwr-alert-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	padding: 10px 14px;
}

.vwr-alert-event {
	font-size: 13px;
	font-weight: 600;
	color: #7a4f00;
	flex: 1 1 auto;
}

.vwr-alert-toggle {
	background: none;
	border: 1px solid #c08800;
	border-radius: 3px;
	color: #7a4f00;
	cursor: pointer;
	font-size: 12px;
	padding: 2px 10px;
	flex: 0 0 auto;
	transition: background 0.15s;
}

.vwr-alert-toggle:hover {
	background: rgba(224, 155, 0, 0.1);
}

.vwr-alert-body {
	display: none;
	padding: 0 14px 12px;
	color: #6a4000;
	font-size: 13px;
	line-height: 1.55;
}

.vwr-alert-body.is-open {
	display: block;
}

.vwr-alert-body p {
	margin: 0 0 6px;
}

.vwr-alert-body p:last-of-type {
	margin-bottom: 0;
}

.vwr-alert-body small {
	display: block;
	margin-top: 8px;
	font-size: 11px;
	color: #a06800;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* On narrow screens, all layout variants collapse to a single column */
@media (max-width: 480px) {
	.vwr-layout,
	.vwr-layout--left,
	.vwr-layout--right,
	.vwr-fc-outer {
		flex-direction: column;
		align-items: center;
	}

	/* Restore natural document order on small screens */
	.vwr-layout--left .vwr-legend {
		order: 0;
	}

	.vwr-legend {
		width: 100%;
		max-width: 380px;
		flex: none;
	}

	.vwr-legend-row {
		grid-template-columns: 16px 22px 72px 1fr;
	}
}
