.tppnl {
	--nl-bg: #1c1c1c;
	--nl-ink: #f3f1ed;
	--nl-muted: #a9a49c;
	--nl-line: #3b3b3b;
	--nl-red: #da291c;
	--nl-red-dark: #b01e13;
	--nl-field: #262626;
	--nl-chip-bg: #fff;
	--nl-chip-fg: #1c1c1c;
	--nl-panel: #262626;
	--nl-btn2-bg: #fff;
	--nl-btn2-fg: #1c1c1c;
	--nl-btn2-hover: #e9e6e1;
	--nl-error: #ff8a80;
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto 24px;
	padding: 24px;
	background: var(--nl-bg);
	color: var(--nl-ink);
	border-top: 4px solid var(--nl-red);
	border-radius: 0 0 6px 6px;
	font-size: 16px;
	line-height: 1.5;
}
.tppnl *, .tppnl *::before, .tppnl *::after { box-sizing: border-box; }

.tppnl .tppnl-field { margin: 0 0 22px; }
.tppnl .tppnl-label {
	display: block;
	margin: 0 0 8px;
	font-weight: 700;
	font-size: 15px;
	color: var(--nl-ink);
}
.tppnl .tppnl-hint {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	color: var(--nl-muted);
}

/* Period selector */
.tppnl .tppnl-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.tppnl .tppnl-periods button {
	margin: 0;
	padding: 8px 14px;
	border: 1px solid var(--nl-line);
	border-radius: 999px;
	background: transparent;
	color: var(--nl-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
}
.tppnl .tppnl-periods button:hover { border-color: var(--nl-muted); }
.tppnl .tppnl-periods button[aria-checked="true"] {
	background: var(--nl-red);
	border-color: var(--nl-red);
	color: #fff;
	font-weight: 700;
}

.tppnl .tppnl-range {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin-top: 12px;
}
.tppnl .tppnl-range[hidden] { display: none; }
.tppnl .tppnl-range label { font-size: 14px; color: var(--nl-muted); display: flex; flex-direction: column; gap: 4px; }
.tppnl .tppnl-range .tppnl-hint { margin: 0 0 8px; }
.tppnl input[type="date"],
.tppnl .tppnl-input {
	margin: 0;
	padding: 9px 12px;
	border: 1px solid var(--nl-line);
	border-radius: 4px;
	background: var(--nl-field);
	color: var(--nl-ink);
	font: inherit;
	font-size: 15px;
	color-scheme: dark;
}

/* Topics */
.tppnl .tppnl-topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border: 1px solid var(--nl-line);
	border-radius: 4px;
	background: var(--nl-field);
}
.tppnl .tppnl-topics:focus-within { border-color: var(--nl-muted); }
.tppnl .tppnl-chips { display: contents; list-style: none; margin: 0; padding: 0; }
.tppnl .tppnl-chips li {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 4px 4px 4px 10px;
	background: var(--nl-chip-bg);
	color: var(--nl-chip-fg);
	border-radius: 3px;
	font-size: 14px;
	font-weight: 700;
}
.tppnl .tppnl-chips button {
	margin: 0;
	padding: 0 6px;
	border: 0;
	background: transparent;
	color: var(--nl-chip-fg);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.tppnl .tppnl-combo { position: relative; flex: 1 1 220px; }
.tppnl .tppnl-input { width: 100%; border: 0; background: transparent; padding: 6px; }
.tppnl .tppnl-input:focus { outline: none; }

.tppnl .tppnl-suggest {
	position: absolute;
	z-index: 50;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	color: #1c1c1c;
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
	max-height: 300px;
	overflow-y: auto;
}
.tppnl .tppnl-suggest[hidden] { display: none; }
.tppnl .tppnl-suggest li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 15px;
}
.tppnl .tppnl-suggest li small { color: #6d6d6d; font-size: 12px; white-space: nowrap; }
.tppnl .tppnl-suggest li[aria-selected="true"] { background: #f1dcda; }
.tppnl .tppnl-suggest .tppnl-dym { padding: 6px 12px 2px; font-size: 12px; color: #6d6d6d; cursor: default; }
.tppnl .tppnl-suggest .tppnl-none { color: #6d6d6d; cursor: default; }

/* Actions */
.tppnl .tppnl-go,
.tppnl .tppnl-dl {
	margin: 0;
	padding: 12px 22px;
	border: 0;
	border-radius: 4px;
	background: var(--nl-red);
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
}
.tppnl .tppnl-go:hover,
.tppnl .tppnl-dl:hover { background: var(--nl-red-dark); }
.tppnl .tppnl-go[disabled] { opacity: .55; cursor: progress; }
.tppnl .tppnl-dl { background: var(--nl-btn2-bg); color: var(--nl-btn2-fg); }
.tppnl .tppnl-dl:hover { background: var(--nl-btn2-hover); }

.tppnl .tppnl-status { min-height: 1.5em; margin: 14px 0 0; font-size: 14px; color: var(--nl-muted); }
.tppnl .tppnl-status.is-error { color: var(--nl-error); }
.tppnl .tppnl-done {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 10px;
	padding: 16px;
	border-left: 4px solid var(--nl-red);
	background: var(--nl-panel);
}
.tppnl .tppnl-done[hidden] { display: none; }
.tppnl .tppnl-done p { margin: 0; font-weight: 700; }

.tppnl button:focus-visible,
.tppnl input:focus-visible {
	outline: 2px solid var(--nl-ink);
	outline-offset: 2px;
}

@media (max-width: 520px) {
	.tppnl { padding: 18px 14px; }
	.tppnl .tppnl-go, .tppnl .tppnl-dl { width: 100%; }
}

/* Light theme (white background) */
.tppnl.tppnl--light {
	--nl-bg: #fff;
	--nl-ink: #1c1c1c;
	--nl-muted: #666;
	--nl-line: #cfcfcf;
	--nl-field: #fff;
	--nl-chip-bg: #1c1c1c;
	--nl-chip-fg: #fff;
	--nl-panel: #f6f4f1;
	--nl-btn2-bg: #1c1c1c;
	--nl-btn2-fg: #fff;
	--nl-btn2-hover: #000;
	--nl-error: #c0261a;
	border-radius: 0;
}
.tppnl.tppnl--light input[type="date"],
.tppnl.tppnl--light .tppnl-input { color-scheme: light; }
.tppnl.tppnl--light .tppnl-input { background: transparent; }
.tppnl.tppnl--light .tppnl-suggest { border: 1px solid var(--nl-line); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
