.medaid-nevi-wrapper {
	font-family: inherit;
	border: 1px solid #d7dce1;
	padding: 16px;
	border-radius: 12px;
	background-color: #fff;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
	max-width: 720px;
	margin: 0 auto;
}

.medaid-nevi-launch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 999px;
	border: none;
	background: linear-gradient(135deg, #0f172a, #1e293b);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
}

.medaid-nevi-launch:hover,
.medaid-nevi-launch:focus {
	transform: translateY(-1px);
	box-shadow: 0 16px 30px rgba(15, 23, 42, 0.28);
	outline: none;
}

.medaid-nevi-launch:active {
	transform: translateY(0);
	box-shadow: 0 8px 14px rgba(15, 23, 42, 0.25);
}

.medaid-nevi-instance {
	display: inline;
	justify-items: center;
	gap: 18px;
}

.medaid-nevi-instance [data-medaid-launch] {
	width: 100%;
	margin-bottom: 20px;
}

.medaid-nevi-instance.is-awaiting-cf [data-medaid-launch] {
	pointer-events: none;
	opacity: 0.6;
}

.medaid-nevi-activation-hint {
	width: 100%;
	padding: 12px 16px;
	border-radius: 8px;
	background-color: #fff7d6;
	border: 1px solid #ffe69c;
	color: #7c5a00;
	font-size: 0.95rem;
	text-align: center;
}

.medaid-nevi-modal__dialog--map {
	max-width: 960px;
	width: 100%;
	padding: 32px;
}

.medaid-nevi-modal__dialog--map .medaid-nevi-wrapper {
	margin: 0;
	box-shadow: none;
	border: none;
	padding: 0;
	background: transparent;
}

.medaid-nevi-modal__dialog--map .medaid-nevi-toolbar {
	padding: 0 4px;
}

.medaid-nevi-modal__dialog--map .medaid-nevi-stage {
	margin-top: 12px;
}

.medaid-nevi-modal__dialog--map .medaid-nevi-hint {
	margin-top: 16px;
}

