html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	background-color: rgba(175, 164, 228, 0.59);
	font-family: var(--v2-font-family, "Avenir Next", "Montserrat", sans-serif);
	color: var(--v2-text);
	overflow: auto;
}

.v2-calendar {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 10px;
	height: 100%;
	min-height: 100%;
	padding: 10px;
	position: relative;
}

.v2-calendar-toolbar {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.v2-toolbar-group {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	flex-wrap: nowrap;
}

.v2-toolbar-group--center {
	justify-self: center;
}

.v2-toolbar-group--end {
	justify-self: end;
}

.v2-button,
.v2-select,
.v2-key-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	height: 28px;
	padding: 0 10px;
	border: 1px solid rgba(54, 72, 96, 0.18);
	border-radius: 999px;
	background: #fff;
	color: #27466d;
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.v2-button--icon {
	width: 28px;
	padding: 0;
}

.v2-button--today-current {
	background: #8bae83f6;
	border-color: rgba(39, 70, 109, 0.28);
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(39, 70, 109, 0.08);
}

.v2-select {
	appearance: none;
	min-width: 0;
	padding-right: 24px;
	background-image:
		linear-gradient(45deg, transparent 50%, #27466d 50%),
		linear-gradient(135deg, #27466d 50%, transparent 50%);
	background-position:
		calc(100% - 12px) calc(50% - 2px),
		calc(100% - 8px) calc(50% - 2px);
	background-size: 4px 4px, 4px 4px;
	background-repeat: no-repeat;
}

#v2-month {
	min-width: 104px;
}

#v2-year {
	min-width: 74px;
}

.v2-key {
	position: relative;
}

.v2-key-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 170px;
	padding: 8px;
	border: 1px solid var(--v2-border);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
	display: grid;
	gap: 6px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
	z-index: 40;
}

.v2-key:hover .v2-key-panel,
.v2-key:focus-within .v2-key-panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.v2-key-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.72rem;
}

.v2-key-swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 18px;
	padding: 0 5px;
	border-radius: 7px;
	border: 1px solid rgba(54, 72, 96, 0.12);
	color: #fff;
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 1;
}

.v2-month-frame {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 16px;
	min-height: 0;
	border: 1px solid var(--v2-border);
	border-radius: 18px;
	background: rgba(248, 251, 255, 0.96);
	overflow: auto;
	padding: 12px;
}

.v2-calendar-month {
	display: grid;
	flex: 0 0 auto;
	gap: 0;
	border: 1px solid rgba(54, 72, 96, 0.08);
	border-radius: 14px;
	background: rgba(251, 253, 255, 0.92);
	overflow: hidden;
}

.v2-calendar-month-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	position: sticky;
	top: -12px;
	z-index: 3;
	padding: 10px 12px 8px;
	background: linear-gradient(180deg, rgba(240, 245, 251, 0.98) 0%, rgba(240, 245, 251, 0.94) 70%, rgba(240, 245, 251, 0.86) 100%);
	border-bottom: 1px solid rgba(54, 72, 96, 0.08);
}

.v2-calendar-month-head h2 {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #27466d;
}

