/* Media Pick Lab */
.tnt-media-pick-lab-root {
	--tnt-mp-gap: 1rem;
	--tnt-mp-slot: 148px;
	--tnt-mp-accent: #1a5f7a;
	--tnt-mp-ok: #1b7a4a;
	max-width: 1280px;
	margin: 2rem auto 6.5rem;
	padding: 0 1.25rem;
	font-family: var(--wp--preset--font-family--montserrat, Montserrat, sans-serif);
}

.tnt-media-pick-header h1 {
	margin: 0 0 0.35rem;
	font-size: 1.75rem;
}

.tnt-media-pick-progress {
	height: 8px;
	background: #e8e8e8;
	border-radius: 4px;
	margin: 1rem 0 1.5rem;
	overflow: hidden;
}

.tnt-media-pick-progress__bar {
	height: 100%;
	background: var(--tnt-mp-accent);
	transition: width 0.25s ease;
}

.tnt-media-pick-layout {
	display: grid;
	grid-template-columns: minmax(280px, 360px) 1fr;
	gap: 1.5rem;
	align-items: start;
}

@media (max-width: 900px) {
	.tnt-media-pick-layout {
		grid-template-columns: 1fr;
	}

	.tnt-media-pick-lab-root {
		margin-bottom: 8.5rem;
	}
}

.tnt-media-pick-slots h2,
.tnt-media-pick-gallery h2,
.tnt-media-pick-gallery h3 {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
}

.tnt-media-pick-slot-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.65rem;
}

.tnt-media-pick-slot {
	border: 2px dashed #c5c5c5;
	border-radius: 10px;
	padding: 0.55rem 0.65rem;
	cursor: pointer;
	background: #fafafa;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
	outline: none;
}

.tnt-media-pick-slot:focus-visible {
	box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.35);
}

.tnt-media-pick-slot.is-active {
	border-color: var(--tnt-mp-accent);
	border-style: solid;
	background: #f0f7fa;
	box-shadow: 0 0 0 2px rgba(26, 95, 122, 0.2);
}

.tnt-media-pick-slot.is-filled {
	border-style: solid;
	border-color: var(--tnt-mp-ok);
	background: #f6fbf8;
}

.tnt-media-pick-slot.is-drop-target {
	border-color: var(--tnt-mp-accent);
	background: #e3f2f8;
	transform: scale(1.01);
}

.tnt-media-pick-slot__label {
	font-size: 0.8rem;
	font-weight: 700;
	margin-bottom: 0.4rem;
	line-height: 1.25;
}

.tnt-media-pick-slot__preview {
	position: relative;
	min-height: 88px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.03);
	overflow: hidden;
}

.tnt-media-pick-slot__empty {
	color: #888;
	font-size: 0.78rem;
	text-align: center;
	padding: 1.25rem 0.5rem;
	line-height: 1.35;
}

.tnt-media-pick-slot__empty.is-active-hint {
	color: var(--tnt-mp-accent);
	font-weight: 600;
	animation: tnt-mp-pulse 1.4s ease-in-out infinite;
}

@keyframes tnt-mp-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.55;
	}
}

.tnt-media-pick-slot__thumb {
	width: 100%;
	max-height: 120px;
	object-fit: contain;
	display: block;
	padding: 0.25rem;
}

.tnt-media-pick-slot__placeholder {
	font-size: 0.75rem;
	color: #666;
	padding: 1rem;
}

.tnt-media-pick-slot__check {
	position: absolute;
	top: 6px;
	right: 6px;
	line-height: 0;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
	animation: tnt-mp-pop 0.35s ease;
}

