/* TSD Google Fonts Connector - eigenständige Styles, ändern nichts am Hauptplugin-CSS */

/* Trigger-Zeile am Ende der bestehenden Fontliste (Tab "Aa") - bewusst eigene
   Klasse (nicht .tsd-fnt-item), damit der bestehende Klick-Handler des
   Hauptplugins sie nicht als Font-Auswahl interpretiert. */
.tsdgf-more-item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	cursor: pointer;
	border-top: 1px dashed #ddd;
	color: #c2185b;
	font-size: 13px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	min-height: 44px;
	transition: background .1s;
	touch-action: manipulation;
}
.tsdgf-more-item:hover,
.tsdgf-more-item:active { background: #fef6f7; }
.tsdgf-more-item .tsdgf-plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #c2185b;
	color: #fff;
	font-size: 14px;
	line-height: 1;
}

/* Overlay + Modal */
#tsdgf-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	z-index: 999999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
@media (min-width: 769px) {
	#tsdgf-overlay { align-items: center; }
}
#tsdgf-overlay.tsdgf-hidden { display: none; }

#tsdgf-modal {
	background: #fff;
	width: 100%;
	max-width: 480px;
	max-height: 45vh;
	border-radius: 14px 14px 0 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (min-width: 769px) {
	#tsdgf-modal { border-radius: 14px; max-height: 64vh; }
}

/* Kompakter Header - immer sichtbar (flex-shrink:0), Schließen-Button nie
   außerhalb des sichtbaren Bereichs. */
#tsdgf-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 14px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
	min-height: 28px;
}
#tsdgf-modal-header h3 {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	color: #111;
}
#tsdgf-close {
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 2px 6px;
	flex-shrink: 0;
}

#tsdgf-modal-controls {
	padding: 6px 14px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
	display: flex;
	gap: 8px;
}
#tsdgf-search {
	flex: 1;
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 16px;
}
#tsdgf-category {
	padding: 6px 6px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 16px;
	background: #fff;
	max-width: 110px;
}

#tsdgf-list {
	overflow-y: auto;
	flex: 1;
	padding: 4px 0;
	-webkit-overflow-scrolling: touch;
}

.tsdgf-result {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid #f5f5f5;
}
.tsdgf-result-info { flex: 1; min-width: 0; }
.tsdgf-result-preview {
	font-size: 20px;
	color: #222;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tsdgf-result-name {
	font-size: 11px;
	color: #aaa;
}
.tsdgf-add-btn {
	flex-shrink: 0;
	border: none !important;
	background: #c2185b;
	color: #fff;
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	min-height: 30px !important;
	max-width: 30px !important;
	max-height: 30px !important;
	box-sizing: border-box !important;
	border-radius: 50% !important;
	font-size: 16px;
	line-height: 1 !important;
	padding: 0 !important;
	margin: 0 !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	touch-action: manipulation;
}
.tsdgf-add-btn:disabled {
	background: #ccc;
	cursor: default;
}
.tsdgf-add-btn.tsdgf-added { background: #4caf50; }
.tsdgf-add-btn.tsdgf-loading { background: #999; }

/* Plus/Haken als reine CSS-Form statt Textzeichen - Font-Glyphen sitzen
   nie exakt mittig in ihrer Zeichenbox (optischer Versatz je nach
   Font/Theme), das macht diesen Fix pixelgenau und theme-unabhängig. */
.tsdgf-icon {
	position: relative;
	display: block;
	width: 14px;
	height: 14px;
}
.tsdgf-icon-plus::before,
.tsdgf-icon-plus::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
}
.tsdgf-icon-plus::before { width: 14px; height: 2px; transform: translate(-50%, -50%); }
.tsdgf-icon-plus::after { width: 2px; height: 14px; transform: translate(-50%, -50%); }
.tsdgf-icon-check {
	width: 11px;
	height: 6px;
	margin: 2px auto 0;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}

#tsdgf-empty,
#tsdgf-loading-more {
	padding: 24px 14px;
	text-align: center;
	color: #999;
	font-size: 13px;
}

/* Unsichtbarer Sentinel für Infinite Scroll - kein Klick, keine Höhe im
   Layout, wird per IntersectionObserver beobachtet. Löst automatisches
   Nachladen aus, sobald er in den sichtbaren Bereich der Liste kommt. */
#tsdgf-sentinel {
	height: 1px;
}

#tsdgf-error {
	padding: 8px 14px;
	color: #b71c1c;
	font-size: 12px;
	background: #fdeaea;
	display: none;
}
#tsdgf-error.tsdgf-show { display: block; }