.v2-calendar--week-tools .v2-weekdays,
.v2-calendar--week-tools .v2-month-grid { grid-template-columns: 26px repeat(7, minmax(0, 1fr)); }
.v2-week-rail { display: flex; align-items: center; justify-content: center; border-right: 1px solid #e1e8ed; border-bottom: 1px solid #e1e8ed; background: #f3f7fb; }
.v2-week-fill { width: 24px; height: 28px; padding: 0; border: 1px solid #c8d4df; border-radius: 7px; color: #27466d; background: white; font-size: 16px; cursor: pointer; }
.v2-week-fill:disabled { opacity: 0.25; cursor: default; }
.v2-calendar--week-tools .v2-day:nth-child(7n) { border-right: 1px solid rgba(54, 72, 96, 0.08); }
.v2-calendar--week-tools .v2-day:nth-child(8n) { border-right: none; }

.v2-weekdays,
.v2-month-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.v2-weekday {
	position: sticky;
	top: 33px;
	z-index: 2;
	padding: 9px 8px 7px;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--v2-muted);
	background: rgba(240, 245, 251, 0.96);
	border-bottom: 1px solid var(--v2-border);
}

.v2-month-grid {
	flex: 1 1 auto;
	grid-auto-rows: minmax(clamp(36px, 7.2vh, 104px), auto);
	grid-template-rows: repeat(6, minmax(clamp(36px, 7.2vh, 104px), auto));
}

.v2-day {
	position: relative;
	min-height: clamp(36px, 7.2vh, 104px);
	padding: clamp(3px, 0.55vw, 6px);
	border-right: 1px solid rgba(54, 72, 96, 0.08);
	border-bottom: 1px solid rgba(54, 72, 96, 0.08);
	background: rgba(251, 253, 255, 0.98);
	overflow: hidden;
}

.v2-day--weekend {
	background: rgba(244, 247, 251, 0.98);
}

.v2-day:nth-child(7n) {
	border-right: none;
}

.v2-day--muted {
	background: rgba(175, 180, 185, 0.26);
	color: #98a2b3;
}

.v2-day--placeholder {
	background: rgba(175, 180, 185, 0.22);
	border-right-color: rgba(54, 72, 96, 0.04);
	border-bottom-color: rgba(54, 72, 96, 0.04);
}

.v2-day-placeholder {
	width: 100%;
	height: 100%;
}

.v2-day--today {
	background: #eef5ff;
}

.v2-day--selected {
	box-shadow: inset 0 0 0 2px rgba(39, 70, 109, 0.18);
}

.v2-day-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
}

.v2-day-add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border: 1px solid rgba(54, 72, 96, 0.12);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: #27466d;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	z-index: 2;
}

.v2-day-actions {
	position: absolute;
	top: 4px;
	right: 4px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	z-index: 2;
}

.v2-day-quick-status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border: 1px solid rgba(54, 72, 96, 0.14);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: #27466d;
	font-size: 0.64rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.v2-day-quick-status[data-state="free"] {
	color: transparent;
}

.v2-day-quick-status--inline {
	min-width: 30px;
	height: 30px;
	padding: 0 10px;
	border-width: 2px;
	border-radius: 999px;
	font-size: 0.86rem;
	font-weight: 900;
	letter-spacing: 0.02em;
}

.v2-day-quick-status--inline[data-state="free"] {
	color: transparent;
}

.v2-day-quick-status--active {
	box-shadow: 0 0 0 1px rgba(39, 70, 109, 0.12);
}

.v2-day-quick-status--past {
	opacity: 0.3;
}

.v2-day-quick-status[data-state="ask"] {
	background: rgba(102, 102, 0, 0.92);
	border-color: #666600;
	color: #fff;
}

.v2-day-quick-status[data-state="unavailable"] {
	background: rgba(95, 142, 185, 0.92);
	border-color: #5F8EB9;
	color: #fff;
}

.v2-day-quick-status[data-state="pencilled"] {
	background: rgba(70, 70, 70, 0.92);
	border-color: #464646;
	color: #fff;
}

.v2-day-quick-status[data-state="confirmed"] {
	background: rgba(0, 0, 102, 0.94);
	border-color: #000066;
	color: #fff;
}

.v2-day-quick-status:disabled {
	opacity: 0.55;
	cursor: wait;
}

.v2-day-quick-status-menu {
	position: absolute;
	top: 0;
	left: 0;
	display: none;
	flex-direction: column;
	gap: 6px;
	min-width: 112px;
	padding: 8px;
	border: 1px solid var(--v2-border);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
	z-index: 250;
}

.v2-day-quick-status-menu.is-visible {
	display: flex;
}

.v2-day-quick-status-menu[aria-hidden="true"] {
	display: none;
}

.v2-day-quick-status-menu[data-has-note="false"] [data-action="note"],
.v2-day-quick-status-menu[data-has-edit="false"] [data-action="edit"],
.v2-day-quick-status-menu[data-has-clear="false"] [data-action="clear"] {
	display: none;
}

