.terea-em-trigger-wrap,
.terea-em-modal {
	--terea-em-brand: #05863A;
	--terea-em-brand-dark: #046830;
	--terea-em-brand-soft: rgba(5, 134, 58, 0.08);
	--terea-em-brand-mid: rgba(5, 134, 58, 0.16);
	--terea-em-ink: #1a1f2e;
	--terea-em-muted: #6b7280;
	--terea-em-line: rgba(5, 134, 58, 0.12);
}

/* ── Trigger button ── */
.terea-em-trigger-wrap {
	margin: 0 0 14px;
}

.terea-em-trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--terea-em-line);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 2px 10px rgba(5, 134, 58, 0.06);
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.terea-em-trigger:hover {
	border-color: var(--terea-em-brand-mid);
	background: linear-gradient(135deg, rgba(5, 134, 58, 0.06) 0%, #fff 100%);
	box-shadow: 0 4px 14px rgba(5, 134, 58, 0.1);
}

.terea-em-trigger:focus-visible {
	outline: 2px solid var(--terea-em-brand);
	outline-offset: 2px;
}

.terea-em-trigger__icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--terea-em-brand);
	color: #fff;
}

.terea-em-trigger__icon svg {
	width: 14px;
	height: 14px;
}

.terea-em-trigger__label {
	font-size: 13px;
	font-weight: 700;
	color: var(--terea-em-ink);
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.terea-em-trigger__hint {
	margin-left: auto;
	font-size: 11px;
	font-weight: 500;
	color: var(--terea-em-muted);
	line-height: 1.2;
}

/* ── Modal ── */
.terea-em-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.terea-em-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.terea-em-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 31, 46, 0.45);
	backdrop-filter: blur(2px);
	cursor: pointer;
}

.terea-em-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 380px;
	transform: translateY(10px) scale(0.98);
	transition: transform 0.2s ease;
}

.terea-em-modal.is-open .terea-em-modal__dialog {
	transform: translateY(0) scale(1);
}

body.terea-em-modal-open {
	overflow: hidden;
}

/* ── Panel (inside modal) ── */
.terea-em-panel {
	margin: 0;
	border-radius: 12px;
	background: #fff;
	border: 1px solid var(--terea-em-line);
	box-shadow: 0 16px 40px rgba(26, 31, 46, 0.18);
	overflow: hidden;
	font-size: 12px;
}

.terea-em-panel__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: linear-gradient(135deg, rgba(5, 134, 58, 0.08) 0%, rgba(5, 134, 58, 0.02) 100%);
	border-bottom: 1px solid var(--terea-em-line);
}

.terea-em-panel__icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--terea-em-brand);
	color: #fff;
}

.terea-em-panel__icon svg {
	width: 14px;
	height: 14px;
}

.terea-em-panel__title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--terea-em-ink);
	letter-spacing: -0.01em;
}

.terea-em-panel__subtitle {
	display: block;
	margin-top: 1px;
	font-size: 11px;
	color: var(--terea-em-muted);
	line-height: 1.2;
}

.terea-em-modal__close {
	margin-left: auto;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--terea-em-muted);
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

.terea-em-modal__close:hover {
	background: var(--terea-em-brand-soft);
	color: var(--terea-em-brand-dark);
}

.terea-em-modal__close:focus-visible {
	outline: 2px solid var(--terea-em-brand);
	outline-offset: 1px;
}

.terea-em-modal__close svg {
	width: 16px;
	height: 16px;
}

/* ── Body ── */
.terea-em-panel__body {
	display: flex;
	flex-direction: column;
}

.terea-em-row {
	display: grid;
	grid-template-columns: 80px 1fr;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid rgba(26, 31, 46, 0.05);
}

.terea-em-row:last-child {
	border-bottom: none;
}

.terea-em-row--tat {
	align-items: start;
}

.terea-em-row__label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--terea-em-brand);
	line-height: 1.3;
}

.terea-em-row__value {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

/* ── Text values ── */
.terea-em-text {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--terea-em-ink);
	word-break: break-word;
}

.terea-em-row--aroma .terea-em-text {
	display: inline-flex;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--terea-em-brand-soft);
	border: 1px solid var(--terea-em-brand-mid);
	color: var(--terea-em-brand-dark);
	font-size: 12px;
	font-weight: 700;
}

.terea-em-row--tat .terea-em-text {
	font-weight: 500;
	font-size: 12px;
	color: #374151;
	line-height: 1.45;
}

/* ── Intensity ── */
.terea-em-intensity {
	display: flex;
	align-items: center;
	gap: 8px;
}

.terea-em-intensity__dots {
	display: flex;
	gap: 4px;
}

.terea-em-intensity__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(26, 31, 46, 0.12);
}

.terea-em-intensity__dot.is-filled {
	background: var(--terea-em-brand);
}

.terea-em-intensity__text {
	font-size: 12px;
	font-weight: 700;
	color: var(--terea-em-brand);
	letter-spacing: -0.02em;
}

@media (max-width: 480px) {
	.terea-em-modal {
		padding: 16px;
		align-items: flex-end;
	}

	.terea-em-modal__dialog {
		max-width: none;
	}

	.terea-em-row {
		grid-template-columns: 72px 1fr;
		padding: 11px 12px;
	}

	.terea-em-trigger__hint {
		display: none;
	}
}
