/* Hamenagen Sleep Timer — תואם סגנון אייקוני ההדר */

.hmst-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

button.hmst-toggle,
.hm-header button.hmst-toggle {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	max-height: 36px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	color: var(--hm-h-text, #f5f5f7) !important;
	cursor: pointer !important;
	flex-shrink: 0 !important;
	position: relative !important;
	overflow: visible !important;
	box-shadow: none !important;
	font-size: 0 !important;
	line-height: 1 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	box-sizing: border-box !important;
	transition: color 0.22s ease, opacity 0.22s ease, transform 0.22s ease !important;
}

button.hmst-toggle:hover,
.hm-header button.hmst-toggle:hover,
button.hmst-toggle[aria-expanded="true"],
.hm-header button.hmst-toggle[aria-expanded="true"] {
	background: transparent !important;
	color: var(--hm-h-brand, #cb1e53) !important;
	box-shadow: none !important;
	transform: none !important;
}

button.hmst-toggle:active,
.hm-header button.hmst-toggle:active {
	transform: scale(0.94) !important;
	opacity: 0.85 !important;
}

button.hmst-toggle:focus,
.hm-header button.hmst-toggle:focus {
	outline: none !important;
	box-shadow: none !important;
}

button.hmst-toggle:focus-visible,
.hm-header button.hmst-toggle:focus-visible {
	outline: 2px solid var(--hm-h-brand, #cb1e53) !important;
	outline-offset: 3px !important;
	border-radius: 6px !important;
}

.hmst-toggle__icon {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 100% !important;
}

.hmst-toggle__svg,
button.hmst-toggle svg,
.hm-header button.hmst-toggle svg {
	width: 22px !important;
	height: 22px !important;
	display: block !important;
	flex-shrink: 0 !important;
	pointer-events: none !important;
	color: inherit !important;
}

.hmst-toggle.is-active .hmst-toggle__svg {
	color: var(--hm-h-brand, #cb1e53);
}

.hmst-toggle__badge {
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--hm-h-brand, #cb1e53);
	box-shadow: 0 0 0 2px var(--hm-h-utility-bg, #16162e);
	pointer-events: none;
}

.hmst-toggle__badge[hidden] {
	display: none !important;
}

/* תפריט */
.hmst-menu {
	position: absolute;
	top: calc(100% + 12px);
	inset-inline-end: 0;
	width: min(320px, calc(100vw - 24px));
	padding: 0;
	background: var(--hm-h-profile-menu-bg, #181818);
	border: 1px solid var(--hm-h-profile-menu-border, rgba(255, 255, 255, 0.08));
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
	z-index: 130;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	font-family: var(--hm-h-font, inherit);
	color: var(--hm-h-text, #f5f5f7);
	direction: rtl;
	text-align: right;
}

.hmst-menu::before {
	content: "";
	position: absolute;
	top: -6px;
	inset-inline-end: 14px;
	width: 12px;
	height: 12px;
	background: var(--hm-h-profile-menu-bg, #181818);
	border-top: 1px solid var(--hm-h-profile-menu-border, rgba(255, 255, 255, 0.08));
	border-right: 1px solid var(--hm-h-profile-menu-border, rgba(255, 255, 255, 0.08));
	transform: rotate(-45deg);
}

.hmst-menu[hidden] {
	display: none !important;
}

.hmst-menu__head {
	padding: 0.9rem 1rem 0.7rem;
	border-bottom: 1px solid var(--hm-h-profile-divider, rgba(255, 255, 255, 0.08));
}

.hmst-menu__title {
	display: block;
	font-size: 0.98rem;
	font-weight: 700;
	color: var(--hm-h-text, #f5f5f7);
	line-height: 1.3;
}

.hmst-menu__sub {
	margin: 0.35rem 0 0;
	font-size: 0.8rem;
	line-height: 1.4;
	color: var(--hm-h-profile-muted, rgba(245, 245, 247, 0.62));
	font-weight: 400;
}

.hmst-menu__body {
	padding: 0.85rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.hmst-section__label,
.hmst-field__label,
.hmst-menu .hmst-section__label,
.hmst-menu .hmst-field__label {
	display: block !important;
	margin: 0 0 0.45rem !important;
	padding: 0 !important;
	font-size: 0.78rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em !important;
	line-height: 1.3 !important;
	color: var(--hm-h-profile-muted, rgba(245, 245, 247, 0.62)) !important;
	background: none !important;
	border: none !important;
}

.hmst-presets,
.hmst-menu .hmst-presets {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 0.4rem !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* כפתורי קיצור — מוגן מדריסת תבנית/אלמנטור */
button.hmst-preset,
.hmst-menu button.hmst-preset,
.hmst-menu .hmst-presets button.hmst-preset {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 40px !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0.4rem 0.3rem !important;
	border: 1px solid rgba(203, 30, 83, 0.28) !important;
	border-radius: 10px !important;
	background: rgba(203, 30, 83, 0.08) !important;
	background-color: rgba(203, 30, 83, 0.08) !important;
	background-image: none !important;
	color: var(--hm-h-text, #f5f5f7) !important;
	box-shadow: none !important;
	text-shadow: none !important;
	font-family: var(--hm-h-font, inherit) !important;
	font-size: 0.82rem !important;
	font-weight: 650 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer !important;
	transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.15s ease !important;
}

button.hmst-preset:hover,
button.hmst-preset:focus-visible,
.hmst-menu button.hmst-preset:hover,
.hmst-menu button.hmst-preset:focus-visible {
	border-color: rgba(203, 30, 83, 0.7) !important;
	background: rgba(203, 30, 83, 0.16) !important;
	background-color: rgba(203, 30, 83, 0.16) !important;
	color: var(--hm-h-brand, #cb1e53) !important;
	outline: none !important;
	box-shadow: none !important;
}

button.hmst-preset:active,
.hmst-menu button.hmst-preset:active {
	transform: scale(0.97) !important;
}

.hmst-field__row,
.hmst-menu .hmst-field__row {
	display: flex !important;
	align-items: center !important;
	gap: 0.45rem !important;
	margin: 0 !important;
	width: 100% !important;
}

/* אינפוטים — בלי סטייל דפדפן שחור/לבן */
input.hmst-input,
.hmst-menu input.hmst-input,
.hmst-menu input[type="number"].hmst-input,
.hmst-menu input[type="time"].hmst-input {
	appearance: none !important;
	-webkit-appearance: none !important;
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: auto !important;
	max-width: none !important;
	height: 40px !important;
	min-height: 40px !important;
	margin: 0 !important;
	padding: 0 0.75rem !important;
	border-radius: 10px !important;
	border: 1px solid rgba(203, 30, 83, 0.28) !important;
	background: rgba(203, 30, 83, 0.06) !important;
	background-color: rgba(203, 30, 83, 0.06) !important;
	background-image: none !important;
	color: var(--hm-h-text, #f5f5f7) !important;
	box-shadow: none !important;
	outline: none !important;
	font-family: var(--hm-h-font, inherit) !important;
	font-size: 0.9rem !important;
	font-weight: 560 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-align: right !important;
	box-sizing: border-box !important;
}

input.hmst-input--time,
.hmst-menu input.hmst-input--time {
	flex: 1 1 130px !important;
	padding-inline: 0.65rem !important;
	color-scheme: dark;
}

html[data-hm-theme="light"] input.hmst-input--time,
.hm-header[data-hm-theme="light"] input.hmst-input--time,
html[data-hm-theme="light"] .hmst-menu input.hmst-input--time {
	color-scheme: light;
}

input.hmst-input:focus,
input.hmst-input:focus-visible,
.hmst-menu input.hmst-input:focus,
.hmst-menu input.hmst-input:focus-visible {
	border-color: var(--hm-h-brand, #cb1e53) !important;
	background: rgba(203, 30, 83, 0.1) !important;
	box-shadow: 0 0 0 3px rgba(203, 30, 83, 0.18) !important;
	outline: none !important;
}

input.hmst-input::placeholder,
.hmst-menu input.hmst-input::placeholder {
	color: var(--hm-h-profile-muted, rgba(245, 245, 247, 0.5)) !important;
	opacity: 1 !important;
}

/* הסתרת חיצי number במידת האפשר */
input.hmst-input[type="number"]::-webkit-outer-spin-button,
input.hmst-input[type="number"]::-webkit-inner-spin-button,
.hmst-menu input.hmst-input[type="number"]::-webkit-outer-spin-button,
.hmst-menu input.hmst-input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

input.hmst-input[type="number"],
.hmst-menu input.hmst-input[type="number"] {
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

.hmst-field__suffix,
.hmst-menu .hmst-field__suffix {
	flex-shrink: 0 !important;
	font-size: 0.8rem !important;
	font-weight: 500 !important;
	color: var(--hm-h-profile-muted, rgba(245, 245, 247, 0.62)) !important;
	line-height: 1 !important;
}

button.hmst-btn,
.hmst-menu button.hmst-btn {
	appearance: none !important;
	-webkit-appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-height: 40px !important;
	height: 40px !important;
	margin: 0 !important;
	padding: 0 0.95rem !important;
	border-radius: 10px !important;
	border: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	font-family: var(--hm-h-font, inherit) !important;
	font-size: 0.84rem !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer !important;
	flex-shrink: 0 !important;
	transition: opacity 0.18s ease, transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease !important;
}

button.hmst-btn:active,
.hmst-menu button.hmst-btn:active {
	transform: scale(0.97) !important;
}

button.hmst-btn--primary,
.hmst-menu button.hmst-btn--primary {
	background: var(--hm-h-brand, #cb1e53) !important;
	background-color: var(--hm-h-brand, #cb1e53) !important;
	background-image: none !important;
	color: #ffffff !important;
	border: none !important;
}

button.hmst-btn--primary:hover,
button.hmst-btn--primary:focus-visible,
.hmst-menu button.hmst-btn--primary:hover,
.hmst-menu button.hmst-btn--primary:focus-visible {
	opacity: 0.92 !important;
	background: var(--hm-h-brand, #cb1e53) !important;
	background-color: var(--hm-h-brand, #cb1e53) !important;
	color: #ffffff !important;
	outline: none !important;
	box-shadow: 0 4px 14px rgba(203, 30, 83, 0.28) !important;
}

button.hmst-btn--ghost,
.hmst-menu button.hmst-btn--ghost {
	width: 100% !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 1px solid rgba(203, 30, 83, 0.3) !important;
	color: var(--hm-h-text, #f5f5f7) !important;
}

button.hmst-btn--ghost:hover,
button.hmst-btn--ghost:focus-visible,
.hmst-menu button.hmst-btn--ghost:hover,
.hmst-menu button.hmst-btn--ghost:focus-visible {
	border-color: rgba(203, 30, 83, 0.65) !important;
	color: var(--hm-h-brand, #cb1e53) !important;
	background: rgba(203, 30, 83, 0.08) !important;
	outline: none !important;
	box-shadow: none !important;
}

/* מצב בהיר — ניגודיות נקייה */
html[data-hm-theme="light"] button.hmst-preset,
.hm-header[data-hm-theme="light"] button.hmst-preset,
html[data-hm-theme="light"] .hmst-menu button.hmst-preset {
	background: rgba(32, 33, 90, 0.04) !important;
	background-color: rgba(32, 33, 90, 0.04) !important;
	border-color: rgba(32, 33, 90, 0.14) !important;
	color: #20215a !important;
}

html[data-hm-theme="light"] button.hmst-preset:hover,
html[data-hm-theme="light"] button.hmst-preset:focus-visible,
.hm-header[data-hm-theme="light"] button.hmst-preset:hover,
html[data-hm-theme="light"] .hmst-menu button.hmst-preset:hover {
	background: rgba(203, 30, 83, 0.1) !important;
	border-color: rgba(203, 30, 83, 0.5) !important;
	color: #cb1e53 !important;
}

html[data-hm-theme="light"] input.hmst-input,
.hm-header[data-hm-theme="light"] input.hmst-input,
html[data-hm-theme="light"] .hmst-menu input.hmst-input {
	background: #ffffff !important;
	background-color: #ffffff !important;
	border-color: rgba(32, 33, 90, 0.16) !important;
	color: #20215a !important;
}

html[data-hm-theme="light"] input.hmst-input:focus,
html[data-hm-theme="light"] .hmst-menu input.hmst-input:focus {
	border-color: #cb1e53 !important;
	background: #ffffff !important;
	box-shadow: 0 0 0 3px rgba(203, 30, 83, 0.15) !important;
}

.hmst-active {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding: 0.75rem 0.8rem;
	border-radius: 10px;
	background: rgba(203, 30, 83, 0.1);
	border: 1px solid rgba(203, 30, 83, 0.28);
}

.hmst-active[hidden] {
	display: none !important;
}

.hmst-active__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.hmst-active__label {
	font-size: 0.82rem;
	color: var(--hm-h-profile-muted, rgba(245, 245, 247, 0.7));
}

.hmst-active__time {
	font-size: 1.35rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	color: var(--hm-h-brand, #cb1e53);
	line-height: 1;
}

.hmst-toast {
	margin: 0;
	padding: 0.65rem 0.75rem;
	border-radius: 8px;
	font-size: 0.84rem;
	line-height: 1.4;
	text-align: center;
	background: rgba(32, 33, 90, 0.12);
	color: var(--hm-h-text, #f5f5f7);
}

.hmst-toast[hidden] {
	display: none !important;
}

.hmst-toast.is-done {
	background: rgba(203, 30, 83, 0.12);
	color: var(--hm-h-brand, #cb1e53);
	font-weight: 600;
}

html[data-hm-theme="light"] .hmst-menu,
.hm-header[data-hm-theme="light"] .hmst-menu {
	box-shadow: 0 14px 36px rgba(32, 33, 90, 0.16);
}

@media (max-width: 1023px) {
	button.hmst-toggle,
	.hm-header button.hmst-toggle {
		width: 34px !important;
		height: 34px !important;
		min-width: 34px !important;
		min-height: 34px !important;
		max-height: 34px !important;
	}

	.hmst-toggle__svg,
	button.hmst-toggle svg,
	.hm-header button.hmst-toggle svg {
		width: 20px !important;
		height: 20px !important;
	}

	.hmst-menu {
		position: fixed;
		top: auto;
		bottom: calc(var(--hm-h-mob-bar-h, 72px) + 28px);
		inset-inline: 12px;
		width: auto;
		max-height: min(70vh, 520px);
		overflow-y: auto;
		z-index: 100010;
	}

	.hmst-menu::before {
		display: none;
	}
}
