/**
 * Status change emails — settings card.
 * Follows the BrikPanel design system (monochrome, soft cards, system font).
 */

.bp-cse-card {
	background: #ffffff;
	border: 1px solid #e3e3e3;
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.08 );
	padding: 1.25rem 1.5rem;
	margin: 1rem 0 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #303030;
}

.bp-cse-list {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

/* Collapsible item */
.bp-cse-item {
	border: 1px solid #e3e3e3;
	border-radius: 0.5rem;
	background: #fafafa;
	overflow: hidden;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.bp-cse-item.is-on {
	border-color: #d0d0d0;
	background: #fff;
}

.bp-cse-head {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.625rem 0.75rem;
	cursor: pointer;
	user-select: none;
}

.bp-cse-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: #303030;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bp-cse-state {
	flex: 0 0 auto;
	font-size: 0.75rem;
	font-weight: 550;
	color: #8a8a8a;
}

.bp-cse-item.is-on .bp-cse-state {
	color: #1a8917;
}

/* Toggle switch — 40x22, per the BrikPanel spec */
.bp-cse-switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-block;
	width: 40px;
	height: 22px;
	cursor: pointer;
}

.bp-cse-switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.bp-cse-slider {
	position: absolute;
	inset: 0;
	background: #ccc;
	border-radius: 22px;
	transition: background-color 0.15s ease;
}

.bp-cse-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.2 );
	transition: transform 0.15s ease;
}

.bp-cse-switch input:checked + .bp-cse-slider {
	background: #303030;
}

.bp-cse-switch input:checked + .bp-cse-slider::before {
	transform: translateX( 18px );
}

.bp-cse-switch input:focus-visible + .bp-cse-slider {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #303030;
}

.bp-cse-chev {
	flex: 0 0 auto;
	color: #8a8a8a;
	transition: transform 0.2s ease;
}

.bp-cse-item.is-open .bp-cse-chev {
	transform: rotate( 180deg );
}

/* Collapsible body — CSS grid rows technique */
.bp-cse-body {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition: grid-template-rows 0.25s cubic-bezier( 0.4, 0, 0.2, 1 ), opacity 0.25s cubic-bezier( 0.4, 0, 0.2, 1 );
}

.bp-cse-item.is-open .bp-cse-body {
	grid-template-rows: 1fr;
	opacity: 1;
}

.bp-cse-body-inner {
	overflow: hidden;
	min-height: 0;
	padding: 0 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.bp-cse-item.is-open .bp-cse-body-inner {
	padding: 0.25rem 0.75rem 0.875rem;
	border-top: 1px solid #ececec;
	margin-top: -1px;
}

/* Fields */
.bp-cse-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.bp-cse-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #303030;
}

.bp-cse-input,
.bp-cse-textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #8a8a8a;
	border-radius: 0.5rem;
	padding: 0.5rem 0.625rem;
	font-size: 0.875rem;
	font-family: inherit;
	line-height: 1.5;
	color: #303030;
	background: #fff;
}

.bp-cse-textarea {
	resize: vertical;
	min-height: 120px;
}

.bp-cse-input:focus,
.bp-cse-textarea:focus {
	border-color: #303030;
	box-shadow: 0 0 0 1px #303030;
	outline: none;
}

.bp-cse-input::placeholder {
	color: #8a8a8a;
}

/* Recipients row */
.bp-cse-checks {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.bp-cse-check {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.875rem;
	color: #303030;
	cursor: pointer;
}

/* Placeholder chips */
.bp-cse-tokens {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.bp-cse-token {
	font-family: Menlo, Consolas, monospace;
	font-size: 0.75rem;
	color: #303030;
	background: #f1f1f1;
	border: 1px solid #e3e3e3;
	border-radius: 0.35rem;
	padding: 0.2rem 0.45rem;
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

.bp-cse-token:hover {
	background: #e9e9e9;
	border-color: #d0d0d0;
}

@media ( max-width: 600px ) {
	.bp-cse-head .bp-cos-slug {
		display: none;
	}
}
