td.calendar-day	{
  height: 30px;
  height: 30px\9;
  _height: 30px;
  width: 30px;
  font-size: 1.125rem;
  position: relative;
} * html div.calendar-day { height:30px; font-size:1.6rem;}

td.calendar-day-np	{
  background:#aaa;
  height: 30px;
  height: 30px\9;
  _height: 30px;
  width: 30px;
} * html div.calendar-day-np { height: 30px; }

td.calendar-day-head {
  background:#ddd;
  text-align:center;
  font-size: 1rem;
  width: 30px;
  padding:1px;
  border-bottom:1px solid #999;
  border-top:1px solid #999;
  border-right:1px solid #999;
}
div.day-number	{
  top: 0px;
  background: none;
  color:#eee;
  float:right;
  margin:0px 0px 0px 0px;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align:center;
  position: relative;
}
/* shared */
td.calendar-day, td.calendar-day-np {
  width: 30px;
  height: 30px;
  height: 30px\9;
  _height: 30px;
  padding: 1px;
  border-bottom:1px solid #999;
  border-right:1px solid #999;
} * html div.calendar-day, div.calendar-day-np { height: 30px; }

td.calendar-day a, td.calendar-day-np a {
  text-decoration: none;
  color: #000;
}
td.calendar-day a:visited, td.calendar-day-np a:visited {
  color: #666;
}
td.calendar-day a:hover, td.calendar-day-np a:hover {
  color: #fff;
}
.cal-grid {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
}
.cal-container {
  font-family: Ubuntu, Arial, Helvetica, sans-serif;
  margin: 5px 10px 10px 10px;
}
table.calendar-month {
  border-left: 1px solid #999;
  box-shadow: 0 0 10px 0px rgba(255, 255, 255, 0.3);
}
.calendar-label {
  text-align: center;
  font-size: 1.3125rem;
  margin-bottom: 5px;
  color: #eee;
}
.link { cursor: pointer; }

#calcontent {
	max-width: 1030px;
	margin-left: auto;
	margin-right: auto;
}
#cal-year-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 16px;
}
#cal-year-label {
	font-family: 'Montserrat', sans-serif;
	font-size: 1.6rem;
	font-weight: 700;
	color: #eee;
	min-width: 4ch;
	text-align: center;
}
.cal-year-arrow {
	font-size: 2.2rem;
	line-height: 1;
	color: #7ff4fe;
	font-family: system-ui, -apple-system, sans-serif;
	font-weight: 700;
	text-decoration: none;
	padding: 0 6px;
	border-radius: 4px;
	transition: color .2s ease-in-out;
}
.cal-year-arrow:hover {
	color: #F37C01;
}
.cal-year-arrow-disabled {
	color: #555;
	cursor: default;
}

/* ── Controls: toggle + legend ── */
#cal-controls {
	max-width: 900px;
	margin: 0 auto 20px;
	padding: 14px 16px;
	border: 2px solid #888;
	background-color: #083a44;
	border-radius: 8px;
}

/* Toggle + datasets row */
#cal-type-control {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 28px;
	margin-bottom: 5px;
}
#cal-pam-cam-group {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* More Datasets button */
#cal-datasets-wrap {
	position: relative;
}
#cal-datasets-btn {
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	background: #7ff4fe;
	border: 2px solid #7ff4fe;
	color: #062E36;
	border-radius: 20px;
	padding: 0 14px;
	height: 28px;
	box-sizing: border-box;
	cursor: pointer;
	transition: background-color .2s, border-color .2s;
	white-space: nowrap;
}
#cal-datasets-btn:hover,
#cal-datasets-btn[aria-expanded="true"] {
	background-color: #F37C01;
	border-color: #F37C01;
	color: #062E36;
}
.cal-ds-arrow {
	font-size: 0.75em;
	margin-left: 4px;
}
#cal-datasets-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: #0a3a45;
	border: 1px solid #7ff4fe;
	border-radius: 8px;
	padding: 12px 16px;
	min-width: 190px;
	z-index: 200;
	box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.cal-ds-option {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #ddd;
	font-size: 0.95rem;
	cursor: pointer;
	white-space: nowrap;
}
.cal-ds-option input {
	width: 16px;
	height: 16px;
	accent-color: #F37C01;
	cursor: pointer;
}
#cal-ds-actions {
	display: flex;
	justify-content: space-between;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid #2a5a6a;
}
#cal-ds-add-all,
#cal-ds-clear-all {
	background: none;
	border: none;
	color: #7ff4fe;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	transition: color .2s;
}
#cal-ds-add-all:hover,
#cal-ds-clear-all:hover {
	color: #F37C01;
}