@keyframes tnt-mp-pop {
	0% {
		transform: scale(0.5);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.tnt-media-pick-slot__clear {
	position: absolute;
	top: 6px;
	left: 6px;
	width: 1.5rem;
	height: 1.5rem;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.tnt-media-pick-slot__clear:hover {
	background: #a33;
}

.tnt-media-pick-target {
	background: #e8f4f8;
	border: 1px solid #b8d9e6;
	border-radius: 8px;
	padding: 0.65rem 0.85rem;
	margin-bottom: 0.85rem;
	font-size: 0.9rem;
}

.tnt-media-pick-target__label {
	color: #555;
	margin-right: 0.25rem;
}

.tnt-media-pick-candidates,
.tnt-media-pick-library {
	margin-bottom: 1.25rem;
}

.tnt-media-pick-dropzone {
	border: 2px dashed var(--tnt-mp-accent);
	border-radius: 8px;
	padding: 0.75rem;
	margin-bottom: 0.75rem;
	text-align: center;
	font-size: 0.85rem;
	color: #444;
	background: #f0f7fa;
}

.tnt-media-pick-dropzone.is-dragover {
	background: #dceef5;
}

.tnt-media-pick-loading {
	color: #888;
	font-size: 0.85rem;
	margin: 0.5rem 0;
}

.tnt-media-pick-thumb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 0.5rem;
	max-height: 320px;
	overflow-y: auto;
	padding: 0.25rem;
}

.tnt-media-pick-thumb {
	border: 2px solid transparent;
	border-radius: 6px;
	padding: 0;
	background: #eee;
	cursor: grab;
	overflow: hidden;
	aspect-ratio: 1;
	position: relative;
}

.tnt-media-pick-thumb:active {
	cursor: grabbing;
}

.tnt-media-pick-thumb:hover,
.tnt-media-pick-thumb:focus {
	border-color: var(--tnt-mp-accent);
}

.tnt-media-pick-thumb.is-just-assigned {
	border-color: var(--tnt-mp-ok);
	box-shadow: 0 0 0 2px rgba(27, 122, 74, 0.35);
}

.tnt-media-pick-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.tnt-media-pick-thumb.is-video::after {
	content: '▶';
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	color: #fff;
	background: rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

/* Floating bottom toolbar */
.tnt-media-pick-toolbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99990;
	background: #fff;
	border-top: 1px solid #ddd;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
	transform: translateY(0);
	transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.tnt-media-pick-toolbar.is-ready {
	border-top-color: var(--tnt-mp-ok);
	box-shadow: 0 -6px 32px rgba(27, 122, 74, 0.22);
}

.tnt-media-pick-toolbar__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0.75rem 1.25rem;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 1rem 1.5rem;
	align-items: center;
}

@media (max-width: 768px) {
	.tnt-media-pick-toolbar__inner {
		grid-template-columns: 1fr;
	}
}

.tnt-media-pick-toolbar__title {
	font-weight: 700;
	font-size: 0.9rem;
	margin-bottom: 0.15rem;
}

.tnt-media-pick-toolbar__counts {
	font-size: 0.8rem;
	color: #555;
	margin-bottom: 0.35rem;
}

.tnt-media-pick-toolbar__bar {
	height: 6px;
	background: #e8e8e8;
	border-radius: 3px;
	overflow: hidden;
	max-width: 280px;
}

.tnt-media-pick-toolbar__bar-fill {
	height: 100%;
	background: var(--tnt-mp-accent);
	transition: width 0.25s ease, background 0.25s ease;
}

.tnt-media-pick-toolbar.is-ready .tnt-media-pick-toolbar__bar-fill {
	background: var(--tnt-mp-ok);
}

.tnt-media-pick-toolbar__hint {
	margin: 0.35rem 0 0;
	font-size: 0.78rem;
	color: #666;
	line-height: 1.35;
	max-width: 36rem;
}

.tnt-media-pick-toolbar__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: center;
	justify-content: flex-end;
}

.tnt-media-pick-toolbar__save {
	font-size: 0.78rem;
	min-width: 5.5rem;
	text-align: right;
	color: #666;
}

.tnt-media-pick-toolbar__save.is-pending {
	color: #b45309;
	font-weight: 600;
}

.tnt-media-pick-toolbar__save.is-saving {
	color: #555;
}

.tnt-media-pick-toolbar__save.is-saved {
	color: var(--tnt-mp-ok);
	font-weight: 600;
}

.tnt-media-pick-toolbar__save.is-error {
	color: #a33;
}

.tnt-media-pick-toolbar button,
.tnt-media-pick-toolbar #tnt-mp-lock,
.tnt-media-pick-toolbar #tnt-mp-save-draft,
.tnt-media-pick-toolbar #tnt-mp-prev-section {
	padding: 0.55rem 1.1rem;
	border-radius: 6px;
	border: 1px solid var(--tnt-mp-accent);
	background: var(--tnt-mp-accent);
	color: #fff !important;
	-webkit-text-fill-color: #fff;
	font-weight: 600;
	cursor: pointer;
	font-size: 0.88rem;
	white-space: nowrap;
	font-family: var(--wp--preset--font-family--montserrat, Montserrat, sans-serif);
}