.v2-day-quick-status-menu-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0 10px;
	border: 1px solid rgba(54, 72, 96, 0.14);
	border-radius: 999px;
	background: #fff;
	color: #27466d;
	font: inherit;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
}

.v2-day-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1;
}

.v2-day--today .v2-day-number {
	background: #8bae83f6;
	color: #fff;
}

.v2-events {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 2px;
	margin-top: clamp(2px, 0.45vw, 5px);
	overflow: hidden;
}

.v2-day--single-entry .v2-events {
	display: block;
}

.v2-events--quick-status-only {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 36px;
	margin-top: 8px;
	overflow: visible;
	position: relative;
	z-index: 3;
}

.v2-event {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	align-content: center;
	width: fit-content;
	max-width: 100%;
	min-height: 18px;
	gap: 2px;
	font-size: 0.6rem;
	font-weight: 500;
	line-height: 1;
	color: #314155;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border: 0;
	background: transparent;
}

.v2-day--single-entry .v2-event {
	display: inline-flex;
	max-width: 100%;
}

.v2-day--single-entry .v2-event-label--large,
.v2-day--single-entry .v2-event-label--medium {
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
	line-height: 1.2;
}

.v2-event-status,
.v2-event-body {
	display: inline-flex;
	align-items: center;
	min-height: 18px;
	border-radius: 7px;
	overflow: hidden;
	white-space: nowrap;
}

.v2-event-status {
	flex: 0 0 auto;
	justify-content: center;
	min-width: 18px;
	padding: 0 5px;
	border: 1px solid transparent;
	color: #fff;
	font-weight: 700;
}

.v2-event-body {
	max-width: 100%;
	padding: 0 6px;
	background: rgba(234, 239, 245, 0.92);
	color: #314155;
	border: 1px solid rgba(133, 152, 178, 0.28);
}

.v2-day--single-entry .v2-event-body {
	max-width: 100%;
}

.v2-event-body--empty {
	display: none;
}

.v2-event-label {
	display: none;
	align-items: center;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1;
}

.v2-event-label--large {
	display: block;
}

.v2-event--selected {
	box-shadow: 0 0 0 2px rgba(39, 70, 109, 0.2);
}

.v2-event--linked-job .v2-event-body {
	border-style: solid;
	border-width: 2px;
}

.v2-event--past {
	opacity: 0.3;
}

.v2-event--cancelled {
	opacity: 0.42;
}

.v2-event--cancelled .v2-event-status,
.v2-event--cancelled .v2-event-body,
.v2-event--cancelled .v2-event-label {
	text-decoration: line-through;
}

.v2-event--available .v2-event-status,
.v2-key-swatch--available {
	border-color: #009933;
	background: rgba(0, 153, 51, 0.92);
}

.v2-event--note .v2-event-status,
.v2-key-swatch--note {
	border-color: #b7be00;
	background: rgba(183, 190, 0, 0.92);
	color: #293037;
}

.v2-event--unavailable .v2-event-status,
.v2-key-swatch--unavailable {
	border-color: #5f8eb9;
	background: rgba(95, 142, 185, 0.92);
}

.v2-event--ask .v2-event-status,
.v2-key-swatch--ask {
	border-color: #666600;
	background: rgba(102, 102, 0, 0.92);
}

.v2-event--request .v2-event-status,
.v2-key-swatch--request {
	border-color: #ff0000;
	background: rgba(255, 0, 0, 0.92);
}

.v2-event--pencilled .v2-event-status,
.v2-event--second .v2-event-status,
.v2-key-swatch--pencilled {
	border-color: #464646;
	background: rgba(70, 70, 70, 0.92);
}

.v2-event--confirmed .v2-event-status,
.v2-key-swatch--confirmed {
	border-color: #000066;
	background: rgba(0, 0, 102, 0.94);
}

.v2-event--worked .v2-event-status,
.v2-key-swatch--worked {
	border-color: #000000;
	background: rgba(0, 0, 0, 0.92);
}

