body {
	background: #f8fafc;
}

main {
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem;
}

.card {
	background: white;
	border: 1px solid #c7d2fe;
	border-radius: 0.45rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	cursor: default;
	flex: 1 1 0;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	padding: 0;
}

.card-body {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	padding: 0.75rem;
}

.card-title {
	color: #1f2937;
	font-size: 1.25rem;
	line-height: 1.1;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.card-text {
	background: #f8fafc;
	border: 1px solid #dbe4ff;
	border-radius: 0.35rem;
	color: #1f2937;
	cursor: pointer;
	font-size: 1.05rem;
	line-height: 1.3;
	margin: 0;
	overflow: hidden;
	padding: 0.5rem;
	text-overflow: ellipsis;
}

.rule-summary {
	align-items: baseline;
	display: flex;
	gap: 0.5rem;
	min-width: 0;
	white-space: nowrap;
}

.rule-name {
	font-weight: 700;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rule-time {
	flex: 0 0 auto;
}

.card-text:hover,
.card-text.active {
	background: #eef2ff;
	border-color: #0d6efd;
}

.card-text.card-new {
	background: #ecfdf5;
	border-color: #86efac;
}

.card-availability {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	max-height: 35vh;
	overflow-y: auto;
	padding: 0.75rem;
}

.card-availability:empty {
	display: none;
}

#mobile-btn-add-rule {
	display: none;
}

.mobile-day-picker {
	display: none;
}

#btn-submit {
	background-color: #0d6efd;
	color: white;
	font-weight: 700;
}

#form-schedule-rule {
	border: 1px solid #0b5ed7;
	border-radius: 0.375rem;
	box-shadow: 0 12px 28px rgba(13, 110, 253, 0.22);
	max-height: calc(100vh - 2rem);
	min-width: 30rem;
	overflow: hidden;
}

#form-schedule-rule .header {
	align-items: center;
	background-color: #0d6efd;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	color: white;
	cursor: grab;
	font-size: 1.15rem;
	font-weight: 700;
	padding: 0.75rem 1rem;
}

#form-schedule-rule .header:active {
	cursor: grabbing;
}

#form-schedule-rule .header a {
	color: white;
	font-weight: 700;
	text-decoration: none;
}

#form-schedule-rule > div:not(.header):not(.footer) {
	align-items: center;
	gap: 0.75rem;
	padding: 0.35rem 1rem;
}

#form-schedule-rule > div:nth-child(2) {
	padding-top: 1rem;
}

#form-schedule-rule label {
	color: #1f2937;
	font-size: 1.05rem;
	width: 8.5rem;
}

#form-schedule-rule input,
#form-schedule-rule select {
	border: 1px solid #c7d2fe;
	border-radius: 0.25rem;
	font-size: 1.1rem;
	padding: 0.35rem 0.5rem;
}

#form-schedule-rule input:focus,
#form-schedule-rule select:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
	outline: none;
}

#form-schedule-rule .footer {
	background: #f8fafc;
	border-top: 1px solid #dbe4ff;
	display: flex;
	gap: 0.75rem;
	justify-content: flex-end;
	padding: 0.75rem 1rem;
}

@media only screen and (max-width: 960px) {
	main {
		display: flex;
		flex-direction: column;
		overflow-y: auto;
		padding: 0 0.65rem 0.65rem;
		width: 100%;
	}

.mobile-day-picker {
		align-items: center;
		background: #f8fafc;
		border-bottom: 1px solid #dbe4ff;
		box-sizing: border-box;
		display: flex;
		flex-shrink: 0;
		gap: 0.6rem;
		padding: 0.65rem 0.75rem;
		width: 100%;
	}

	.mobile-day-picker label {
		color: #1f2937;
		font-size: 1.05rem;
		font-weight: 700;
		white-space: nowrap;
	}

	#mobile-day-select {
		border: 1px solid #c7d2fe;
		border-radius: 0.25rem;
		color: #1f2937;
		flex: 1;
		font-size: 1.05rem;
		font-weight: 700;
		min-width: 0;
		padding: 0.45rem 0.55rem;
	}

	#mobile-day-select:focus {
		border-color: #0d6efd;
		box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
		outline: none;
	}

	.card {
		background: transparent;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		display: none;
		flex: 0 0 auto;
		min-height: 0;
		overflow: visible;
		padding: 0;
	}

	.card.mobile-selected-day {
		display: block;
	}

	.card.mobile-selected-day .card-title {
		display: none;
	}

	.card.mobile-selected-day .card-body {
		gap: 0.6rem;
		padding: 0;
	}

	.card.mobile-selected-day .card-text {
		border-radius: 0.45rem;
		padding: 0.75rem;
	}

	#mobile-btn-add-rule {
		align-items: center;
		background-color: #0d6efd;
		box-sizing: border-box;
		color: white;
		display: inline-flex;
		flex: 0 0 auto;
		font-size: 1.35rem;
		font-weight: 700;
		height: 2.15rem;
		justify-content: center;
		line-height: 1;
		margin-left: auto;
		margin-top: 0.1rem;
		padding: 0;
		width: 2.15rem;
	}

	#form-schedule-rule {
		border-radius: 0;
		box-sizing: border-box;
		height: 100%;
		inset: 0;
		max-height: none;
		min-width: 0;
		overflow: hidden;
		position: fixed;
		transform: none;
		width: 100%;
	}

	#form-schedule-rule .header {
		cursor: default;
	}

	#form-schedule-rule > div:not(.header):not(.footer) {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}

	#form-schedule-rule .footer {
		gap: 0.5rem;
		padding: 0.45rem 0.75rem;
	}

	#form-schedule-rule .footer button {
		font-size: 1rem;
		min-height: 2.25rem;
		padding: 0.35rem 0.75rem;
	}
}
