.fsb-cal-scope,
.fsb-cal {
	--fsb-bg: var(--off-white, #fff);
	--fsb-fg: var(--black-grey, #111);
	--fsb-muted: var(--grey, #555);
	--fsb-accent: var(--accent, #FBDB46);
	--fsb-accent-soft: var(--accent-op-20, rgba(251, 219, 71, 0.2));
	--fsb-free: #eef1ee;
	--fsb-pending: #f4d9a0;
	--fsb-confirmed: #cf6a6a;
	--fsb-selected: var(--accent, #FBDB46);
	--fsb-closed: #f4f4f4;
	--fsb-border: rgba(0, 0, 0, 0.08);

	color: var(--fsb-fg);
}

.fsb-cal {
	font-family: inherit;
	background: var(--fsb-bg);
	max-width: 100%;
	box-sizing: border-box;
}

.fsb-cal *,
.fsb-cal-scope * { box-sizing: border-box; }

.fsb-cal-layout {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.fsb-cal-layout > .fsb-cal { flex: 2 1 520px; min-width: 0; }
.fsb-cal-layout > .fsb-cal__form { flex: 1 1 360px; max-width: 420px; margin-top: 0; }

@media (max-width: 900px) {
	.fsb-cal-layout > .fsb-cal__form { flex-basis: 100%; max-width: 100%; }
}

body.fsb-cal-dragging { user-select: none; cursor: grabbing; }
body.fsb-cal-dragging .fsb-cal__slot { cursor: grabbing; }

.fsb-cal__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.fsb-cal__nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.fsb-cal__nav button {
	background: var(--fsb-bg);
	border: 1px solid var(--fsb-border);
	color: var(--fsb-fg);
	border-radius: 6px;
	width: 34px;
	height: 34px;
	padding: 0;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.fsb-cal__nav button:hover { background: var(--fsb-accent-soft); }

.fsb-cal__label { font-weight: 600; min-width: 160px; text-align: center; }

.fsb-cal__view-toggle {
	display: flex;
	border: 1px solid var(--fsb-border);
	border-radius: 6px;
	overflow: hidden;
	margin-left: auto;
}

.fsb-cal__view-toggle button {
	background: var(--fsb-bg);
	border: none;
	padding: 6px 14px;
	cursor: pointer;
	color: var(--fsb-fg);
}

.fsb-cal__view-toggle button.is-active { background: var(--fsb-accent); font-weight: 600; }

.fsb-cal__rooms {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.fsb-cal__rooms button {
	border: 1px solid var(--fsb-border);
	background: var(--fsb-bg);
	color: var(--fsb-fg);
	padding: 6px 14px;
	border-radius: 999px;
	cursor: pointer;
}

.fsb-cal__rooms button.is-active { background: var(--fsb-fg); color: var(--fsb-bg); }

.fsb-cal__legend {
	display: flex;
	gap: 16px;
	font-size: 12px;
	color: var(--fsb-muted);
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.fsb-cal__legend span { display: inline-flex; align-items: center; gap: 6px; }

.fsb-cal__legend i {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
}

.fsb-cal__grid-wrap { overflow-x: auto; border: 1px solid var(--fsb-border); border-radius: 10px; }

.fsb-cal__grid {
	display: grid;
	min-width: 640px;
}

.fsb-cal__scroll-hint {
	display: none;
}

.fsb-cal__head, .fsb-cal__row {
	display: contents;
}

.fsb-cal__cell {
	padding: 8px 6px;
	border-bottom: 1px solid var(--fsb-border);
	border-right: 1px solid var(--fsb-border);
	text-align: center;
	font-size: 13px;
}

.fsb-cal__cell--head {
	background: var(--fsb-fg);
	color: var(--fsb-bg);
	font-weight: 600;
	position: sticky;
	top: 0;
}

.fsb-cal__cell--time {
	background: var(--fsb-bg);
	font-weight: 600;
	white-space: nowrap;
}

.fsb-cal__slot {
	cursor: pointer;
	background: var(--fsb-free);
	min-height: 36px;
	transition: background 0.15s ease;
	touch-action: none;
	user-select: none;
}

.fsb-cal__slot:hover:not(.is-disabled) { filter: brightness(0.95); }
.fsb-cal__slot.is-pending { background: var(--fsb-pending); cursor: not-allowed; }
.fsb-cal__slot.is-confirmed { background: var(--fsb-confirmed); color: #fff; cursor: not-allowed; }
.fsb-cal__slot.is-closed { background: var(--fsb-closed); cursor: not-allowed; }
.fsb-cal__slot.is-past { background: var(--fsb-closed); cursor: not-allowed; opacity: 0.6; }
.fsb-cal__slot.is-selected { background: var(--fsb-selected); font-weight: 600; }
.fsb-cal__slot.is-readonly { cursor: default; }
.fsb-cal__slot.is-pending,
.fsb-cal__slot.is-confirmed {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fsb-cal__month-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}

.fsb-cal__day-cell {
	border: 1px solid var(--fsb-border);
	border-radius: 8px;
	padding: 8px;
	min-height: 64px;
	cursor: pointer;
	background: var(--fsb-bg);
}

.fsb-cal__day-cell:hover { background: var(--fsb-accent-soft); }
.fsb-cal__day-cell.is-closed { background: var(--fsb-closed); cursor: not-allowed; color: var(--fsb-muted); }
.fsb-cal__day-cell .fsb-cal__day-num { font-weight: 600; }
.fsb-cal__day-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-top: 6px; }

.fsb-cal__form {
	margin-top: 20px;
	border: 1px solid var(--fsb-border);
	border-radius: 10px;
	padding: 18px;
	background: var(--fsb-bg);
	color: var(--fsb-fg);
	font-family: inherit;
}

.fsb-cal__form h3 { margin-top: 0; margin-bottom: 14px; color: var(--fsb-fg); }

#fsb-selection-summary { margin-top: 0; margin-bottom: 24px; line-height: 1.5; }

.fsb-cal__field { margin-bottom: 18px; }
.fsb-cal__field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; color: var(--fsb-fg); }
.fsb-cal__field input[type=text],
.fsb-cal__field input[type=email],
.fsb-cal__field input[type=tel],
.fsb-cal__field input[type=date],
.fsb-cal__field input[type=time],
.fsb-cal__field select,
.fsb-cal__field textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--fsb-border);
	border-radius: 6px;
	font: inherit;
	background: var(--fsb-bg);
	color: var(--fsb-fg);
}

.fsb-cal__addons label { font-weight: normal; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

.fsb-cal__multiday-toggle { font-weight: normal !important; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fsb-cal__multiday-row { display: flex; gap: 8px; }
.fsb-cal__multiday-row input { flex: 1 1 auto; min-width: 0; }

.fsb-cal__consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.fsb-cal__consent a { color: var(--fsb-fg); text-decoration: underline; }

.fsb-cal__submit {
	background: var(--fsb-accent);
	color: var(--fsb-fg);
	border: none;
	padding: 12px 22px;
	border-radius: 8px;
	font-weight: 700;
	cursor: pointer;
	font-size: 15px;
}

.fsb-cal__submit:disabled { opacity: 0.5; cursor: not-allowed; }

.fsb-cal__message { padding: 10px 14px; border-radius: 8px; margin-top: 12px; font-size: 14px; }
.fsb-cal__message--error { background: #fdecec; color: #9a1c1c; }
.fsb-cal__message--success { background: #e8f6ec; color: #1a7f37; }

.fsb-cal__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
	.fsb-cal__label { min-width: auto; }
	.fsb-cal__grid { min-width: 520px; }

	.fsb-cal__scroll-hint {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 4px;
		width: 100%;
		box-sizing: border-box;
		margin-bottom: 8px;
		background: rgba(0, 0, 0, 0.85);
		color: #fff;
		font-size: 11px;
		font-weight: 600;
		padding: 6px 10px;
		border-radius: 999px;
		white-space: nowrap;
	}
}
