/* QTW News Filters Plus 1.0.0 - several sources and subjects, subject suggestions, phone/tablet button bar. */

/* ---------- Filters panel: tick lists ---------- */
.qtw-nfp-group {
	border: 0;
	margin: 0 0 25px;
	padding: 0;
	min-width: 0;
}
.qtw-nfp-group legend {
	display: block;
	margin-bottom: 8px;
	padding: 0;
	font-weight: 600;
	color: var(--text-light, #f0f0f0);
}
.qtw-nfp-hint {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: #b8b8b8;
}
.qtw-nfp-list {
	max-height: 210px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--bg-dark, #0a0a0a);
	border: 1px solid var(--border-color, #333);
	border-radius: 6px;
	padding: 4px 0;
}
.qtw-nfp-list--tall {
	max-height: 260px;
}
.filter-group .qtw-nfp-item,
.qtw-nfp-item {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	min-height: 40px;
	padding: 4px 10px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--text-light, #f0f0f0);
	cursor: pointer;
}
.qtw-nfp-item:hover {
	background: #1a1a1a;
}
.qtw-nfp-item input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: #00c853;
}
.qtw-nfp-item[hidden] {
	display: none;
}
.qtw-nfp-none {
	margin: 0;
	padding: 8px 10px;
	color: #b8b8b8;
}
.qtw-nfp-search {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 6px;
	padding: 9px 10px;
	background: #1e1e1e;
	border: 1px solid #444;
	border-radius: 8px;
	color: #f0f0f0;
	font-size: 16px;
}
.qtw-nfp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 6px;
}
.qtw-nfp-chips:empty {
	display: none;
}
.qtw-nfp-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	padding: 2px 4px 2px 10px;
	background: #0f2a18;
	border: 1px solid #00c853;
	border-radius: 16px;
	color: #e8ffe8;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
}
.qtw-nfp-chip span[aria-hidden] {
	display: inline-block;
	min-width: 24px;
	text-align: center;
	font-size: 16px;
	color: #00e05f;
}
.qtw-nfp-clear,
.qtw-nfp-suggest-open,
.qtw-nfp-suggest-send {
	margin-top: 6px;
	min-height: 40px;
	padding: 6px 12px;
	background: none;
	border: 1px solid #555;
	border-radius: 20px;
	color: #e0e0e0;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.qtw-nfp-clear:hover,
.qtw-nfp-suggest-open:hover {
	border-color: #00c853;
	color: #fff;
}
.qtw-nfp-suggest {
	margin-top: 8px;
}
.qtw-nfp-suggest-signin {
	display: inline-block;
	padding: 8px 0;
	color: #00e05f;
	font-size: 14px;
}
.qtw-nfp-suggest-box {
	margin-top: 8px;
	padding: 10px;
	background: #111;
	border: 1px solid #333;
	border-radius: 8px;
}
.qtw-nfp-suggest-box[hidden] {
	display: none;
}
.filter-group .qtw-nfp-suggest-box label {
	margin: 0 0 4px;
	font-size: 14px;
}
.qtw-nfp-suggest-box input,
.qtw-nfp-suggest-box textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 8px;
	padding: 8px 10px;
	background: #1e1e1e;
	border: 1px solid #444;
	border-radius: 8px;
	color: #f0f0f0;
	font: inherit;
	font-size: 16px;
}
.qtw-nfp-suggest-send {
	background: #00c853;
	border-color: #00c853;
	color: #0a0a0a;
	font-weight: 700;
}
.qtw-nfp-suggest-send[disabled] {
	opacity: .6;
	cursor: wait;
}
.qtw-nfp-suggest-msg {
	margin: 8px 0 0;
	font-size: 14px;
	color: #e0e0e0;
}
.qtw-nfp-suggest-msg:empty {
	display: none;
}
.qtw-nfp-suggest-msg.is-error {
	color: #ff8a80;
}

/* ---------- Phone and tablet: one bar at the bottom for the floating buttons ---------- */
.qtw-dock {
	display: none;
}
@media (max-width: 1199px) {
	body.qtw-docked {
		padding-bottom: calc(var(--qtw-dock-h, 60px) + env(safe-area-inset-bottom, 0px));
	}
	body.qtw-docked .qtw-dock {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 140; /* above the sticky header (100), below the open Filters panel (150) */
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
		background: rgba(10, 10, 10, .97);
		border-top: 1px solid #00c853;
		box-shadow: 0 -4px 14px rgba(0, 0, 0, .5);
		overflow-x: auto;
		overflow-y: visible;
		scrollbar-width: none;
	}
	body.qtw-docked .qtw-dock::-webkit-scrollbar {
		display: none;
	}
	/* The buttons stop floating and share the bar. */
	body.qtw-docked .qtw-dock > .filter-toggle,
	body.qtw-docked .qtw-dock > #qtw-loc-picker,
	body.qtw-docked .qtw-dock > #qtw-nl-launch,
	body.qtw-docked .qtw-dock > #qtw-aih-bubble {
		position: static !important;
		inset: auto !important;
		margin: 0 !important;
		flex: 1 1 0;
		min-width: 0;
		max-width: 260px;
		transform: none !important;
		box-shadow: none !important;
	}
	body.qtw-docked .qtw-dock > #qtw-aih-bubble[hidden] {
		display: none;
	}
	body.qtw-docked .qtw-dock > .filter-toggle,
	body.qtw-docked .qtw-dock > #qtw-nl-launch,
	body.qtw-docked .qtw-dock > #qtw-aih-bubble,
	body.qtw-docked .qtw-dock #qtw-lp-trigger {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 4px;
		width: 100%;
		min-height: 44px;
		height: 44px;
		padding: 0 8px !important;
		border-radius: 22px;
		font-size: 14px !important;
		line-height: 1.1;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		box-sizing: border-box;
	}
	body.qtw-docked .qtw-dock #qtw-lp-trigger #qtw-lp-current {
		overflow: hidden;
		text-overflow: ellipsis;
	}
	/* The region list opens upward from the bar, not under it. */
	body.qtw-docked .qtw-dock #qtw-loc-picker .qtw-lp-panel {
		position: fixed !important;
		top: auto !important;
		left: 8px !important;
		right: 8px !important;
		bottom: calc(var(--qtw-dock-h, 60px) + 8px + env(safe-area-inset-bottom, 0px)) !important;
		width: auto !important;
		max-width: 420px;
		margin-left: auto;
		max-height: calc(100svh - var(--qtw-dock-h, 60px) - 90px) !important;
	}
	/* The guide's chat window opens above the bar. */
	body.qtw-docked .qtw-aih {
		bottom: calc(var(--qtw-dock-h, 60px) + 8px + env(safe-area-inset-bottom, 0px)) !important;
		max-height: calc(100svh - var(--qtw-dock-h, 60px) - 24px) !important;
	}
}
/* Phones: the header scrolls away instead of holding the top of the screen; the bar keeps the tools in reach. */
@media (max-width: 768px) {
	body.qtw-docked .site-header {
		position: static;
	}
}

/* Apply Filters stays in reach at the bottom of the panel, however long the lists are. */
#filter-form > button[type="submit"] {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: block;
	width: 100%;
	min-height: 48px;
	margin-top: 8px;
	background: #00c853;
	border: 0;
	border-radius: 24px;
	box-shadow: 0 -10px 14px var(--bg-card, #141414);
	color: #0a0a0a;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
#filter-form > button[type="submit"]:hover {
	background: #00e05f;
}
