/* Ensure predictable sizing */
*, *::before, *::after { box-sizing: border-box; }

/* Global layout + background */
body {
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	margin: 0;
	min-height: 100vh;
	color: #0f2a36; /* dark ink for readability */
	/* Light, accessible background */
	background:
		radial-gradient(1200px 800px at 5% -10%, rgba(255,255,255,0.9), rgba(255,255,255,0) 40%),
		radial-gradient(900px 600px at 100% 0%, rgba(255,255,255,0.7), rgba(255,255,255,0) 45%),
		linear-gradient(180deg, #eaf6ff 0%, #eaf3f8 45%, #e9f0f4 100%);
	background-attachment: fixed; /* gentle parallax feel */
}
/* Centered container */
#app {
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem;
}
/* Text elements */
.error { color: #b00020; margin-top: 0.5rem; }
ul { padding-left: 1.25rem; }
li { margin: 0.25rem 0; }

/* Header + controls */
h1 { color: #0f2a36; }
/* Input and button styling */
input {
	padding: 0.6rem 0.75rem;
	border-radius: 10px;
	border: 1px solid rgba(15,42,54,0.25);
	background: rgba(255,255,255,0.98);
	box-shadow: 0 1px 2px rgba(0,0,0,0.06);
	outline: none;
}

button {
	padding: 0.6rem 0.9rem;
	border-radius: 10px;
	border: 1px solid rgba(15,42,54,0.3);
	background: linear-gradient(180deg, #e8f2f7, #dbe8ee);
	color: #0f2a36;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
/* Button interaction states */
button:hover { filter: brightness(0.98); }
button:active { transform: translateY(1px); }

button:focus-visible, input:focus-visible {
	outline: 3px solid #0ea5e9; /* high-contrast focus ring */
	outline-offset: 2px;
}

/* Cards layout */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1rem;
	align-items: start; /* don't stretch rows */
}

.card {
	width: 100%;
	min-width: 0; /* allow shrinking within grid column to prevent overflow */
	border: 1px solid rgba(15,42,54,0.12);
	border-radius: 14px;
	padding: 1rem;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	background: rgba(255,255,255,0.9);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	color: #0f2a36; /* ensure dark text inside card */
}

.card-header, .card-body {
	overflow-wrap: anywhere; /* allow long content to wrap instead of overflowing */
	word-break: break-word;
}

.metric .label { color: #444; }
.metric .value { font-weight: 600; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }

/* Warning row: stack value below label so long text wraps without shifting columns */
.metric--warning {
	flex-direction: column;
	gap: 0.25rem;
}
.metric--warning .label {
	font-weight: 600;
}
.metric--warning .value {
	font-weight: 500;
	color: #222;
}

/* Ensure exactly 3 columns on wider screens (optional nicety) */
	.metric--warning .label::before {
		content: "⚠️ "; /* non-color cue for color blindness */
	}
@media (min-width: 1000px) {
	.cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Respect high-contrast user preference (Helps users with visual impairments) */
@media (prefers-contrast: more) {
    .card { background: #fff; border-color: #9aa7b0; box-shadow: none; }
    input, button { border-color: #0f2a36; }
    button:focus-visible, input:focus-visible { outline-width: 4px; }
}

.card-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.5rem;
}

.card-header .day {
	font-weight: 600;
	font-size: 1.1rem;
}

.card-header .date {
	color: #666;
	font-size: 0.95rem;
}

.card-body .metric {
	display: flex;
	justify-content: space-between;
	padding: 0.35rem 0;
	border-top: 1px dashed #eee;
}

.card-body .metric:first-child {
	border-top: none;
}

.metric .label { color: #444; }
.metric .value { font-weight: 600; }