.tnt-media-pick-toolbar button.is-secondary,
.tnt-media-pick-toolbar #tnt-mp-save-draft {
	background: #fff !important;
	color: var(--tnt-mp-accent) !important;
	-webkit-text-fill-color: var(--tnt-mp-accent);
	border-color: var(--tnt-mp-accent);
}

.tnt-media-pick-toolbar button.is-text,
.tnt-media-pick-toolbar #tnt-mp-prev-section {
	background: transparent !important;
	border-color: transparent;
	color: #555 !important;
	-webkit-text-fill-color: #555;
	font-weight: 500;
}

.tnt-media-pick-toolbar #tnt-mp-lock:disabled {
	opacity: 1;
	cursor: not-allowed;
	background: #e5e5e5 !important;
	border-color: #ccc !important;
	color: #666 !important;
	-webkit-text-fill-color: #666;
}

.tnt-media-pick-toolbar.is-ready #tnt-mp-lock:not(:disabled) {
	background: var(--tnt-mp-ok) !important;
	border-color: #145a38 !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff;
	animation: tnt-mp-glow 2s ease-in-out infinite;
}

.tnt-media-pick-toolbar.is-ready #tnt-mp-lock:not(:disabled):hover,
.tnt-media-pick-toolbar.is-ready #tnt-mp-lock:not(:disabled):focus-visible {
	background: #145a38 !important;
	border-color: #0f452c !important;
	color: #fff !important;
}

@keyframes tnt-mp-glow {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(27, 122, 74, 0.45);
	}
	50% {
		box-shadow: 0 0 0 8px rgba(27, 122, 74, 0);
	}
}

/* Reusable ready-state glow — see natsoffthewall TM #14 for Fluent Form submit */
.tnt-btn-ready-glow {
	animation: tnt-mp-glow 2s ease-in-out infinite;
}

/* Toast */
.tnt-media-pick-toast {
	position: fixed;
	top: 1.25rem;
	right: 1.25rem;
	z-index: 99999;
	max-width: min(22rem, calc(100vw - 2rem));
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: #1a1a1a;
	color: #fff;
	font-size: 0.88rem;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.tnt-media-pick-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.tnt-media-pick-toast.is-ok {
	background: var(--tnt-mp-ok);
}

.tnt-media-pick-toast.is-error {
	background: #b42318;
}

.tnt-media-pick-status {
	padding: 0.75rem 1rem;
	border-radius: 6px;
	margin: 1rem 0;
	font-size: 0.9rem;
}

.tnt-media-pick-status.is-error {
	background: #fde8e8;
	color: #8b1a1a;
}

.tnt-media-pick-status.is-ok {
	background: #e8f5e9;
	color: #1b5e20;
}

.tnt-media-pick-gate {
	max-width: 32rem;
	margin: 3rem auto;
	padding: 1.5rem;
	border: 1px solid #ddd;
	border-radius: 8px;
}

.tnt-media-pick-search {
	width: 100%;
	max-width: 280px;
	margin-bottom: 0.5rem;
	padding: 0.45rem 0.6rem;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.tnt-media-pick-pager {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-top: 0.5rem;
	font-size: 0.85rem;
}

.tnt-media-pick-pager button {
	padding: 0.35rem 0.75rem;
	border-radius: 4px;
	border: 1px solid #ccc;
	background: #fff;
	cursor: pointer;
}
