:root {
	font-family: monospace;
	font-size: clamp(1.05rem, 2vw, 1.3rem);
}

body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	justify-items: center;
	gap: 0.65rem;
	width: min(95%, 56rem);
	margin: 1.5rem auto;
}

#clock {
	font-size: clamp(1.1rem, 6.8vw, 4.4rem);
	white-space: nowrap;
	cursor: pointer;
}

#year-input {
	width: 7ch;
	font: inherit;
}

input[type="range"] {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
}

datalist {
	display: flex;
	justify-content: space-between;
	width: calc(100% - 1rem);
	font-size: clamp(0.39rem, 2vw, 0.8rem);
	text-align: center;
}

/* A zero-width flex item centers each label on its numerical tick. */
datalist option {
	display: flex;
	flex: 0 0 0;
	min-width: 0;
	justify-content: center;
	padding: 0;
	white-space: nowrap;
}

#month-ticks .current,
#location-button[aria-pressed="true"] {
	font-weight: bold;
}

/* Only labeled offset options participate in label spacing. */
#offset-ticks option:not([label]) {
	display: none;
}

/* Labels span 6000 mrad of the full 2000π mrad slider travel. */
#offset-ticks {
	width: calc((100% - 1rem) * 0.9549296586);
}

#offset-control {
	margin: 0;
}

#month-calendar {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: clamp(0.88rem, 2vw, 1.2rem);
	text-align: center;
	margin-top: 0.6rem;
}

#month-calendar th,
#month-calendar td {
	padding: 0.3rem 0.05rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	height: 3em;
	vertical-align: top;
}

#month-calendar th:first-child {
	width: 4.5ch;
}

#month-calendar .phase {
	display: block;
	font-size: 1.25em;
}

#month-calendar td.today {
	background: color-mix(in srgb, currentColor 10%, transparent);
}
