/**
 * Date and time picker. The sheet uses the plain sans face.
 * The closed field keeps the serif of the surrounding form.
 */

.hol-pick {
	display: flex;
	align-items: center;
	gap: 0.2rem;
	min-width: 0;
	min-height: 2.75rem;
}

.hol-pick-face {
    flex: 1;
    min-width: 0;
    min-height: 2.2rem;
    padding: 0.2rem 15px;
    text-align: left;
    font-size: 1.32rem;
    letter-spacing: 0;
    line-height: 1.2;
    color: var(--text);
    font-family: var(--font-serif);
}

.hol-pick-icon {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	flex: 0 0 2.75rem;
	margin-right: -0.35rem;
	color: var(--text-muted);
	transition: color 0.4s var(--ease);
}

.hol-pick-icon svg {
	width: 18px;
	height: 18px;
}

.field select,
.h-field select,
.contact-field select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	min-height: 2.75rem;
	padding-right: 2.75rem;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4.5 7 L9 11.5 L13.5 7' stroke='%236d6458' stroke-width='1'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.46rem center;
	background-size: 18px 18px;
}

.field select::-ms-expand,
.h-field select::-ms-expand,
.contact-field select::-ms-expand {
	display: none;
}

.hol-pick.is-open .hol-pick-icon,
.hol-pick-icon:hover {
	color: var(--accent);
}

.hol-pop {
	position: fixed;
	inset: 0;
	z-index: 120;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0.62s;
}

.hol-pop.is-open {
	visibility: visible;
	pointer-events: auto;
	transition: visibility 0s;
}

.hol-pop-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 17, 14, 0.46);
	opacity: 0;
	transition: opacity 0.5s var(--ease);
}

.hol-pop.is-open .hol-pop-backdrop {
	opacity: 1;
}

.hol-pop-panel {
	position: fixed;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(22.5rem, calc(100vw - 1.5rem));
	max-height: min(32rem, calc(100dvh - 1.5rem));
	background: var(--background);
	color: var(--text);
	border: 1px solid var(--border-strong);
	box-shadow: 0 24px 70px rgba(20, 17, 14, 0.14);
	padding: 0.85rem 0.9rem 1rem;
	font-family: var(--font-sans);
	opacity: 0;
	transform: translateY(14px);
	transition: transform 0.55s var(--ease), opacity 0.45s var(--ease);
}

.hol-pop,
.hol-pop button,
.hol-pop p,
.hol-pop span {
	font-family: var(--font-sans);
}

.hol-pop.is-open .hol-pop-panel {
	opacity: 1;
	transform: none;
}

.hol-pop-handle {
	display: none;
}

.hol-pop-head {
	display: grid;
	grid-template-columns: 2.75rem 1fr 2.75rem;
	align-items: center;
	flex: 0 0 auto;
}

.hol-pop-title {
	margin: 0;
	text-align: center;
	font-size: 0.72rem;
	font-weight: 400;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.hol-pop-nav {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	color: var(--text);
}

.hol-pop-nav svg {
	width: 10px;
	height: 10px;
}

.hol-pop-nav:disabled {
	opacity: 0.28;
}

.hol-pop-panel.is-time .hol-pop-nav {
	visibility: hidden;
}

.hol-pop-body {
	overflow: auto;
	min-height: 0;
	margin-top: 0.35rem;
	-webkit-overflow-scrolling: touch;
	transition: opacity 0.4s var(--ease), transform 0.45s var(--ease);
}

.hol-pop.is-swap .hol-pop-body {
	opacity: 0;
	transform: translateY(8px);
}

.hol-week,
.hol-days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hol-week span {
	display: grid;
	place-items: center;
	min-height: 1.8rem;
	font-size: 0.62rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.hol-day,
.hol-time {
	touch-action: manipulation;
	transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.hol-day {
	display: grid;
	place-items: center;
	min-height: 2.65rem;
	font-size: 0.95rem;
	color: var(--text);
}

.hol-day.is-today:not(.is-on) {
	color: var(--accent);
}

.hol-day.is-between {
	background: var(--background-soft);
}

.hol-day.is-mark:not(.is-on) {
	box-shadow: inset 0 0 0 1px var(--border-strong);
}

.hol-day:hover:not(:disabled):not(.is-on),
.hol-time:hover:not(.is-on) {
	background: var(--background-soft);
}

.hol-day.is-on,
.hol-time.is-on {
	background: var(--background-dark);
	color: var(--text-on-dark);
}

.hol-day:disabled {
	color: rgba(28, 23, 18, 0.28);
	background: transparent;
}

.hol-times {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.45rem;
}

.hol-time-label {
	grid-column: 1 / -1;
	margin: 0.9rem 0 0.05rem;
	font-size: 0.62rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.hol-time-label:first-child {
	margin-top: 0.15rem;
}

.hol-time {
	min-height: 2.85rem;
	border: 1px solid var(--border);
	font-size: 0.95rem;
	letter-spacing: 0.04em;
}

.hol-time.is-on {
	border-color: transparent;
}

.hol-pop-done {
	display: none;
}

@media (max-width: 720px) {
	
	.hol-pick-face {
		font-size: clamp(1.5rem, 2.2vw, 2.05rem);
	}
	.hol-pop-backdrop {
		background: rgba(20, 17, 14, 0.62);
	}

	.hol-pop.is-sheet .hol-pop-panel {
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		width: 100%;
		max-height: min(92dvh, 44rem);
		border: 0;
		border-top: 1px solid var(--border);
		box-shadow: none;
		opacity: 1;
		padding:
			0.15rem
			max(1.15rem, env(safe-area-inset-right))
			calc(0.85rem + env(safe-area-inset-bottom))
			max(1.15rem, env(safe-area-inset-left));
		transform: translateY(100%);
		transition: transform 0.62s var(--ease);
	}

	.hol-pop.is-sheet.is-open .hol-pop-panel {
		transform: none;
	}

	.hol-pop.is-sheet .hol-pop-handle {
		display: block;
		width: 2.6rem;
		height: 1px;
		margin: 0.7rem auto 0.2rem;
		background: var(--border-strong);
	}

	.hol-day {
		min-height: 3.05rem;
		font-size: 1rem;
	}

	.hol-time {
		min-height: 3.15rem;
		font-size: 1rem;
	}

	.hol-pop.is-sheet .hol-pop-done {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-height: 3.15rem;
		margin-top: 0.85rem;
		border: 1px solid var(--border-strong);
		letter-spacing: 0.22em;
		text-transform: uppercase;
		font-size: 0.68rem;
		flex: 0 0 auto;
	}
}

@media (min-width: 721px) {
	.hol-pop-backdrop {
		background: transparent;
	}
}

html.hol-pick-lock,
html.hol-pick-lock body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.hol-pop,
	.hol-pop-panel,
	.hol-day,
	.hol-time,
	.hol-pick-icon {
		transition: none;
	}
}