/* Toggle switch */
.cal-toggle-label {
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: #888;
	transition: color .2s;
	user-select: none;
}
.cal-toggle-label-active {
	color: #fff;
}
.cal-toggle-switch {
	position: relative;
	display: inline-block;
	width: 52px;
	height: 28px;
	cursor: pointer;
}
.cal-toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}
.cal-toggle-slider {
	position: absolute;
	inset: 0;
	background: #7ff4fe;
	border-radius: 28px;
	transition: background .25s;
}
.cal-toggle-slider::before {
	content: '';
	position: absolute;
	width: 22px;
	height: 22px;
	left: 3px;
	top: 3px;
	background: #051e24;
	border-radius: 50%;
	transition: transform .25s;
}
.cal-toggle-switch input:checked + .cal-toggle-slider::before {
	transform: translateX(24px);
}
.cal-toggle-switch:focus-within .cal-toggle-slider {
	outline: 2px solid #F37C01;
	outline-offset: 2px;
}

/* Legend */
#cal-legend {
	text-align: center;
}
#cal-legend-title {
	color: #ddd;
	font-size: 1rem;
	margin: 0 0;
}
#cal-legend-title a {
	color: #7ff4fe;
}
#cal-legend-about {
	text-transform: uppercase;
	font-weight: 800;
}
.cal-legend-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 16px;
	margin: 20px 0 0 0;
}
.cal-legend-row:last-child {
	margin-bottom: 0;
}
.cal-legend-group-label {
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: #eee;
	white-space: nowrap;
	text-transform: none;
}
.cal-legend-items {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
}
.cal-legend-item {
	display: flex;
	align-items: center;
	color: #ddd;
	font-size: 0.95rem;
	white-space: nowrap;
}

