/*
 * Kulcho date picker (K-0c848b68) — the look of the one date / time picker:
 * the creator dashboard's "Schedule message" window. Used by the plain-JS
 * picker (date-picker.js) and, class for class, by the brand apps' React
 * picker (white-label/client/src/components/date-picker/).
 *
 * ONE SOURCE: shared/date-picker/date-picker.css. Every app keeps a copy;
 * never edit a copy — change this file and run `node shared/date-picker/sync.mjs`.
 *
 * Colours come from the app around it: each app sets these on its own
 * stylesheet (both dashboard looks, both site looks and a brand's colour
 * follow by themselves):
 *   --kdp-surface  window background      --kdp-text     text
 *   --kdp-muted    quieter text           --kdp-border   lines
 *   --kdp-fill     grey buttons           --kdp-brand    brand colour (today, chosen day, Save)
 *   --kdp-brand-fg text on the brand      --kdp-brand-tint  today's soft fill
 *   --kdp-danger   the error line         --kdp-font     type
 *   --kdp-brand-text  the brand colour as words on the window (today's number)
 *   --kdp-brand-line  the brand colour as a line (today's outline, focus)
 *   (both default to --kdp-brand; a site whose creator picks a pale colour sets
 *   readable ones, K-2664463a)
 */

.kdp-backdrop {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.4);
}

.kdp-backdrop[hidden] {
	display: none !important;
}

.kdp-window {
	--_surface: var(--kdp-surface, #ffffff);
	--_text: var(--kdp-text, #141414);
	--_muted: var(--kdp-muted, #6b6b6b);
	--_border: var(--kdp-border, #e4e4e4);
	--_fill: var(--kdp-fill, #f2f2f2);
	--_brand: var(--kdp-brand, #d0346a);
	--_brand-fg: var(--kdp-brand-fg, #ffffff);
	--_brand-tint: var(--kdp-brand-tint, color-mix(in srgb, var(--_brand) 12%, var(--_surface)));
	--_danger: var(--kdp-danger, #d92d20);
	--_brand-text: var(--kdp-brand-text, var(--_brand));
	--_brand-line: var(--kdp-brand-line, var(--_brand));
	box-sizing: border-box;
	width: 100%;
	max-width: 28rem;
	margin: 40px auto auto;
	border: 1px solid var(--_border);
	border-radius: 16px;
	background: var(--_surface);
	color: var(--_text);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
	font-family: var(--kdp-font, inherit);
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
}

.kdp-window *,
.kdp-window *::before,
.kdp-window *::after {
	box-sizing: border-box;
}

/* The window inside a host's own modal (the brand apps' schedule window). */
.kdp-window.kdp-window--inline {
	max-width: none;
	margin: 0;
	border: 0;
	box-shadow: none;
}

.kdp-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--_border);
}

.kdp-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--_text);
}

.kdp-close {
	padding: 4px 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--_muted);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.kdp-close:hover {
	background: var(--_fill);
}

.kdp-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 20px 20px;
}

.kdp-calendar {
	padding: 12px;
	border: 1px solid var(--_border);
	border-radius: 12px;
}

.kdp-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.kdp-month-label {
	font-size: 15px;
	font-weight: 700;
	color: var(--_text);
}

.kdp-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.kdp-jump {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.kdp-nav {
	display: flex;
	flex: none;
	gap: 8px;
}

.kdp-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--_border);
	border-radius: 8px;
	background: transparent;
	color: var(--_text);
	font: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.kdp-nav-btn:hover:not(:disabled) {
	background: var(--_fill);
}

.kdp-nav-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.kdp-weekdays,
.kdp-days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	text-align: center;
}

.kdp-weekdays {
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--_muted);
}

.kdp-months {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

.kdp-day,
.kdp-month {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	justify-self: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: var(--_text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.kdp-month {
	width: 100%;
	height: 40px;
}

.kdp-day:hover:not(:disabled),
.kdp-month:hover:not(:disabled) {
	background: var(--_fill);
}

.kdp-day.is-today,
.kdp-month.is-today {
	border-color: var(--_brand-line);
	background: var(--_brand-tint);
	color: var(--_brand-text);
}

.kdp-day.is-selected,
.kdp-month.is-selected,
.kdp-day.is-selected:hover,
.kdp-month.is-selected:hover {
	border-color: var(--_brand);
	background: var(--_brand);
	color: var(--_brand-fg);
}

/* Only where the past is not allowed (scheduling): crossed out. */
.kdp-day.is-past,
.kdp-month.is-past {
	color: var(--_muted);
	text-decoration: line-through;
	cursor: not-allowed;
}

/* Outside the dates allowed (a birthday in the future, a report day to come): dimmed, never crossed out. */
.kdp-day.is-out,
.kdp-month.is-out {
	color: var(--_muted);
	opacity: 0.4;
	cursor: not-allowed;
}

.kdp-window button:focus-visible,
.kdp-window select:focus-visible {
	outline: 2px solid var(--_brand-line);
	outline-offset: 2px;
}

.kdp-time {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--_border);
}

.kdp-time-label {
	font-weight: 600;
	color: var(--_text);
}

.kdp-time-box {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 8px;
	border: 1px solid var(--_border);
	border-radius: 10px;
}

.kdp-select {
	padding: 2px 4px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--_text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.kdp-select option {
	color: #141414;
	background: #ffffff;
}

.kdp-jump-select {
	padding: 4px 6px;
	border: 1px solid var(--_border);
	font-size: 14px;
}

.kdp-period {
	margin-left: 4px;
	background: var(--_fill);
}

.kdp-colon {
	font-weight: 600;
}

.kdp-note {
	margin: 0;
	font-size: 12px;
	color: var(--_muted);
}

.kdp-error {
	margin: 0;
	font-size: 12px;
	color: var(--_danger);
}

.kdp-error[hidden] {
	display: none;
}

.kdp-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.kdp-foot-end {
	display: flex;
	gap: 8px;
}

.kdp-btn {
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}

.kdp-btn-clear {
	padding-left: 8px;
	padding-right: 8px;
	background: transparent;
	color: var(--_muted);
}

.kdp-btn-clear:hover {
	background: var(--_fill);
}

.kdp-btn-cancel {
	border-color: var(--_border);
	background: var(--_fill);
	color: var(--_text);
}

.kdp-btn-cancel:hover {
	background: var(--_surface);
}

.kdp-btn-save {
	border-color: var(--_brand);
	background: var(--_brand);
	color: var(--_brand-fg);
}

.kdp-btn-save:hover {
	filter: brightness(0.92);
}

/* The field that stands in for a date input: it keeps the app's own input look
   (its classes are the input's) and adds the text and the calendar mark. */
.kdp-field {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.kdp-field-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kdp-field-placeholder {
	opacity: 0.6;
}

.kdp-field-icon {
	flex: none;
	width: 16px;
	height: 16px;
	opacity: 0.7;
}

@media (max-width: 480px) {
	.kdp-backdrop {
		padding: 12px;
	}

	.kdp-window {
		margin-top: 16px;
	}

	.kdp-head {
		padding: 12px 16px;
	}

	.kdp-body {
		padding: 12px 14px 16px;
	}

	.kdp-calendar {
		padding: 10px 8px;
	}

	.kdp-day {
		width: 34px;
		height: 34px;
	}
}