.medaid-nevi-toolbar {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.medaid-nevi-side-button {
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid #cbd5e1;
	background-color: #f8fafc;
	color: #0f172a;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
}

.medaid-nevi-side-button.is-active {
	background-color: #0f172a;
	color: #fff;
	border-color: #0f172a;
	box-shadow: 0 6px 12px rgba(15, 23, 42, 0.22);
}

.medaid-nevi-stage {
	position: relative;
	width: 100%;
}

.medaid-nevi-body {
	position: relative;
	overflow: hidden;
	min-height: 420px;
	background-color: #f8fafc;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
}

.medaid-nevi-body-image {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 600px;
	display: block;
	user-select: none;
	pointer-events: none;
}

.medaid-nevi-markers {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.medaid-nevi-marker {
	position: absolute;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: radial-gradient(circle at 30% 30%, #f97316, #c2410c);
	border: 2px solid #fff;
	transform: translate(-50%, -50%);
	cursor: pointer;
	box-shadow: 0 3px 8px rgba(194, 65, 12, 0.45);
	transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
	pointer-events: auto;
}

.medaid-nevi-marker:hover,
.medaid-nevi-marker:focus {
	transform: translate(-50%, -50%) scale(1.15);
	box-shadow: 0 8px 16px rgba(194, 65, 12, 0.5);
	outline: none;
}

.medaid-nevi-hint {
	margin-top: 12px;
	font-size: 0.95rem;
	color: #475569;
	text-align: center;
}

/* Edit-only controls inside form modal (symbol picker + reposition mini-map) */
.medaid-nevi-form__edit-controls[hidden] {
	display: none;
}

.medaid-nevi-form__edit-controls {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 12px;
	margin-bottom: 12px;
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
	background-color: #f8fafc;
}

.medaid-nevi-form__symbols {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.medaid-nevi-form__symbols .medaid-nevi-symbol {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background-color: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.85rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.medaid-nevi-form__symbols .medaid-nevi-symbol:hover {
	border-color: #94a3b8;
}

.medaid-nevi-form__symbols .medaid-nevi-symbol.is-active {
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.medaid-nevi-form__symbols .medaid-nevi-symbol__icon {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: inline-block;
}

.medaid-nevi-form__view-switcher,
.medaid-nevi-view-switcher {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 8px;
}

/* Le viste della mappa (Anteriore, Posteriore...) usano lo stesso stile di quelle della scheda neo. */
.medaid-nevi-form__view-btn,
.medaid-nevi-view-btn {
	padding: 4px 10px;
	font-size: 0.8rem;
	background-color: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	cursor: pointer;
}

.medaid-nevi-view-btn {
	min-height: 32px;
}

.medaid-nevi-form__view-btn.is-active,
.medaid-nevi-view-btn.is-active {
	background-color: #2563eb;
	color: #fff;
	border-color: #2563eb;
}

.medaid-nevi-form__reposition-stage {
	position: relative;
	background-color: #fff;
	border-radius: 8px;
	display: flex;
	justify-content: center;
}

.medaid-nevi-form__reposition-body {
	position: relative;
	width: 100%;
	max-width: 240px;
	cursor: crosshair;
}

.medaid-nevi-form__reposition-body[hidden] {
	display: none;
}

.medaid-nevi-form__reposition-image {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.medaid-nevi-form__reposition-marker {
	position: absolute;
	width: 14px;
	height: 14px;
	transform: translate(-50%, -50%);
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
	pointer-events: none;
	background-color: var(--marker-color, #3b82f6);
	border-radius: 50%;
}

.medaid-nevi-form__reposition-marker[hidden] {
	display: none;
}

/* Quando viene applicata una classe shape (medaid-nevi-marker--<type>),
   manteniamo dimensione e centratura del puntino della mini-mappa. */
.medaid-nevi-form__reposition-marker.medaid-nevi-marker--star,
.medaid-nevi-form__reposition-marker.medaid-nevi-marker--pin {
	width: 14px;
	height: 14px;
}

.medaid-nevi-form__reposition-marker.medaid-nevi-marker--pin {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.medaid-nevi-form__reposition-hint {
	font-size: 0.8rem;
	color: #64748b;
	margin: 6px 0 0;
	text-align: center;
}

/* Sezione "Riposiziona puntino" come <details> collapsibile */
.medaid-nevi-form__reposition[data-reposition-field] {
	margin-bottom: 12px;
}

.medaid-nevi-form__reposition-summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
	color: #1e293b;
	padding: 8px 0;
	user-select: none;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 6px;
}

.medaid-nevi-form__reposition-summary::-webkit-details-marker {
	display: none;
}

.medaid-nevi-form__reposition-summary::before {
	content: '\25B8';
	display: inline-block;
	font-size: 0.85em;
	color: #64748b;
	transition: transform 0.15s ease;
}

.medaid-nevi-form__reposition[open] > .medaid-nevi-form__reposition-summary::before {
	transform: rotate(90deg);
}

.medaid-nevi-modal {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 10000;
}

body.medaid-nevi-modal-open,
body.medaid-nevi-lightbox-open {
	overflow: hidden;
}

body.medaid-nevi-modal-open .medaid-content,
body.medaid-nevi-modal-open .medaid-ops-panel,
body.medaid-nevi-lightbox-open .medaid-content,
body.medaid-nevi-lightbox-open .medaid-ops-panel {
	overflow: visible;
}

.medaid-nevi-modal[hidden] {
	display: none;
}

.medaid-nevi-modal__dialog {
	position: relative;
	background-color: #fff;
	border-radius: 16px;
	padding: 32px;
	max-width: 480px;
	width: 100%;
	max-height: 750px;
	overflow-y: auto;
	overscroll-behavior: contain;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.medaid-nevi-modal__dialog--map {
	max-height: 750px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.medaid-nevi-detail__actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 20px;
}

.medaid-nevi-detail__remove {
	padding: 10px 18px;
	border-radius: 12px;
	border: 1px solid #dc2626;
	background-color: rgba(254, 226, 226, 0.85);
	color: #991b1b;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, box-shadow 0.2s ease,
		color 0.2s ease;
}

.medaid-nevi-detail__remove:hover,
.medaid-nevi-detail__remove:focus {
	background-color: #fee2e2;
	color: #b91c1c;
	box-shadow: 0 10px 24px rgba(220, 38, 38, 0.18);
	outline: none;
}

.medaid-nevi-modal__title {
	margin: 0 0 16px;
	font-size: 1.4rem;
	color: #0f172a;
}

.medaid-nevi-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: none;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: #0f172a;
}

.medaid-nevi-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.medaid-nevi-form__field label {
	font-weight: 600;
	color: #0f172a;
}

.medaid-nevi-form__field input[type="date"],
.medaid-nevi-form__field textarea,
.medaid-nevi-form__field input[type="file"] {
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 1rem;
}

.medaid-nevi-form__field--photo .medaid-nevi-form__file-input {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
}

.medaid-nevi-form__photo-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.medaid-nevi-form__field textarea {
	resize: vertical;
	min-height: 80px;
}

.medaid-nevi-form__actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
}

.medaid-nevi-form.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.medaid-nevi-detail__media {
	position: relative;
	margin-bottom: 16px;
	min-height: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #f8fafc;
	border-radius: 12px;
	overflow: hidden;
}

.medaid-nevi-detail__media img {
	width: 100%;
	height: 300px;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
	background-color: #f8fafc;
}

.medaid-nevi-detail__gallery {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.medaid-nevi-gallery__nav {
	border: 1px solid #cbd5e1;
	background-color: #fff;
	color: #0f172a;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	font-size: 1.3rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.medaid-nevi-gallery__nav:hover,
.medaid-nevi-gallery__nav:focus {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
	outline: none;
}

.medaid-nevi-gallery__nav:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.medaid-nevi-gallery__viewport {
	overflow-x: auto;
	scrollbar-width: thin;
}

.medaid-nevi-gallery__list {
	display: flex;
	gap: 12px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.medaid-nevi-gallery__list.is-disabled {
	opacity: 0.6;
	pointer-events: none;
}

.medaid-nevi-gallery__item {
	position: relative;
	flex: 0 0 auto;
}

.medaid-nevi-gallery__thumb {
	display: block;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 12px;
	background: none;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.medaid-nevi-gallery__thumb img {
	display: block;
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 10px;
}

.medaid-nevi-gallery__item.is-active .medaid-nevi-gallery__thumb {
	border-color: #0ea5e9;
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.medaid-nevi-gallery__remove {
	position: absolute;
	top: 6px;
	right: 6px;
	background-color: rgba(15, 23, 42, 0.85);
	border: none;
	color: #fff;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
}

.medaid-nevi-gallery__remove:hover,
.medaid-nevi-gallery__remove:focus {
	background-color: rgba(14, 165, 233, 0.95);
	outline: none;
}

.medaid-nevi-detail__gallery-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
	margin-bottom: 16px;
}

.medaid-nevi-detail__photo-btn,
.medaid-nevi-detail__add-media {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
}

.medaid-nevi-detail__photo-btn.is-disabled,
.medaid-nevi-detail__add-media.is-disabled {
	opacity: 0.55;
	pointer-events: none;
}

.medaid-nevi-form__photo-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.medaid-nevi-form__photo-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	flex: 1;
	justify-content: center;
	min-width: 0;
}

.medaid-nevi-detail__zoom {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 6px 12px;
	border-radius: 999px;
	border: none;
	background-color: rgba(15, 23, 42, 0.82);
	color: #fff;
	cursor: pointer;
}

.medaid-nevi-detail__meta {
	display: grid;
	gap: 12px;
	margin: 0;
}

.medaid-nevi-detail__meta dt {
	font-weight: 600;
	color: #0f172a;
}

.medaid-nevi-detail__meta dd {
	margin: 0;
	color: #1e293b;
}

.medaid-nevi-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	z-index: 15000;
}

.medaid-nevi-lightbox[hidden] {
	display: none;
}

.medaid-nevi-lightbox img {
	max-height: 90vh;
	max-width: 90vw;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.4);
	border-radius: 12px;
}

.medaid-nevi-lightbox__close {
	position: fixed;
	top: 24px;
	right: 24px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
}

.medaid-nevi-error {
	padding: 16px;
	border-radius: 12px;
	background-color: rgba(220, 38, 38, 0.08);
	color: #b91c1c;
	text-align: center;
	max-width: 230px;
    overflow: hidden;
}

/* Popup mappatura responsive su mobile: full height, scroll solo sul contenuto */
@media (max-width: 768px) {
	.medaid-nevi-modal {
		align-items: stretch;
		padding: 0;
		height: 100dvh;
		height: 100vh;
		max-height: 100dvh;
		max-height: 100vh;
		overflow: hidden;
	}

	.medaid-nevi-modal__dialog--map {
		display: flex;
		flex-direction: column;
		max-height: none;
		height: 100%;
		min-height: 0;
		padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
		border-radius: 0;
		overflow: hidden;
	}

	.medaid-nevi-modal__dialog--map .medaid-nevi-modal__title {
		flex-shrink: 0;
	}

	.medaid-nevi-modal__dialog--map .medaid-nevi-wrapper {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		overflow-x: hidden;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		padding: 12px 0 calc(24px + env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 768px) {
	.medaid-nevi-modal--form .medaid-nevi-modal__dialog {
		padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px));
	}

	.medaid-nevi-form__actions {
		margin-bottom: 35px;
	}
}

@media (max-width: 640px) {
	.medaid-nevi-wrapper {
		padding: 12px;
	}

	.medaid-nevi-modal__dialog--map {
		padding: 24px 16px;
	}

	.medaid-nevi-modal__dialog {
		padding: 24px 18px;
	}

	.medaid-nevi-modal--form .medaid-nevi-modal__dialog {
		padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px));
	}

	.medaid-nevi-toolbar {
		flex-wrap: wrap;
		justify-content: center;
	}

	.medaid-nevi-modal__dialog--map .medaid-nevi-wrapper {
		padding: 12px 0 calc(24px + env(safe-area-inset-bottom, 0px));
	}
}

/* =========================================================================
   MARKER SYMBOL TYPES
   ========================================================================= */

.medaid-nevi-marker {
	--marker-color: #3b82f6;
	--marker-color-dark: #1d4ed8;
}

.medaid-nevi-marker--circle { border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--marker-color), var(--marker-color-dark)); }

.medaid-nevi-marker--cross {
	border-radius: 0;
	background: var(--marker-color);
	clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.medaid-nevi-marker--donut {
	border-radius: 50%;
	background: transparent !important;
	border: 3px solid var(--marker-color);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.medaid-nevi-marker--square { border-radius: 2px; background: var(--marker-color); }

.medaid-nevi-marker--triangle {
	border-radius: 0;
	background: var(--marker-color);
	clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.medaid-nevi-marker--star {
	border-radius: 0;
	background: var(--marker-color);
	width: 18px; height: 18px;
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.medaid-nevi-marker--diamond {
	border-radius: 0;
	background: var(--marker-color);
	clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.medaid-nevi-marker--hexagon {
	border-radius: 0;
	background: var(--marker-color);
	clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.medaid-nevi-marker--heart {
	border-radius: 0;
	background: var(--marker-color);
	clip-path: polygon(50% 15%, 61% 0, 80% 0, 100% 20%, 100% 40%, 50% 100%, 0 40%, 0 20%, 20% 0, 39% 0);
}

.medaid-nevi-marker--pin {
	border-radius: 50% 50% 50% 0;
	background: var(--marker-color);
	transform: rotate(-45deg);
}

/* =========================================================================
   TOOLBAR - SYMBOL SELECTION
   ========================================================================= */

.medaid-nevi-toolbar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding: 12px 16px; background-color: #f8fafc;
	border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap;
}.medaid-nevi-symbols { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.medaid-nevi-symbol {
	position: relative; display: inline-flex; flex-direction: column; align-items: center;
	gap: 4px; padding: 8px 12px; border: 2px solid transparent; border-radius: 10px;
	background-color: #fff; cursor: pointer; transition: all 0.2s ease; min-width: 60px;
}

.medaid-nevi-symbol:hover { background-color: #f1f5f9; border-color: #cbd5e1; }

.medaid-nevi-symbol.is-active {
	border-color: #3b82f6; background-color: #eff6ff;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.medaid-nevi-symbol__icon {
	display: block; width: 20px; height: 20px; border: 2px solid #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.medaid-nevi-symbol--circle .medaid-nevi-symbol__icon { border-radius: 50%; }
.medaid-nevi-symbol--cross .medaid-nevi-symbol__icon { border-radius: 0; clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%); border: none; }
.medaid-nevi-symbol--donut .medaid-nevi-symbol__icon { border-radius: 50%; background: transparent !important; border: 3px solid currentColor; box-shadow: none; }
.medaid-nevi-symbol--square .medaid-nevi-symbol__icon { border-radius: 2px; }
.medaid-nevi-symbol--triangle .medaid-nevi-symbol__icon { border-radius: 0; clip-path: polygon(50% 0%, 100% 100%, 0% 100%); border: none; }
.medaid-nevi-symbol--star .medaid-nevi-symbol__icon { border-radius: 0; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: none; }
.medaid-nevi-symbol--diamond .medaid-nevi-symbol__icon { border-radius: 0; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); border: none; }
.medaid-nevi-symbol--hexagon .medaid-nevi-symbol__icon { border-radius: 0; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); border: none; }
.medaid-nevi-symbol--heart .medaid-nevi-symbol__icon { border-radius: 0; clip-path: polygon(50% 15%, 61% 0, 80% 0, 100% 20%, 100% 40%, 50% 100%, 0 40%, 0 20%, 20% 0, 39% 0); border: none; }
.medaid-nevi-symbol--pin .medaid-nevi-symbol__icon { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: none; }

/* Symbol icon variants - direct class on icon (for form modal) */
.medaid-nevi-symbol__icon.medaid-nevi-symbol--circle { border-radius: 50%; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--cross { border-radius: 0; clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%); border: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--donut { border-radius: 50%; background: transparent !important; border: 3px solid currentColor; box-shadow: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--square { border-radius: 2px; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--triangle { border-radius: 0; clip-path: polygon(50% 0%, 100% 100%, 0% 100%); border: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--star { border-radius: 0; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--diamond { border-radius: 0; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); border: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--hexagon { border-radius: 0; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); border: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--heart { border-radius: 0; clip-path: polygon(50% 15%, 61% 0, 80% 0, 100% 20%, 100% 40%, 50% 100%, 0 40%, 0 20%, 20% 0, 39% 0); border: none; }
.medaid-nevi-symbol__icon.medaid-nevi-symbol--pin { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: none; }

.medaid-nevi-symbol__label { font-size: 0.75rem; color: #64748b; white-space: nowrap; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
.medaid-nevi-symbol.is-active .medaid-nevi-symbol__label { color: #1e40af; font-weight: 600; }

.medaid-nevi-add-generic {
	display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
	border: 1px dashed #94a3b8; border-radius: 10px; background-color: #fff;
	color: #475569; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}

.medaid-nevi-add-generic:hover { border-color: #3b82f6; background-color: #eff6ff; color: #1e40af; }
.medaid-nevi-add-generic svg { width: 18px; height: 18px; }

/* =========================================================================
   GENERIC MAPPINGS LIST
   ========================================================================= */

.medaid-nevi-generic-list { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.medaid-nevi-generic-list__title { font-size: 1rem; font-weight: 600; color: #0f172a; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.medaid-nevi-generic-list__title svg { width: 18px; height: 18px; color: #64748b; }
.medaid-nevi-generic-list__items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

.medaid-nevi-generic-item {
	display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px;
	background-color: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
	cursor: pointer; transition: all 0.2s ease;
}

.medaid-nevi-generic-item:hover { background-color: #f8fafc; border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12); }
.medaid-nevi-generic-item__symbol { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.medaid-nevi-generic-item__content { flex: 1; min-width: 0; }
.medaid-nevi-generic-item__date { font-weight: 600; color: #0f172a; font-size: 0.95rem; }
.medaid-nevi-generic-item__note { color: #64748b; font-size: 0.9rem; line-height: 1.4; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.medaid-nevi-generic-item__media-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px; background-color: #e0f2fe; border-radius: 999px; font-size: 0.75rem; color: #0369a1; }

/* =========================================================================
   BILLING FIELDS
   ========================================================================= */

.medaid-nevi-form__field--billing { padding: 14px; background-color: #fefce8; border: 1px solid #fef08a; border-radius: 10px; margin-bottom: 16px; }
.medaid-nevi-form__field--billing label { color: #854d0e; }
.medaid-nevi-treatment-status { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; width: 100%; background-color: #fff; cursor: pointer; }

.medaid-nevi-services-select { position: relative; }
.medaid-nevi-services-select__trigger { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background-color: #fff; cursor: pointer; min-height: 44px; }
.medaid-nevi-services-select__placeholder { color: #94a3b8; }
.medaid-nevi-services-select__tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.medaid-nevi-services-select__tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background-color: #e0f2fe; border-radius: 999px; font-size: 0.85rem; color: #0369a1; }
.medaid-nevi-services-select__dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background-color: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15); max-height: 250px; overflow-y: auto; z-index: 100; }
.medaid-nevi-services-select__dropdown[hidden] { display: none; }
.medaid-nevi-services-select__search { position: sticky; top: 0; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; background-color: #fff; }
.medaid-nevi-services-select__search input { width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.9rem; }
.medaid-nevi-services-select__options { list-style: none; padding: 8px; margin: 0; }
.medaid-nevi-services-select__option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background-color 0.15s ease; }
.medaid-nevi-services-select__option:hover { background-color: #f1f5f9; }
.medaid-nevi-services-select__option.is-selected { background-color: #eff6ff; }
.medaid-nevi-services-select__option-check { color: transparent; width: 18px; height: 18px; border: 2px solid #cbd5e1; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.medaid-nevi-services-select__option.is-selected .medaid-nevi-services-select__option-check { background-color: #3b82f6; border-color: #3b82f6; color: #fff; }
.medaid-nevi-services-select__option-name { flex: 1; font-size: 0.95rem; color: #0f172a; }
.medaid-nevi-services-select__option-price { font-size: 0.85rem; color: #64748b; }.medaid-nevi-detail__marker-type { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background-color: #f1f5f9; border-radius: 999px; font-size: 0.85rem; color: #475569; margin-bottom: 12px; }

/* =========================================================================
   LOG VIEW STYLES
   ========================================================================= */

.medaid-nevi-log {
	font-family: inherit;
	max-width: 100%;
	margin: 0 auto;
}

.medaid-nevi-log__empty {
	padding: 40px 20px;
	text-align: center;
	background-color: #f8fafc;
	border-radius: 12px;
	color: #64748b;
}

.medaid-nevi-log__entry {
	position: relative;
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 24px;
	padding: 24px;
	margin-bottom: 20px;
	background-color: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
	transition: box-shadow 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.medaid-nevi-log__entry:hover {
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.medaid-nevi-log__actions {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	gap: 6px;
	z-index: 10;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.medaid-nevi-log__entry:hover .medaid-nevi-log__actions {
	opacity: 1;
}

.medaid-nevi-log__delete,
.medaid-nevi-log__edit {
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	color: #94a3b8;
	transition: all 0.2s ease;
}.medaid-nevi-log__edit:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #2563eb;
}

.medaid-nevi-log__delete:hover {
	background: #fef2f2;
	border-color: #fecaca;
	color: #dc2626;
}

.medaid-nevi-log__delete:disabled,
.medaid-nevi-log__edit:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.medaid-nevi-log__delete svg,
.medaid-nevi-log__edit svg {
	width: 16px;
	height: 16px;
}

.medaid-nevi-log__date-column {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding-top: 8px;
	border-right: 2px solid #e2e8f0;
	padding-right: 20px;
}

.medaid-nevi-log__date-day {
	font-size: 2.5rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1;
}

.medaid-nevi-log__date-month {
	font-size: 1rem;
	font-weight: 600;
	color: #3b82f6;
	text-transform: uppercase;
	margin-top: 4px;
}

.medaid-nevi-log__date-year {
	font-size: 0.85rem;
	color: #64748b;
	margin-top: 2px;
}

.medaid-nevi-log__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.medaid-nevi-log__top {
	display: grid;
	grid-template-columns: 1fr 200px;
	gap: 20px;
}

.medaid-nevi-log__photos {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.medaid-nevi-log__photo {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 12px;
	border: 2px solid #e2e8f0;
	cursor: pointer;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.medaid-nevi-log__photo:hover {
	transform: scale(1.05);
	border-color: #3b82f6;
}

.medaid-nevi-log__no-photo {
	color: #94a3b8;
	font-size: 0.9rem;
	font-style: italic;
}

.medaid-nevi-log__body-preview {
	position: relative;
	background-color: #f8fafc;
	border-radius: 12px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 150px;
	gap: 8px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.medaid-nevi-log__body-preview:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Zoom hint */
.medaid-nevi-log__zoom-hint {
	position: absolute;
	top: 8px;
	right: 8px;
	background-color: rgba(15, 23, 42, 0.7);
	color: #fff;
	padding: 4px;
	border-radius: 4px;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.medaid-nevi-log__body-preview:hover .medaid-nevi-log__zoom-hint {
	opacity: 1;
}

.medaid-nevi-log__body-wrapper {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.medaid-nevi-log__body-svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 120px;
}

.medaid-nevi-log__body-marker {
	position: absolute;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--marker-color, #3b82f6);
	border: 2px solid #fff;
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-color, #3b82f6) 30%, transparent), 0 2px 6px color-mix(in srgb, var(--marker-color, #3b82f6) 40%, transparent);
	pointer-events: none;
}

/* Log view marker types */
.medaid-nevi-log__body-marker--circle { border-radius: 50%; }
.medaid-nevi-log__body-marker--cross { border-radius: 0; background: var(--marker-color); clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%); }
.medaid-nevi-log__body-marker--donut { border-radius: 50%; background: transparent !important; border: 2px solid var(--marker-color); box-shadow: none !important; }
.medaid-nevi-log__body-marker--square { border-radius: 2px; }
.medaid-nevi-log__body-marker--triangle { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.medaid-nevi-log__body-marker--star { border-radius: 0; background: var(--marker-color); width: 14px; height: 14px; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.medaid-nevi-log__body-marker--diamond { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.medaid-nevi-log__body-marker--hexagon { border-radius: 0; background: var(--marker-color); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }

.medaid-nevi-log__marker-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-align: center;
	padding: 2px 8px;
	border-radius: 4px;
	background-color: rgba(255, 255, 255, 0.8);
}

.medaid-nevi-log__body-label {
	font-size: 0.7rem;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.medaid-nevi-log__generic-indicator {
	background-color: #f8fafc;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 150px;
}

.medaid-nevi-log__generic-label {
	font-size: 0.85rem;
	color: #64748b;
	font-style: italic;
}

.medaid-nevi-log__note {
	padding: 16px;
	background-color: #f8fafc;
	border-radius: 12px;
	border-left: 4px solid #3b82f6;
	color: #334155;
	line-height: 1.6;
}

.medaid-nevi-log__note:empty {
	display: none;
}

.medaid-nevi-log__note-label {
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 4px;
	display: block;
}

/* Log Lightbox */
.medaid-nevi-log-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	z-index: 15000;
}

.medaid-nevi-log-lightbox[hidden] {
	display: none;
}

.medaid-nevi-log-lightbox img {
	max-height: 90vh;
	max-width: 90vw;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.4);
	border-radius: 12px;
}

.medaid-nevi-log-lightbox__close {
	position: fixed;
	top: 24px;
	right: 24px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
}

/* Preview Lightbox */
.medaid-nevi-log-preview-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.95);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	z-index: 15000;
}

.medaid-nevi-log-preview-lightbox[hidden] {
	display: none;
}

.medaid-nevi-log-preview-lightbox__close {
	position: fixed;
	top: 24px;
	right: 24px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	z-index: 10;
}.medaid-nevi-log-preview-lightbox__content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	background-color: #fff;
	padding: 32px;
	border-radius: 16px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.4);
	max-width: 90vw;
	max-height: 90vh;
}.medaid-nevi-log-preview-lightbox__wrapper {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.medaid-nevi-log-preview-lightbox__svg {
	display: block;
	/* Le sagome SVG hanno solo il viewBox: senza un'altezza esplicita il
	   contenitore a larghezza automatica le riduce a 0x0. La larghezza segue
	   le proporzioni (sagoma stretta: entra anche sui telefoni). */
	height: min(65vh, 560px);
	width: auto;
	max-width: none;
	max-height: none;
}

.medaid-nevi-log-preview-lightbox__marker {
	position: absolute;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--marker-color, #3b82f6);
	border: 3px solid #fff;
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker-color, #3b82f6) 30%, transparent), 0 4px 12px rgba(0, 0, 0, 0.3);
	pointer-events: none;
}

/* Preview lightbox marker types */
.medaid-nevi-log-preview-lightbox__marker--circle { border-radius: 50%; }
.medaid-nevi-log-preview-lightbox__marker--cross { border-radius: 0; background: var(--marker-color); clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%); }
.medaid-nevi-log-preview-lightbox__marker--donut { border-radius: 50%; background: transparent !important; border: 3px solid var(--marker-color); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important; }
.medaid-nevi-log-preview-lightbox__marker--square { border-radius: 3px; background: var(--marker-color); }
.medaid-nevi-log-preview-lightbox__marker--triangle { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.medaid-nevi-log-preview-lightbox__marker--star { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.medaid-nevi-log-preview-lightbox__marker--diamond { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.medaid-nevi-log-preview-lightbox__marker--hexagon { border-radius: 0; background: var(--marker-color); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }

.medaid-nevi-log-preview-lightbox__label {
	font-size: 1.1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 8px 20px;
	border-radius: 8px;
	background-color: #f8fafc;
}

.medaid-nevi-log-preview-lightbox__body-label {
	font-size: 0.85rem;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

@media (max-width: 768px) {
	.medaid-nevi-log__entry {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.medaid-nevi-log__date-column {
		flex-direction: row;
		justify-content: flex-start;
		gap: 12px;
		border-right: none;
		border-bottom: 2px solid #e2e8f0;
		padding-right: 0;
		padding-bottom: 16px;
	}

	.medaid-nevi-log__top {
		grid-template-columns: 1fr;
	}

	.medaid-nevi-log__body-preview {
		order: -1;
	}
}

/* =========================================================================
   EXECUTION STATUS COLORING
   
   Markers with execution_status = 'to_execute' keep their original color
   and receive a translucent red halo.
   Markers with execution_status = 'executed' or no status keep original colors.
   ========================================================================= */

/* Execution status: to_execute - Red circular halo element (works with clip-path markers) */
.medaid-nevi-marker-halo {
	position: absolute;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.35);
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 0;
	animation: medaid-halo-pulse 2s ease-in-out infinite;
}

/* Log preview marker halo */
.medaid-nevi-log__body-marker-halo {
	position: absolute;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.4);
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 0;
}

/* Lightbox preview marker halo */
.medaid-nevi-log-preview-lightbox__marker-halo {
	position: absolute;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.35);
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 0;
}

@keyframes medaid-halo-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* Execution status: executed - Original colors (no override needed) */

/* Execution status badge in log entry */
.medaid-nevi-log__execution-status {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	background-color: #fef2f2;
	border-radius: 10px;
	border-left: 4px solid #ef4444;
}

.medaid-nevi-log__execution-badge {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #dc2626;
}

.medaid-nevi-log__mark-executed {
	margin-left: auto;
	padding: 5px 14px;
	font-size: 0.78rem;
	font-weight: 600;
	color: #fff;
	background-color: #22c55e;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
	white-space: nowrap;
}

.medaid-nevi-log__mark-executed:hover {
	background-color: #16a34a;
}

.medaid-nevi-log__mark-executed:disabled {
	cursor: not-allowed;
}

/* =========================================================================
   PAYMENT STATUS BADGES
   
   Payment status shown as a small badge indicator on the marker.
   Does not interfere with marker icon or execution status coloring.
   ========================================================================= */

.medaid-nevi-marker[data-payment-status]::after {
	content: '';
	position: absolute;
	top: -4px;
	right: -4px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1.5px solid #fff;
	z-index: 11;
}

/* Payment status: none - No badge */
.medaid-nevi-marker[data-payment-status="none"]::after {
	display: none;
}

/* Payment status: accepted - Blue badge */
.medaid-nevi-marker[data-payment-status="accepted"]::after {
	background-color: #3b82f6;
	box-shadow: 0 1px 3px rgba(59, 130, 246, 0.5);
}

/* Payment status: paid - Green badge */
.medaid-nevi-marker[data-payment-status="paid"]::after {
	background-color: #10b981;
	box-shadow: 0 1px 3px rgba(16, 185, 129, 0.5);
}

/* Payment status: cancelled - Gray badge with strikethrough */
.medaid-nevi-marker[data-payment-status="cancelled"]::after {
	background-color: #6b7280;
	box-shadow: 0 1px 3px rgba(107, 114, 128, 0.5);
}

.medaid-nevi-marker[data-payment-status="cancelled"] {
	opacity: 0.6;
}

/* =========================================================================
   STATUS LEGEND (for log view and details)
   ========================================================================= */

.medaid-nevi-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 500;
}

/* Execution status badges */
.medaid-nevi-status-badge--to-execute {
	background-color: #fee2e2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

.medaid-nevi-status-badge--executed {
	background-color: #dcfce7;
	color: #16a34a;
	border: 1px solid #bbf7d0;
}

/* Payment status badges */
.medaid-nevi-status-badge--accepted {
	background-color: #dbeafe;
	color: #2563eb;
	border: 1px solid #bfdbfe;
}

.medaid-nevi-status-badge--paid {
	background-color: #d1fae5;
	color: #059669;
	border: 1px solid #a7f3d0;
}.medaid-nevi-status-badge--cancelled {
	background-color: #f3f4f6;
	color: #6b7280;
	border: 1px solid #e5e7eb;
	text-decoration: line-through;
}

/* Form field hint */
.medaid-nevi-form__hint {
	font-size: 0.75rem;
	color: #64748b;
	margin-top: 4px;
}

/* =========================================================================
   EDIT GALLERY (Form Modal)
   ========================================================================= */

.medaid-nevi-form__edit-gallery label {
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 8px;
	display: block;
}

.medaid-nevi-form__gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 10px;
	margin-bottom: 12px;
}

.medaid-nevi-form__gallery-item {
	position: relative;
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
}

.medaid-nevi-form__gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.medaid-nevi-form__gallery-remove {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.9);
	color: #fff;
	border: none;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
	padding: 0;
}

.medaid-nevi-form__gallery-item:hover .medaid-nevi-form__gallery-remove {
	opacity: 1;
}

.medaid-nevi-form__gallery-remove:hover {
	background: rgba(220, 38, 38, 1);
}

.medaid-nevi-form__gallery-add {
	display: flex;
	align-items: center;
	gap: 8px;
}

.medaid-nevi-form__gallery-empty {
	color: #94a3b8;
	font-size: 0.85rem;
	margin: 0;
	padding: 16px;
	text-align: center;
	background: #f8fafc;
	border-radius: 8px;
	border: 1px dashed #e2e8f0;
	grid-column: 1 / -1;
}

/* =========================================================================
   DARK MODE
   
   Styles for dark theme support.
   ========================================================================= */

html[data-theme="dark"] .medaid-nevi-wrapper {
	background-color: var(--medaid-bg-elevated, #16213e);
	border-color: var(--medaid-border, #0f3460);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-modal__dialog {
	background-color: var(--medaid-bg-elevated, #16213e);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-modal__title {
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-modal__close {
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-form__field label {
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-form__field input[type="date"],
html[data-theme="dark"] .medaid-nevi-form__field input[type="text"],
html[data-theme="dark"] .medaid-nevi-form__field input[type="number"],
html[data-theme="dark"] .medaid-nevi-form__field textarea,
html[data-theme="dark"] .medaid-nevi-form__field select {
	background-color: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
	color: var(--medaid-text, #e9ecef);
}html[data-theme="dark"] .medaid-nevi-form__field input[type="date"]:focus,
html[data-theme="dark"] .medaid-nevi-form__field input[type="text"]:focus,
html[data-theme="dark"] .medaid-nevi-form__field input[type="number"]:focus,
html[data-theme="dark"] .medaid-nevi-form__field textarea:focus,
html[data-theme="dark"] .medaid-nevi-form__field select:focus {
	border-color: var(--medaid-primary, #6366f1);
	outline: none;
}

html[data-theme="dark"] .medaid-nevi-form__hint {
	color: var(--medaid-text-muted, #6c757d);
}

html[data-theme="dark"] .medaid-nevi-form__gallery-item {
	border-color: var(--medaid-border, #0f3460);
	background: var(--medaid-surface, #0f3460);
}

html[data-theme="dark"] .medaid-nevi-form__gallery-empty {
	color: var(--medaid-text-muted, #6c757d);
	background: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
}

html[data-theme="dark"] .medaid-nevi-side-button {
	background-color: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-side-button:hover,
html[data-theme="dark"] .medaid-nevi-side-button:focus,
html[data-theme="dark"] .medaid-nevi-side-button.active {
	background-color: var(--medaid-primary, #6366f1);
	border-color: var(--medaid-primary, #6366f1);
	color: #fff;
}

html[data-theme="dark"] .medaid-nevi-view-switcher__btn,
html[data-theme="dark"] .medaid-nevi-view-btn {
	background-color: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-view-switcher__btn--active,
html[data-theme="dark"] .medaid-nevi-view-btn.is-active {
	background-color: var(--medaid-primary, #6366f1);
	border-color: var(--medaid-primary, #6366f1);
	color: #fff;
}

html[data-theme="dark"] .medaid-nevi-activation-hint {
	background-color: rgba(255, 247, 214, 0.1);
	border-color: rgba(255, 230, 156, 0.3);
	color: #fcd34d;
}

html[data-theme="dark"] .medaid-nevi-symbol-grid__btn {
	background-color: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-symbol-grid__btn:hover,
html[data-theme="dark"] .medaid-nevi-symbol-grid__btn:focus {
	background-color: var(--medaid-bg-elevated, #16213e);
	border-color: var(--medaid-primary, #6366f1);
}

html[data-theme="dark"] .medaid-nevi-detail-card {
	background-color: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
}

html[data-theme="dark"] .medaid-nevi-detail-card__title {
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-detail-card__meta {
	color: var(--medaid-text-muted, #6c757d);
}

/* =========================================================================
   Model Selector (shown only when multiple models available)
   ========================================================================= */

.medaid-nevi-model-selector {
	margin-bottom: 20px;
	padding: 12px 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}

.medaid-nevi-model-selector__current {
	display: flex;
	align-items: center;
	gap: 8px;
}

.medaid-nevi-model-selector__label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #64748b;
}

.medaid-nevi-model-selector__name {
	font-size: 0.85rem;
	font-weight: 500;
	color: #1e293b;
}

.medaid-nevi-model-selector__change {
	width: 28px;
	height: 28px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	cursor: pointer;
	color: #64748b;
	transition: all 0.2s ease;
	margin-left: auto;
}

.medaid-nevi-model-selector__change:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #2563eb;
}

.medaid-nevi-model-selector__options {
	display: flex;
	gap: 12px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e2e8f0;
	flex-wrap: wrap;
}

.medaid-nevi-model-selector__option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #fff;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.medaid-nevi-model-selector__option:hover {
	border-color: #93c5fd;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.medaid-nevi-model-selector__option.is-active {
	border-color: #2563eb;
	background: #eff6ff;
}

.medaid-nevi-model-selector__option-label {
	font-size: 0.8rem;
	font-weight: 500;
	color: #475569;
}

.medaid-nevi-model-selector__check {
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #2563eb;
	color: #fff;
	border-radius: 50%;
	font-size: 0.65rem;
	font-weight: 700;
}/* Dark mode for model selector */
html[data-theme="dark"] .medaid-nevi-model-selector {
	background: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
}html[data-theme="dark"] .medaid-nevi-model-selector__option {
	background: var(--medaid-bg-elevated, #16213e);
	border-color: var(--medaid-border, #0f3460);
}html[data-theme="dark"] .medaid-nevi-model-selector__option.is-active {
	border-color: var(--medaid-primary, #6366f1);
	background: rgba(99, 102, 241, 0.1);
}/* Dark mode for edit/delete buttons */
html[data-theme="dark"] .medaid-nevi-log__edit,
html[data-theme="dark"] .medaid-nevi-log__delete {
	background: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #0f3460);
	color: var(--medaid-text-muted, #6c757d);
}

/* =========================================================================
   LOG VIEW STYLES (storico mappature)
   ========================================================================= */

.medaid-nevi-form.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.medaid-nevi-log {
	font-family: inherit;
	max-width: 100%;
	margin: 0 auto;
}

.medaid-nevi-log__empty {
	padding: 40px 20px;
	text-align: center;
	background-color: #f8fafc;
	border-radius: 12px;
	color: #64748b;
}

.medaid-nevi-log__entry {
	position: relative;
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 24px;
	padding: 24px;
	margin-bottom: 20px;
	background-color: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
	transition: box-shadow 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.medaid-nevi-log__entry:hover {
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.medaid-nevi-log__actions {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	gap: 6px;
	z-index: 10;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.medaid-nevi-log__entry:hover .medaid-nevi-log__actions {
	opacity: 1;
}

.medaid-nevi-log__delete,
.medaid-nevi-log__edit {
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	color: #94a3b8;
	transition: all 0.2s ease;
}

.medaid-nevi-log__edit:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #2563eb;
}

.medaid-nevi-log__delete:hover {
	background: #fef2f2;
	border-color: #fecaca;
	color: #dc2626;
}

.medaid-nevi-log__delete:disabled,
.medaid-nevi-log__edit:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.medaid-nevi-log__delete svg,
.medaid-nevi-log__edit svg {
	width: 16px;
	height: 16px;
}

.medaid-nevi-log__date-column {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding-top: 8px;
	border-right: 2px solid #e2e8f0;
	padding-right: 20px;
}

.medaid-nevi-log__date-day {
	font-size: 2.5rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1;
}

.medaid-nevi-log__date-month {
	font-size: 1rem;
	font-weight: 600;
	color: #3b82f6;
	text-transform: uppercase;
	margin-top: 4px;
}

.medaid-nevi-log__date-year {
	font-size: 0.85rem;
	color: #64748b;
	margin-top: 2px;
}

.medaid-nevi-log__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.medaid-nevi-log__top {
	display: grid;
	grid-template-columns: 1fr 200px;
	gap: 20px;
}

.medaid-nevi-log__photos {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.medaid-nevi-log__photo {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 12px;
	border: 2px solid #e2e8f0;
	cursor: pointer;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.medaid-nevi-log__photo:hover {
	transform: scale(1.05);
	border-color: #3b82f6;
}

.medaid-nevi-log__no-photo {
	color: #94a3b8;
	font-size: 0.9rem;
	font-style: italic;
}

.medaid-nevi-log__body-preview {
	position: relative;
	background-color: #f8fafc;
	border-radius: 12px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 150px;
	gap: 8px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.medaid-nevi-log__body-preview:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.medaid-nevi-log__zoom-hint {
	position: absolute;
	top: 8px;
	right: 8px;
	background-color: rgba(15, 23, 42, 0.7);
	color: #fff;
	padding: 4px;
	border-radius: 4px;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.medaid-nevi-log__body-preview:hover .medaid-nevi-log__zoom-hint {
	opacity: 1;
}

.medaid-nevi-log__body-wrapper {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.medaid-nevi-log__body-svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 120px;
}

.medaid-nevi-log__body-marker {
	position: absolute;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--marker-color, #3b82f6);
	border: 2px solid #fff;
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-color, #3b82f6) 30%, transparent), 0 2px 6px color-mix(in srgb, var(--marker-color, #3b82f6) 40%, transparent);
	pointer-events: none;
}

.medaid-nevi-log__body-marker--circle { border-radius: 50%; }
.medaid-nevi-log__body-marker--cross { border-radius: 0; background: var(--marker-color); clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%); }
.medaid-nevi-log__body-marker--donut { border-radius: 50%; background: transparent !important; border: 2px solid var(--marker-color); box-shadow: none !important; }
.medaid-nevi-log__body-marker--square { border-radius: 2px; }
.medaid-nevi-log__body-marker--triangle { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.medaid-nevi-log__body-marker--star { border-radius: 0; background: var(--marker-color); width: 14px; height: 14px; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.medaid-nevi-log__body-marker--diamond { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.medaid-nevi-log__body-marker--hexagon { border-radius: 0; background: var(--marker-color); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }

.medaid-nevi-log__marker-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-align: center;
	padding: 2px 8px;
	border-radius: 4px;
	background-color: rgba(255, 255, 255, 0.8);
}

.medaid-nevi-log__body-label {
	font-size: 0.7rem;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.medaid-nevi-log__generic-indicator {
	background-color: #f8fafc;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 150px;
}

.medaid-nevi-log__generic-label {
	font-size: 0.85rem;
	color: #64748b;
	font-style: italic;
}

.medaid-nevi-log__note {
	padding: 16px;
	background-color: #f8fafc;
	border-radius: 12px;
	border-left: 4px solid #3b82f6;
	color: #334155;
	line-height: 1.6;
}

.medaid-nevi-log__note:empty {
	display: none;
}

.medaid-nevi-log__note-label {
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 4px;
	display: block;
}

/* Log Lightbox (foto) */
.medaid-nevi-log-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	z-index: 15000;
}

.medaid-nevi-log-lightbox[hidden] {
	display: none;
}

.medaid-nevi-log-lightbox img {
	max-height: 90vh;
	max-width: 90vw;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.4);
	border-radius: 12px;
}

.medaid-nevi-log-lightbox__close {
	position: fixed;
	top: 24px;
	right: 24px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
}

/* Preview Lightbox (sagoma) */
.medaid-nevi-log-preview-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.95);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	z-index: 15000;
}

.medaid-nevi-log-preview-lightbox[hidden] {
	display: none;
}

.medaid-nevi-log-preview-lightbox__close {
	position: fixed;
	top: 24px;
	right: 24px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	z-index: 10;
}

.medaid-nevi-log-preview-lightbox__content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	background-color: #fff;
	padding: 32px;
	border-radius: 16px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.4);
	max-width: 90vw;
	max-height: 90vh;
}

.medaid-nevi-log-preview-lightbox__wrapper {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.medaid-nevi-log-preview-lightbox__svg {
	display: block;
	/* Le sagome SVG hanno solo il viewBox: senza un'altezza esplicita il
	   contenitore a larghezza automatica le riduce a 0x0. La larghezza segue
	   le proporzioni (sagoma stretta: entra anche sui telefoni). */
	height: min(65vh, 560px);
	width: auto;
	max-width: none;
	max-height: none;
}

.medaid-nevi-log-preview-lightbox__marker {
	position: absolute;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--marker-color, #3b82f6);
	border: 3px solid #fff;
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker-color, #3b82f6) 30%, transparent), 0 4px 12px rgba(0, 0, 0, 0.3);
	pointer-events: none;
}

.medaid-nevi-log-preview-lightbox__marker--circle { border-radius: 50%; }
.medaid-nevi-log-preview-lightbox__marker--cross { border-radius: 0; background: var(--marker-color); clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%); }
.medaid-nevi-log-preview-lightbox__marker--donut { border-radius: 50%; background: transparent !important; border: 3px solid var(--marker-color); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important; }
.medaid-nevi-log-preview-lightbox__marker--square { border-radius: 3px; background: var(--marker-color); }
.medaid-nevi-log-preview-lightbox__marker--triangle { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.medaid-nevi-log-preview-lightbox__marker--star { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.medaid-nevi-log-preview-lightbox__marker--diamond { border-radius: 0; background: var(--marker-color); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.medaid-nevi-log-preview-lightbox__marker--hexagon { border-radius: 0; background: var(--marker-color); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }

.medaid-nevi-log-preview-lightbox__label {
	font-size: 1.1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 8px 20px;
	border-radius: 8px;
	background-color: #f8fafc;
}

.medaid-nevi-log-preview-lightbox__body-label {
	font-size: 0.85rem;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

@media (max-width: 768px) {
	.medaid-nevi-log__entry {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.medaid-nevi-log__date-column {
		flex-direction: row;
		justify-content: flex-start;
		gap: 12px;
		border-right: none;
		border-bottom: 2px solid #e2e8f0;
		padding-right: 0;
		padding-bottom: 16px;
	}

	.medaid-nevi-log__top {
		grid-template-columns: 1fr;
	}

	.medaid-nevi-log__body-preview {
		order: -1;
	}
}

/* Live widget marker halo (stage) */
.medaid-nevi-marker-halo {
	position: absolute;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.35);
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 0;
	animation: medaid-nevi-halo-pulse 2s ease-in-out infinite;
}

/* Log preview marker halo */
.medaid-nevi-log__body-marker-halo {
	position: absolute;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.4);
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 0;
}

/* Lightbox preview marker halo */
.medaid-nevi-log-preview-lightbox__marker-halo {
	position: absolute;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.35);
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 0;
}

@keyframes medaid-nevi-halo-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

/* Execution status badge in log entry */
.medaid-nevi-log__execution-status {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	background-color: #fef2f2;
	border-radius: 10px;
	border-left: 4px solid #ef4444;
}

.medaid-nevi-log__execution-badge {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #dc2626;
}

.medaid-nevi-log__mark-executed {
	margin-left: auto;
	padding: 5px 14px;
	font-size: 0.78rem;
	font-weight: 600;
	color: #fff;
	background-color: #22c55e;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
	white-space: nowrap;
}

.medaid-nevi-log__mark-executed:hover {
	background-color: #16a34a;
}

.medaid-nevi-log__mark-executed:disabled {
	cursor: not-allowed;
}

/* =========================================================================
   Galleria allegati (strip orizzontale tra model-selector e log entries)
   ========================================================================= */

.medaid-nevi-log__gallery-section {
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}

.medaid-nevi-log__gallery-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.medaid-nevi-log__gallery-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: #0f172a;
}

.medaid-nevi-log__gallery-count {
	font-size: 0.78rem;
	color: #475569;
	background: #e2e8f0;
	padding: 2px 10px;
	border-radius: 999px;
	font-weight: 500;
}

.medaid-nevi-log__gallery-strip {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 8px;
}

.medaid-nevi-log__gallery-nav {
	border: 1px solid #cbd5e1;
	background-color: #fff;
	color: #0f172a;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	font-size: 1.2rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.medaid-nevi-log__gallery-nav:hover,
.medaid-nevi-log__gallery-nav:focus {
	background-color: #eff6ff;
	border-color: #bfdbfe;
	color: #2563eb;
	outline: none;
}

.medaid-nevi-log__gallery-nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background-color: #fff;
	color: #94a3b8;
	border-color: #e2e8f0;
}

.medaid-nevi-log__gallery-viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.medaid-nevi-log__gallery-viewport::-webkit-scrollbar {
	height: 6px;
}

.medaid-nevi-log__gallery-viewport::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
}

.medaid-nevi-log__gallery-list {
	display: flex;
	gap: 8px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.medaid-nevi-log__gallery-item {
	flex: 0 0 auto;
}

.medaid-nevi-log__gallery-photo {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	cursor: zoom-in;
	border: 1px solid #e2e8f0;
	background: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.medaid-nevi-log__gallery-photo:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
}

/* Dark mode galleria allegati */
html[data-theme="dark"] .medaid-nevi-log__gallery-section {
	background: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #1f4068);
}

html[data-theme="dark"] .medaid-nevi-log__gallery-title {
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-log__gallery-count {
	background: var(--medaid-surface-alt, #1f4068);
	color: var(--medaid-text-muted, #adb5bd);
}

html[data-theme="dark"] .medaid-nevi-log__gallery-nav {
	background-color: var(--medaid-surface, #0f3460);
	border-color: var(--medaid-border, #1f4068);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-log__gallery-nav:hover,
html[data-theme="dark"] .medaid-nevi-log__gallery-nav:focus {
	background-color: rgba(99, 102, 241, 0.18);
	border-color: var(--medaid-primary, #6366f1);
	color: var(--medaid-text, #e9ecef);
}

html[data-theme="dark"] .medaid-nevi-log__gallery-photo {
	border-color: var(--medaid-border, #1f4068);
	background: var(--medaid-surface, #0f3460);
}

 
 