.v2-event--invoiced .v2-event-status,
.v2-key-swatch--invoiced {
	border-color: #662d91;
	background: rgba(102, 45, 145, 0.92);
}

.v2-tooltip {
	position: absolute;
	left: 50%;
	top: calc(100% + 6px);
	transform: translateX(-50%);
	width: min(240px, calc(100vw - 32px));
	padding: 9px 10px;
	border-radius: 12px;
	background: rgba(15, 23, 42, 0.4);
	color: #fff;
	backdrop-filter: blur(12px);
	box-shadow: 0 16px 32px rgba(15, 23, 42, 0.24);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	z-index: 30;
}

.v2-tooltip::before {
	content: "";
	position: absolute;
	top: -6px;
	left: calc(50% - 6px);
	width: 12px;
	height: 12px;
	background: rgba(15, 23, 42, 0.4);
	transform: rotate(45deg);
}

.v2-day:hover .v2-tooltip,
.v2-day:focus-within .v2-tooltip {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.v2-day--left .v2-tooltip {
	left: 0;
	transform: translateX(0);
}

.v2-day--left .v2-tooltip::before {
	left: 16px;
}

.v2-day--right .v2-tooltip {
	left: auto;
	right: 0;
	transform: translateX(0);
}

.v2-day--right .v2-tooltip::before {
	left: auto;
	right: 16px;
}

.v2-day--top .v2-tooltip {
	top: auto;
	bottom: calc(100% + 6px);
}

.v2-day--top .v2-tooltip::before {
	top: auto;
	bottom: -6px;
}

.v2-tooltip-entry {
	font-size: 0.69rem;
	line-height: 1.35;
}

.v2-tooltip-entry + .v2-tooltip-entry {
	margin-top: 5px;
}

@media (max-width: 900px) {
	.v2-calendar-toolbar {
		gap: 6px;
	}

	.v2-toolbar-group {
		gap: 4px;
	}

	.v2-button,
	.v2-select,
	.v2-key-toggle {
		padding: 0 8px;
		font-size: 10px;
	}

	.v2-select {
		padding-right: 22px;
		background-position:
			calc(100% - 11px) calc(50% - 2px),
			calc(100% - 7px) calc(50% - 2px);
	}

	#v2-month {
		min-width: 96px;
	}

	#v2-year {
		min-width: 68px;
	}

	.v2-event-label--large {
		display: none;
	}

	.v2-event-label--medium {
		display: block;
	}
}

@media (max-width: 760px) {
	.v2-key {
		display: none;
	}
}

@media (max-width: 640px) {
	.v2-calendar {
		padding: 6px;
	}

	.v2-calendar-toolbar {
		grid-template-columns: auto 1fr auto;
	}

	.v2-toolbar-group--center {
		max-width: 100%;
	}

	.v2-select {
		padding-right: 20px;
		background-position:
			calc(100% - 10px) calc(50% - 2px),
			calc(100% - 6px) calc(50% - 2px);
	}

	#v2-month {
		min-width: 84px;
		max-width: 84px;
	}

	#v2-year {
		min-width: 62px;
		max-width: 62px;
	}

	.v2-month-grid {
		grid-auto-rows: minmax(88px, auto);
		grid-template-rows: repeat(6, minmax(88px, auto));
	}

	.v2-event {
		padding: 1px 3px;
		font-size: 0.56rem;
	}

	.v2-event-label--medium {
		display: none;
	}

	.v2-event-label--small {
		display: block;
	}
}

@media (max-width: 480px) {
	.v2-event {
		min-height: 14px;
		padding: 0 3px;
		font-size: 0.53rem;
	}

	.v2-event-body {
		display: none;
	}
}

/* Unstaffed client work must stand out above ordinary booking statuses. */
.v2-event--needs-staff .v2-event-status, .v2-key-swatch--needs-staff { background: #b42318; border-color: #b42318; color: #fff; }
.v2-event--needs-staff .v2-event-body { background: #fff1ed; border-color: #e7a399; color: #8f2118; font-weight: 700; }
