/* DSA Emergency Bot – מרכז כירורגי שוורץ-ארד */
:root {
	--dsa-eb-primary: #163E48;
	--dsa-eb-accent: #BFA06A;
	--dsa-eb-bg: #F7F5F1;
	--dsa-eb-surface: #FFFFFF;
	--dsa-eb-ink: #1E2A2E;
	--dsa-eb-radius: 18px;
	--dsa-eb-font: 'Assistant', 'Heebo', 'Rubik', -apple-system, 'Segoe UI', sans-serif;
}

.dsa-eb, .dsa-eb * { box-sizing: border-box; font-family: var(--dsa-eb-font); }

.dsa-eb-inline .dsa-eb {
	max-width: 480px;
	margin: 0 auto;
	box-shadow: 0 18px 50px rgba(22, 62, 72, .18);
	border-radius: var(--dsa-eb-radius);
}

.dsa-eb {
	direction: rtl;
	background: var(--dsa-eb-bg);
	border-radius: var(--dsa-eb-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 640px;
	max-height: 82vh;
	border: 1px solid rgba(22, 62, 72, .08);
}

/* Header */
.dsa-eb__header {
	background: linear-gradient(135deg, var(--dsa-eb-primary), color-mix(in srgb, var(--dsa-eb-primary) 78%, #000));
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 3px solid var(--dsa-eb-accent);
}
.dsa-eb__avatar {
	width: 44px; height: 44px; border-radius: 50%;
	background: var(--dsa-eb-accent);
	color: var(--dsa-eb-primary);
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 15px; letter-spacing: .5px;
	flex-shrink: 0;
	box-shadow: 0 0 0 2px rgba(255,255,255,.25);
}
.dsa-eb__title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.dsa-eb__subtitle { font-size: 12.5px; opacity: .82; margin-top: 2px; }
.dsa-eb__status {
	margin-inline-start: auto;
	display: flex; align-items: center; gap: 6px;
	font-size: 11.5px; opacity: .9;
}
.dsa-eb__status::before {
	content: ''; width: 8px; height: 8px; border-radius: 50%;
	background: #7BD88F; box-shadow: 0 0 6px #7BD88F;
}

/* Messages area */
.dsa-eb__body {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px 8px;
	scroll-behavior: smooth;
}
.dsa-eb__body::-webkit-scrollbar { width: 6px; }
.dsa-eb__body::-webkit-scrollbar-thumb { background: rgba(22,62,72,.2); border-radius: 3px; }

.dsa-eb-msg {
	max-width: 86%;
	margin-bottom: 10px;
	padding: 11px 15px;
	border-radius: 16px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--dsa-eb-ink);
	white-space: pre-line;
	animation: dsaEbIn .28s ease both;
}
@keyframes dsaEbIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dsa-eb-msg { animation: none; } }

.dsa-eb-msg--bot {
	background: var(--dsa-eb-surface);
	border: 1px solid rgba(22,62,72,.08);
	border-start-start-radius: 4px;
	box-shadow: 0 2px 8px rgba(22,62,72,.05);
}
.dsa-eb-msg--user {
	background: var(--dsa-eb-primary);
	color: #fff;
	margin-inline-start: auto;
	border-start-end-radius: 4px;
}
.dsa-eb-msg--alert {
	background: #FDECEC;
	border: 1px solid #E8B4B4;
	color: #8A2A2A;
	font-weight: 600;
}
.dsa-eb-msg--gold {
	background: color-mix(in srgb, var(--dsa-eb-accent) 14%, #fff);
	border: 1px solid color-mix(in srgb, var(--dsa-eb-accent) 45%, #fff);
}
.dsa-eb-msg b, .dsa-eb-msg strong { color: var(--dsa-eb-primary); }
.dsa-eb-msg--user b, .dsa-eb-msg--user strong { color: var(--dsa-eb-accent); }
.dsa-eb-msg a { color: var(--dsa-eb-primary); font-weight: 700; text-decoration: underline; }

/* Typing indicator */
.dsa-eb-typing { display: inline-flex; gap: 5px; padding: 14px 18px; }
.dsa-eb-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--dsa-eb-accent);
	animation: dsaEbDot 1.1s infinite ease-in-out;
}
.dsa-eb-typing span:nth-child(2) { animation-delay: .15s; }
.dsa-eb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dsaEbDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Choices */
.dsa-eb__choices {
	padding: 6px 16px 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
}
.dsa-eb-choice {
	appearance: none;
	border: 1.5px solid var(--dsa-eb-primary);
	background: var(--dsa-eb-surface);
	color: var(--dsa-eb-primary);
	font-size: 14px;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 999px;
	cursor: pointer;
	transition: background .15s, color .15s, transform .1s;
	font-family: var(--dsa-eb-font);
}
.dsa-eb-choice:hover, .dsa-eb-choice:focus-visible {
	background: var(--dsa-eb-primary);
	color: #fff;
	outline: none;
}
.dsa-eb-choice:active { transform: scale(.97); }
.dsa-eb-choice--accent {
	border-color: var(--dsa-eb-accent);
	background: var(--dsa-eb-accent);
	color: var(--dsa-eb-primary);
}
.dsa-eb-choice--accent:hover, .dsa-eb-choice--accent:focus-visible {
	background: color-mix(in srgb, var(--dsa-eb-accent) 85%, #000);
	color: #fff;
}
.dsa-eb-choice--selected {
	background: var(--dsa-eb-primary);
	color: #fff;
}
.dsa-eb-choice--num { min-width: 42px; padding: 9px 0; text-align: center; }

/* Input row */
.dsa-eb__inputrow {
	display: flex;
	gap: 8px;
	padding: 10px 14px 14px;
	background: var(--dsa-eb-bg);
}
.dsa-eb__input {
	flex: 1;
	border: 1.5px solid rgba(22,62,72,.25);
	border-radius: 999px;
	padding: 11px 18px;
	font-size: 15px;
	font-family: var(--dsa-eb-font);
	background: var(--dsa-eb-surface);
	color: var(--dsa-eb-ink);
	direction: rtl;
}
.dsa-eb__input:focus { outline: none; border-color: var(--dsa-eb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsa-eb-accent) 25%, transparent); }
.dsa-eb__input[type="tel"], .dsa-eb__input[type="email"] { direction: ltr; text-align: right; }
.dsa-eb__send {
	appearance: none;
	border: none;
	background: var(--dsa-eb-primary);
	color: #fff;
	width: 46px; height: 46px;
	border-radius: 50%;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background .15s;
	flex-shrink: 0;
}
.dsa-eb__send:hover { background: var(--dsa-eb-accent); color: var(--dsa-eb-primary); }
.dsa-eb__send svg { transform: scaleX(-1); }

/* Upload */
.dsa-eb-upload { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.dsa-eb-upload label {
	display: flex; align-items: center; gap: 10px;
	border: 1.5px dashed var(--dsa-eb-accent);
	background: var(--dsa-eb-surface);
	border-radius: 12px;
	padding: 11px 14px;
	font-size: 14px;
	font-weight: 600;
	color: var(--dsa-eb-primary);
	cursor: pointer;
	transition: background .15s;
}
.dsa-eb-upload label:hover { background: color-mix(in srgb, var(--dsa-eb-accent) 10%, #fff); }
.dsa-eb-upload label.is-done { border-style: solid; background: color-mix(in srgb, var(--dsa-eb-accent) 16%, #fff); }
.dsa-eb-upload input[type="file"] { display: none; }
.dsa-eb-upload .dsa-eb-upstate { margin-inline-start: auto; font-size: 12.5px; font-weight: 400; opacity: .75; }

/* Error hint */
.dsa-eb__hint { font-size: 12.5px; color: #A33; padding: 0 20px 6px; min-height: 18px; }

/* Footer note */
.dsa-eb__footer {
	text-align: center;
	font-size: 11px;
	color: rgba(22,62,72,.55);
	padding: 6px 10px 10px;
	background: var(--dsa-eb-bg);
}

/* Floating bubble + panel */
.dsa-eb-bubble {
	position: fixed;
	bottom: 24px;
	inset-inline-start: 24px;
	z-index: 99998;
	display: flex; align-items: center; gap: 8px;
	background: var(--dsa-eb-primary, #163E48);
	color: #fff;
	border: 2px solid var(--dsa-eb-accent, #BFA06A);
	border-radius: 999px;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 700;
	font-family: var(--dsa-eb-font);
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(22,62,72,.35);
	transition: transform .15s;
}
.dsa-eb-bubble:hover { transform: translateY(-2px); }
.dsa-eb-panel {
	position: fixed;
	bottom: 90px;
	inset-inline-start: 24px;
	z-index: 99999;
	width: min(400px, calc(100vw - 32px));
	box-shadow: 0 24px 70px rgba(22,62,72,.35);
	border-radius: var(--dsa-eb-radius);
}
@media (max-width: 480px) {
	.dsa-eb-panel { bottom: 84px; inset-inline-start: 16px; inset-inline-end: 16px; width: auto; }
	.dsa-eb { height: 70vh; }
}
