.emdad-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
}
.emdad-modal-box {
	background: #fff;
	border-radius: 14px;
	padding: 22px;
	max-width: 480px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.emdad-modal-box h3 {
	margin-top: 0;
	font-size: 17px;
}
.emdad-rules-list {
	padding-right: 20px;
	margin: 14px 0;
	font-size: 14px;
	line-height: 1.9;
	color: #333;
}
.emdad-rules-list li { margin-bottom: 10px; }
.emdad-rules-agree {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	margin: 16px 0;
	cursor: pointer;
}
#emdad-rules-close-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.emdad-wrapper {
	max-width: 800px;
	margin: 0 auto;
	font-family: Tahoma, Arial, sans-serif;
	text-align: right;
	--emdad-alert-success-bg: #d4edda;
	--emdad-alert-success-text: #155724;
	--emdad-alert-error-bg: #f8d7da;
	--emdad-alert-error-text: #721c24;
	--emdad-alert-info-bg: #d1ecf1;
	--emdad-alert-info-text: #0c5460;
	--emdad-status-bg: #fff3cd;
	--emdad-status-text: #664d03;
	--emdad-infobox-bg: #f8f9fa;
	--emdad-infobox-text: #212529;
	--emdad-topbar-bg: #f8f9fa;
	--emdad-topbar-text: #212529;
	--emdad-requestslist-bg: #ffffff;
	--emdad-requestslist-text: #212529;
}

.emdad-map-wrap {
	position: relative;
	margin-bottom: 14px;
}

.emdad-map {
	width: 100%;
	height: 420px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #ddd;
	margin-bottom: 0;
}

.emdad-locate-btn {
	position: absolute;
	bottom: 20px;
	right: 10px;
	width: 40px;
	height: 40px;
	border-radius: 2px;
	border: none;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	z-index: 5;
	transition: 0.2s;
}
.emdad-locate-btn:hover { background: #f2f2f2; }
.emdad-locate-btn:disabled,
.emdad-locate-btn.emdad-locate-loading {
	opacity: 0.6;
	cursor: not-allowed;
}
.emdad-locate-btn.emdad-locate-loading svg {
	animation: emdad-locate-spin 1s linear infinite;
}
@keyframes emdad-locate-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.emdad-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.emdad-btn {
	border: none;
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 15px;
	cursor: pointer;
	transition: 0.2s;
}

.emdad-btn-primary {
	background: #e63946;
	color: #fff;
}
.emdad-btn-primary:hover { background: #c72f3b; }
.emdad-btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.emdad-btn-secondary {
	background: #f1f1f1;
	color: #333;
	text-decoration: none;
	display: inline-block;
}

.emdad-btn-nav {
	background: #1d4ed8;
	color: #fff;
	text-decoration: none;
	display: inline-block;
}
.emdad-btn-nav:hover { background: #1e40af; }
.emdad-btn-small:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.emdad-btn-small {
	padding: 4px 10px;
	font-size: 12px;
	background: #2a9d8f;
	color: #fff;
	border-radius: 6px;
	margin-right: 8px;
}

.emdad-btn-cancel {
	background: #6c757d;
	color: #fff;
}
.emdad-btn-cancel:hover { background: #565e64; }

.emdad-phone-input {
	flex: 1;
	min-width: 200px;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	direction: ltr;
	text-align: right;
}

.emdad-status-box {
	background: var(--emdad-status-bg);
	color: var(--emdad-status-text);
	padding: 8px 14px;
	border-radius: 8px;
	font-size: 14px;
}

.emdad-rating-stars {
	display: flex;
	gap: 8px;
	margin: 10px 0;
}
.emdad-star {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 2px solid #ddd;
	background: #fff;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
	color: #555;
	transition: 0.15s;
}
.emdad-star:hover, .emdad-star.selected {
	background: #f59e0b;
	border-color: #f59e0b;
	color: #fff;
}
.emdad-rating-hint {
	font-size: 12px;
	color: #777;
	margin: 0;
}

.emdad-info-box {
	background: var(--emdad-infobox-bg);
	color: var(--emdad-infobox-text);
	border-radius: 10px;
	padding: 14px;
	margin-top: 10px;
}
.emdad-info-box ul { margin: 8px 0 0; padding-right: 18px; }

.emdad-alert {
	padding: 10px 16px;
	border-radius: 8px;
	margin-bottom: 14px;
	font-size: 14px;
}
.emdad-alert-success { background: var(--emdad-alert-success-bg); color: var(--emdad-alert-success-text); }
.emdad-alert-error { background: var(--emdad-alert-error-bg); color: var(--emdad-alert-error-text); }
.emdad-alert-info { background: var(--emdad-alert-info-bg); color: var(--emdad-alert-info-text); }

/* فرم ورود / ثبت‌نام */
.emdad-auth-box {
	max-width: 420px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.emdad-tabs {
	display: flex;
	margin-bottom: 16px;
	border-bottom: 1px solid #eee;
}

.emdad-tab-btn {
	flex: 1;
	background: none;
	border: none;
	padding: 10px;
	cursor: pointer;
	font-size: 15px;
	color: #888;
	border-bottom: 2px solid transparent;
}
.emdad-tab-btn.active {
	color: #e63946;
	border-bottom-color: #e63946;
	font-weight: bold;
}

.emdad-tab-content { display: none; flex-direction: column; gap: 8px; }
.emdad-tab-content.active { display: flex; }

.emdad-forgot-link {
	text-align: center;
	font-size: 13px;
	margin: 4px 0 0;
}
.emdad-forgot-link a {
	color: #666;
	text-decoration: underline;
}

.emdad-tab-content label { font-size: 13px; color: #555; }
.emdad-form-warning {
	font-size: 12px;
	color: #9a3412;
	background: #fff3cd;
	padding: 6px 10px;
	border-radius: 6px;
	margin: -4px 0 0;
}
.emdad-form-note {
	font-size: 12px;
	color: #555;
	margin: 4px 0 0;
}
.emdad-tab-content input {
	padding: 9px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.emdad-rescuer-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	background: var(--emdad-topbar-bg);
	color: var(--emdad-topbar-text);
	padding: 10px 14px;
	border-radius: 10px;
	margin-bottom: 12px;
}

.emdad-switch { display: flex; align-items: center; gap: 6px; font-size: 14px; }

.emdad-requests-list {
	background: var(--emdad-requestslist-bg);
	color: var(--emdad-requestslist-text);
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 14px;
}
.emdad-requests-list ul { list-style: none; margin: 0; padding: 0; }
.emdad-requests-list li { padding: 8px 0; border-bottom: 1px solid #f1f1f1; font-size: 14px; }
.emdad-req-phone { margin-right: 8px; color: #2a9d8f; text-decoration: none; font-weight: bold; }

/* پیام آنی زیر فیلدهای نام کاربری/ایمیل ثبت‌نام (تکراری بودن، در دسترس بودن، در حال بررسی) */
.emdad-field-msg {
	display: none;
	font-size: 12px;
	margin: -4px 0 2px;
}
.emdad-field-msg.emdad-field-msg-error {
	display: block;
	color: #b32d2e;
}
.emdad-field-msg.emdad-field-msg-ok {
	display: block;
	color: #1a7f37;
}
.emdad-field-msg.emdad-field-msg-checking {
	display: block;
	color: #888;
}
.emdad-tab-content input.emdad-input-error {
	border-color: #b32d2e;
	background: #fff5f5;
}

.emdad-loc-updated {
	color: #1a7f37;
	font-weight: bold;
	font-size: 12px;
}