/* Legend swatches — reuse colour logic, sized for inline display */
.cal-swatch {
	display: inline-block;
	width: 26px;
	height: 26px;
	border-radius: 3px;
	margin-right: 8px;
	flex-shrink: 0;
	position: relative;
	overflow: hidden;
}
.cal-swatch.cal-green  { background-color: #63ff63; }
.cal-swatch.cal-nodata   { background-color: #510f03; }
.cal-swatch.cal-outside  { background-color: #062E36; border: 1px solid #3a6070; }
.cal-swatch.cal-blue   {
	background: repeating-linear-gradient(
		45deg,
		#00bfe5, #00bfe5 4px,
		#00b0cc 4px, #00b0cc 6px
	);
}
.cal-swatch.cal-yellow { background: #e2e200; }
.cal-swatch.cal-yellow::before {
	content: '';
	position: absolute;
	top: 0; left: 0;
	width: 0; height: 0;
	border-style: solid;
	border-width: 10px 10px 0 0;
	border-color: #f37c01 transparent transparent transparent;
}

/* Full-cell clickable link on days with PUNCH data */
.cal-day-link {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: 1;
}

#acknow {
	margin-top: 30px;
}
.collapsible h2 {
	margin-left: 5px;
}
.collapsible::after {
	margin-left: 5px;
}
.more-content h3 {
	margin-left: 0px;
}
.more-content p {
	color: #fff;
}


/* ── Data availability color coding (mirrors datepicker) ── */

/* Green — v0k FITS count ≥ 42 */
td.calendar-day.cal-green {
	background-color: #63ff63;
	color: #fff;
	font-weight: bold;
}
td.calendar-day.cal-green:hover { background-color: #59e559; }

/* Blue — v0k FITS present but fewer than 42; diagonal hatching */
td.calendar-day.cal-blue {
	background: repeating-linear-gradient(
		45deg,
		#00bfe5, #00bfe5 4px,
		#00a3bc 4px, #00a3bc 6px
	);
	color: #fff;
	font-weight: bold;
}
td.calendar-day.cal-blue:hover {
	background: repeating-linear-gradient(
		45deg,
		#00b1d1, #00b1d1 4px,
		#0094a8 4px, #0094a8 6px
	);
}

/* Yellow — FITS present but no v0k; orange triangle in top-left corner */
td.calendar-day.cal-yellow {
	background: #dbdb00;
	color: #000;
	font-weight: bold;
	position: relative;
	overflow: hidden;
}
td.calendar-day.cal-yellow:hover { background: #c9c900; }
td.calendar-day.cal-yellow::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 10px 10px 0 0;
	border-color: #f37c01 transparent transparent transparent;
}

/* Past dates within the data era but with no data */
td.calendar-day.cal-nodata {
	background-color: #510f03;
}

/* Black day numbers on all colored cells for legibility */
td.calendar-day.cal-green .day-number,
td.calendar-day.cal-blue .day-number,
td.calendar-day.cal-yellow .day-number {
	color: #000;
}

/* Halo CME event — orange ring around the day number */
td.calendar-day.has-cme .day-number {
	box-shadow: 0 0 0 2px #F37C01;
	border-radius: 50%;
}

/* CME legend swatch — orange circle outline */
.cal-swatch-cme {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid #F37C01;
	background: transparent;
	margin-right: 10px;
	flex-shrink: 0;
}

/* MLSO K-Cor — teal square outline around the day number, nests inside CME circle */
td.calendar-day.has-kcor .day-number::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 22px;
	height: 22px;
	border: 2px solid #4fc3f7;
	pointer-events: none;
}

/* PUNCH label aligns with first row of icons, not centered across both */
#cal-legend .cal-legend-row:first-of-type {
	align-items: flex-start;
}
#cal-legend .cal-legend-row .cal-legend-group-label {
	padding-top: 3px;
}

/* ── PUNCH legend 3+2 / 1×5 layout ─────────────────────── */
#cal-punch-legend-items {
	max-width: 750px;
	margin: 0;
	justify-content: center;
	gap: 8px 16px;
}
#cal-punch-legend-items .cal-legend-item {
	flex: 0 0 auto;
}
@media screen and (min-width: 826px) {
	#cal-punch-legend-items {
		max-width: 560px;
		justify-content: flex-start;
	}
	#cal-punch-legend-items .cal-legend-item:nth-child(4) {
		margin-left: auto;
	}
	#cal-punch-legend-items .cal-legend-item:nth-child(5) {
		margin-right: auto;
	}
	.cal-legend-row {
		align-items: flex-start;
	}
	.cal-legend-row:has(#cal-punch-legend-items) {
		width: fit-content;
		margin-left: auto;
		margin-right: auto;
	}
}
@media screen and (max-width: 825px) {
	.cal-legend-row {
		flex-direction: column;
		align-items: center;
	}
	#cal-legend .cal-legend-row:first-of-type {
		align-items: center;
	}
}
@media screen and (max-width: 480px) {
	#cal-punch-legend-items .cal-legend-item {
		flex: 0 0 100%;
	}
}

/* Overlay-only dates — darken indicator shapes on hover */
td.calendar-day:not(.cal-green):not(.cal-blue):not(.cal-yellow).has-cme:hover .day-number {
	box-shadow: 0 0 0 2px #b85c00;
}
td.calendar-day:not(.cal-green):not(.cal-blue):not(.cal-yellow).has-kcor:hover .day-number::after {
	border-color: #1e8ab5;
}

/* K-Cor legend swatch — teal square outline */
.cal-swatch-kcor {
	width: 16px;
	height: 16px;
	border: 2px solid #4fc3f7;
	background: transparent;
	margin-right: 10px;
	margin-left: 4px;
	flex-shrink: 0;
}

/* Metis (Solar Orbiter) — purple outlined square inside the MLSO K-Cor square */
td.calendar-day.has-metis .day-number::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 18px;
	height: 18px;
	border: 2px solid #c084fc;
	pointer-events: none;
}

td.calendar-day.has-metis .day-number {
	font-size: 1rem;
}

.cal-swatch-metis {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #c084fc;
	background: transparent;
	margin-right: 10px;
	margin-left: 6px;
	flex-shrink: 0;
}

td.calendar-day:not(.cal-green):not(.cal-blue):not(.cal-yellow).has-metis:hover .day-number::before {
	border-color: #9333ea;
}

@media screen and (max-width: 585px) {
	.cal-container {
		zoom: calc(80vw / 252px);
	}
	.calendar-label {
		font-size: 1.0rem;
	}
}

@media screen and (max-width: 500px) {
	.cal-legend-row,
	.cal-legend-items {
		justify-content: flex-start;
		padding-left: 8px;
	}
}