/* NB Tool: hộp ủng hộ VietQR. Màu theo Cài đặt → Giao diện (biến --nbt-*), không đè CSS của theme ngoài .nbt-ug. */
.nbt-ug {
	--ug-ink: var(--nbt-text, #0f172a);
	--ug-pri: var(--nbt-primary, #1d4ed8);
	--ug-line: var(--nbt-border, #e2e8f0);
	--ug-muted: color-mix(in srgb, var(--ug-ink) 68%, #fff);
	--ug-r: var(--nbt-radius, 12px);
	box-sizing: border-box;
	width: 100%;
	margin: 20px 0;
	padding: 18px 20px;
	border: 1px solid color-mix(in srgb, var(--ug-pri) 22%, var(--ug-line));
	border-radius: var(--ug-r);
	background: color-mix(in srgb, var(--ug-pri) 5%, var(--nbt-card, #fff));
	color: var(--ug-ink);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}
.nbt-ug *, .nbt-ug *::before, .nbt-ug *::after { box-sizing: border-box; }
.nbt-ug [hidden] { display: none !important; }
.nbt-ug p { margin: 0; }
.nbt-ug button, .nbt-ug input { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.nbt-ug button { cursor: pointer; margin: 0; box-shadow: none; }
.nbt-ug button:focus-visible, .nbt-ug input:focus-visible { outline: 3px solid color-mix(in srgb, var(--ug-pri) 55%, #fff); outline-offset: 2px; }
.nbt-ug.is-anim { animation: nbtUgIn .35s ease-out; }
.nbt-ug.is-out { opacity: 0; transition: opacity .25s; }
@keyframes nbtUgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.nbt-ug-head { display: flex; align-items: flex-start; gap: 12px; }
.nbt-ug-ic { flex: 0 0 auto; width: 34px; height: 34px; margin-top: 2px; color: #a0632b; }
.nbt-ug-ic svg { display: block; width: 100%; height: 100%; }
.nbt-ug-msg { flex: 1 1 auto; min-width: 0; color: var(--ug-muted); font-size: 1rem; overflow-wrap: anywhere; }
.nbt-ug-msg b { display: block; margin-bottom: 2px; color: var(--ug-ink); font-size: 1.15rem; line-height: 1.3; font-weight: 800; }
.nbt-ug .nbt-ug-x, .nbt-ug .nbt-ug-x:focus { flex: 0 0 auto; width: 40px; height: 40px; margin: -6px -8px 0 0 !important; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ug-muted); font-size: 1.5rem; line-height: 1; }
.nbt-ug .nbt-ug-x:hover { background: color-mix(in srgb, var(--ug-ink) 8%, transparent); color: var(--ug-ink); }

.nbt-ug-body { margin-top: 14px; padding-left: 46px; }
.nbt-ug-lab { margin-bottom: 8px !important; color: var(--ug-muted); font-size: .9rem; font-weight: 600; }
.nbt-ug-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.nbt-ug-amts { display: flex; flex-wrap: wrap; gap: 8px; }
.nbt-ug .nbt-ug-amts button, .nbt-ug .nbt-ug-amts button:hover, .nbt-ug .nbt-ug-amts button:focus, .nbt-ug .nbt-ug-go, .nbt-ug .nbt-ug-open {
	height: 46px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--ug-ink) 25%, #fff); border-radius: 999px;
	background: #fff; font-size: .95rem; font-weight: 700; white-space: nowrap;
}
.nbt-ug .nbt-ug-amts button:hover { border-color: var(--ug-pri); color: var(--ug-ink); }
.nbt-ug .nbt-ug-amts button[aria-checked="true"], .nbt-ug .nbt-ug-amts button[aria-checked="true"]:hover, .nbt-ug .nbt-ug-amts button[aria-checked="true"]:focus { border-color: var(--ug-pri); background: var(--ug-pri); color: #fff; }
.nbt-ug-other { flex: 1 1 8em; min-width: 0; max-width: 13em; display: flex; align-items: center; height: 46px; margin: 0; border: 1px solid color-mix(in srgb, var(--ug-ink) 25%, #fff); border-radius: 999px; background: #fff; }
.nbt-ug-other.is-on { border-color: var(--ug-pri); box-shadow: inset 0 0 0 1px var(--ug-pri); }
.nbt-ug-other input { flex: 1; width: 0; min-width: 0; height: 100%; margin: 0; padding: 0 4px 0 14px; border: 0 !important; border-radius: 999px; background: transparent; box-shadow: none !important; font-size: .95rem; font-weight: 700; }
.nbt-ug-other input::placeholder { color: color-mix(in srgb, var(--ug-ink) 45%, #fff); font-weight: 500; }
.nbt-ug-other span { padding: 0 14px 0 2px; color: var(--ug-muted); font-weight: 700; }
.nbt-ug .nbt-ug-go, .nbt-ug .nbt-ug-open, .nbt-ug .nbt-ug-go:focus, .nbt-ug .nbt-ug-open:focus { padding: 0 22px; border-color: var(--ug-pri); background: var(--ug-pri); color: #fff; }
.nbt-ug .nbt-ug-go:hover, .nbt-ug .nbt-ug-open:hover { border-color: var(--ug-pri); background: var(--ug-pri); color: #fff; filter: brightness(1.08); }
.nbt-ug-err { margin-top: 8px !important; color: var(--nbt-danger, #b91c1c); font-size: .92rem; font-weight: 600; }

.nbt-ug-pay { display: grid; gap: 18px; margin-top: 14px; padding: 16px; border: 1px solid var(--ug-line); border-radius: calc(var(--ug-r) * .75); background: #fff; }
.nbt-ug-qrw { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nbt-ug-qrw img { display: block; width: 200px; height: 200px; max-width: 100%; image-rendering: pixelated; }
.nbt-ug-qrcap { color: var(--ug-muted); font-size: .85rem; text-align: center; }
.nbt-ug-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; border-top: 1px solid var(--ug-line); font-size: .95rem; }
.nbt-ug-dl dt, .nbt-ug-dl dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--ug-line); }
.nbt-ug-dl dt { padding-right: 16px; color: var(--ug-muted); font-weight: 400; white-space: nowrap; }
.nbt-ug-dl dd { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; font-weight: 700; text-align: right; }
.nbt-ug-dl dd b { overflow-wrap: anywhere; }
.nbt-ug-amt { color: var(--ug-pri); }
.nbt-ug .nbt-ug-copy, .nbt-ug .nbt-ug-copy:hover, .nbt-ug .nbt-ug-copy:focus { flex: 0 0 auto; min-height: 32px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--ug-ink) 25%, #fff); border-radius: 999px; background: #fff; color: var(--ug-pri); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.nbt-ug-mob { margin-top: 10px !important; color: var(--ug-muted); font-size: .88rem; }
.nbt-ug-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; }
.nbt-ug .nbt-ug-btn2, .nbt-ug .nbt-ug-btn2:hover, .nbt-ug .nbt-ug-btn2:focus { min-height: 42px; padding: 0 16px; border: 1.5px solid var(--ug-pri); border-radius: 999px; background: #fff; color: var(--ug-pri); font-size: .95rem; font-weight: 700; white-space: nowrap; }
.nbt-ug .nbt-ug-link, .nbt-ug .nbt-ug-link:hover, .nbt-ug .nbt-ug-link:focus { padding: 8px 0; border: 0; background: none; color: var(--ug-muted); font-size: .92rem; text-decoration: underline; white-space: nowrap; }
.nbt-ug-st { min-height: 1.35em; margin-top: 6px !important; color: var(--nbt-success, #15803d); font-size: .9rem; font-weight: 600; }
.nbt-ug-note { margin-top: 10px !important; color: var(--ug-muted); font-size: .8rem; }
.nbt-ug-thanks { margin-top: 10px !important; color: color-mix(in srgb, var(--nbt-success, #15803d) 80%, #000); font-size: .95rem; font-weight: 600; }

/* Rộng: QR bên trái, thông tin bên phải. Theo bề rộng của chính hộp, không theo màn hình. */
.nbt-ug { container-type: inline-size; }
@container (min-width: 640px) {
	.nbt-ug-pay { grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; max-width: 860px; }
}

/* Thanh nổi ở đáy màn hình: gọn, bấm "Ủng hộ" thì mở rộng. */
.nbt-ug--float {
	position: fixed; z-index: 99990; left: 50%; bottom: 12px; transform: translateX(-50%);
	width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 24px); margin: 0; padding: 12px 14px;
	overflow: auto; overscroll-behavior: contain;
	background: var(--nbt-card, #fff); box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}
.nbt-ug--float.is-anim { animation: nbtUgUp .35s ease-out; }
@keyframes nbtUgUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.nbt-ug--float .nbt-ug-head { align-items: center; }
.nbt-ug--float .nbt-ug-ic { width: 28px; height: 28px; margin: 0; }
.nbt-ug--float .nbt-ug-msg b { margin: 0; font-size: 1rem; }
.nbt-ug-lead { margin: 4px 0 12px !important; color: var(--ug-muted); }
.nbt-ug--float .nbt-ug-open, .nbt-ug--float .nbt-ug-open:hover, .nbt-ug--float .nbt-ug-open:focus { height: 40px; padding: 0 18px; }
.nbt-ug--float .nbt-ug-x, .nbt-ug--float .nbt-ug-x:focus { margin: 0 -6px 0 0 !important; }
.nbt-ug--float .nbt-ug-body { padding-left: 0; }
/* Mở rộng trên màn hình thấp: phần đầu (tiêu đề, Thu gọn, ×) dính trên cùng khi cuộn trong hộp. */
.nbt-ug--float.is-open .nbt-ug-head { position: sticky; top: -12px; z-index: 1; margin: -12px -14px 0; padding: 12px 14px 10px; background: var(--nbt-card, #fff); border-bottom: 1px solid var(--ug-line); }

/* Thanh nổi gọn khi hộp hiện ra ngoài màn hình (bấm "Ủng hộ" để cuộn tới hộp); chừa chỗ ở đáy trang để không che nút. */
.nbt-ug-peek { padding: 10px 14px; }
html.nbt-ug-peek-on body { padding-bottom: 84px; }

@media (max-width: 520px) {
	.nbt-ug { padding: 16px 14px; }
	.nbt-ug-body { padding-left: 0; }
	.nbt-ug-ic { width: 28px; height: 28px; }
	.nbt-ug-msg b { font-size: 1.05rem; }
	.nbt-ug-pay { padding: 14px; }
	.nbt-ug-dl { grid-template-columns: 1fr; }
	.nbt-ug-dl dt { padding: 8px 0 0; border-bottom: 0; font-size: .85rem; }
	.nbt-ug-dl dd { justify-content: space-between; padding-top: 2px; text-align: left; }
	.nbt-ug-amts { flex: 1 1 100%; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
	.nbt-ug-amts.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-ug .nbt-ug-amts button { padding: 0 6px; font-size: .9rem; }
	.nbt-ug-other { flex: 1 1 0; max-width: none; }
	.nbt-ug-go { flex: 0 0 auto; }
	.nbt-ug--float { bottom: 0; width: 100%; border-radius: var(--nbt-radius, 12px) var(--nbt-radius, 12px) 0 0; }
	.nbt-ug--float .nbt-ug-msg b { font-size: .95rem; }
	.nbt-ug--float .nbt-ug-open, .nbt-ug--float .nbt-ug-open:hover, .nbt-ug--float .nbt-ug-open:focus { height: 38px; font-size: .9rem; }
	.nbt-ug--float .nbt-ug-open, .nbt-ug--float .nbt-ug-open:hover, .nbt-ug--float .nbt-ug-open:focus { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.nbt-ug.is-anim, .nbt-ug--float.is-anim { animation: none; }
	.nbt-ug.is-out { transition: none; }
}
