/* ── Screener Panel ──────────────────────────────────── */

.screener-panel {
	margin: 0 0 16px 0;
	border: 1px solid var(--border-light);
	border-radius: 4px;
	background: var(--bg);
}

.screener-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	cursor: pointer;
	user-select: none;
}

.screener-title {
	font-weight: 600;
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.1rem;
}

.screener-summary {
	color: var(--text-secondary);
	font-size: 0.82rem;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.screener-expand {
	background: none;
	border: none;
	color: var(--text-secondary);
	font-size: 0.85rem;
	cursor: pointer;
	transition: transform 0.2s;
	padding: 0 4px;
}

.screener-expand.open {
	transform: rotate(180deg);
}

.screener-body {
	padding: 12px;
	border-top: 1px solid var(--divider);
}

.screener-section {
	margin-bottom: 14px;
}

.screener-section:last-child {
	margin-bottom: 0;
}

.screener-label {
	display: block;
	font-weight: 600;
	font-size: 0.8rem;
	margin-bottom: 6px;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ── Preset buttons ─────────────────────────────────── */

.screener-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.preset-btn {
	background: var(--submit-bg);
	color: var(--text);
	border: 1px solid var(--border-light);
	border-radius: 3px;
	padding: 4px 12px;
	font-size: 0.8rem;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
}

.preset-btn:hover {
	background: var(--submit-hover);
}

/* ── Sort / Filter rows ─────────────────────────────── */

.sort-item,
.filter-item {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 5px;
	padding: 3px 0;
}

.drag-handle {
	cursor: grab;
	color: var(--muted);
	font-size: 1rem;
	padding: 0 2px;
	line-height: 1;
}

.drag-handle:active {
	cursor: grabbing;
}

.sort-field-select,
.filter-field-select,
.filter-op-select {
	background: var(--input-bg);
	color: var(--text);
	border: 1px solid var(--border-light);
	border-radius: 3px;
	padding: 4px 6px;
	font-size: 0.82rem;
	font-family: inherit;
}

.filter-value-input {
	background: var(--input-bg);
	color: var(--text);
	border: 1px solid var(--border-light);
	border-radius: 3px;
	padding: 4px 6px;
	font-size: 0.82rem;
	width: 110px;
	font-family: inherit;
}

.sort-dir-btn {
	background: var(--submit-bg);
	color: var(--text);
	border: 1px solid var(--border-light);
	border-radius: 3px;
	padding: 4px 8px;
	font-size: 0.75rem;
	cursor: pointer;
	min-width: 50px;
	font-family: inherit;
	text-align: center;
}

.sort-dir-btn:hover {
	background: var(--submit-hover);
}

.sort-remove-btn,
.filter-remove-btn {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 1.1rem;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
}

.sort-remove-btn:hover,
.filter-remove-btn:hover {
	color: #e53e3e;
}

.sort-ghost {
	opacity: 0.35;
}

.sort-index {
	color: var(--muted);
	font-size: 0.75rem;
	min-width: 14px;
	text-align: right;
}

/* ── Add / Action buttons ───────────────────────────── */

.screener-add-btn {
	background: none;
	border: 1px dashed var(--border-light);
	border-radius: 3px;
	color: var(--text-secondary);
	padding: 4px 12px;
	font-size: 0.8rem;
	cursor: pointer;
	width: 100%;
	margin-top: 4px;
	font-family: inherit;
}

.screener-add-btn:hover {
	border-color: var(--border-gray);
	color: var(--text);
}

.screener-add-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.screener-actions {
	display: flex;
	gap: 8px;
	padding-top: 10px;
	border-top: 1px solid var(--divider);
	margin-top: 14px;
}

.screener-apply {
	background: var(--text);
	color: var(--bg);
	border: none;
	border-radius: 3px;
	padding: 6px 20px;
	font-size: 0.85rem;
	cursor: pointer;
	font-weight: 600;
	font-family: inherit;
}

.screener-apply:hover {
	opacity: 0.85;
}

.screener-reset {
	background: none;
	border: 1px solid var(--border-light);
	border-radius: 3px;
	padding: 6px 16px;
	font-size: 0.85rem;
	cursor: pointer;
	color: var(--text-secondary);
	font-family: inherit;
}

.screener-reset:hover {
	border-color: var(--border-gray);
	color: var(--text);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 768px) {
	.sort-item,
	.filter-item {
		flex-wrap: wrap;
	}

	.sort-field-select,
	.filter-field-select {
		flex: 1;
		min-width: 120px;
	}

	.filter-value-input {
		flex: 1;
		min-width: 80px;
	}

	.screener-presets {
		gap: 4px;
	}

	.preset-btn {
		font-size: 0.75rem;
		padding: 3px 8px;
	}
}
