.nks-tp {
	--nks-bg: #e9e9e4;
	--nks-ink: #17171a;
	--nks-muted: #6b6b66;
	--nks-card: #fff;
	--nks-accent: #17171a;
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 24px;
	padding: 24px;
	background: var(--nks-bg);
	border-radius: 16px;
	box-sizing: border-box;
	color: var(--nks-ink);
}
.nks-tp *, .nks-tp *::before, .nks-tp *::after { box-sizing: border-box; }
.nks-tp [hidden] { display: none !important; }

/* ---------- Sidebar: danh sách giao diện ---------- */
.nks-tp__sidebar { min-width: 0; }
.nks-tp__sidebar-title { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--nks-muted); margin: 0 0 12px; }
.nks-tp__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 760px; overflow-y: auto; }
.nks-tp__list li { margin: 0; padding: 0; }
.nks-tp__item {
	width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; text-align: left;
	background: var(--nks-card); border: 2px solid transparent; border-radius: 14px; cursor: pointer;
	font: inherit; color: inherit; transition: border-color .15s, transform .15s;
}
.nks-tp__item:hover { transform: translateY(-1px); }
.nks-tp__item.is-active { border-color: var(--nks-accent); }
.nks-tp__thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #d8d8d2; }
.nks-tp__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.nks-tp__name { font-weight: 600; font-size: 15px; line-height: 1.3; }

/* ---------- Stage ---------- */
.nks-tp__stage { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.nks-tp__toolbar { display: inline-flex; gap: 6px; padding: 4px; background: rgba(255, 255, 255, .7); border-radius: 999px; margin-bottom: 20px; }
.nks-tp__devbtn {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 999px;
	background: transparent; font: inherit; font-size: 14px; color: var(--nks-ink); cursor: pointer;
}
.nks-tp__devbtn.is-active { background: var(--nks-accent); color: #fff; }
.nks-tp__devbtn:disabled { opacity: .35; cursor: not-allowed; }

.nks-ico { display: inline-block; border: 2px solid currentColor; border-radius: 3px; }
.nks-ico--mobile { width: 10px; height: 16px; }
.nks-ico--tablet { width: 14px; height: 18px; }
.nks-ico--desktop { width: 20px; height: 14px; }

.nks-tp__views, .nks-tp__tpl, .nks-tp__device { width: 100%; }
.nks-tp__device { display: flex; flex-direction: column; align-items: center; }
.nks-tp__device[data-device='mobile'] { --nks-w: 320px; }
.nks-tp__device[data-device='tablet'] { --nks-w: 560px; }
.nks-tp__device[data-device='desktop'] { --nks-w: 980px; }

/* Một bộ giao diện: ẩn sidebar */
.nks-tp--single { grid-template-columns: 1fr; }
.nks-tp__single-title { margin: 0 0 14px; font-size: 20px; text-align: center; color: var(--nks-ink); }

/* Điều khiển slideshow */
.nks-ctrl { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: var(--nks-w); margin-top: 18px; }
.nks-ctrl__btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--nks-ink); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); transition: background .15s, color .15s; }
.nks-ctrl__btn:hover, .nks-ctrl__btn.is-active { background: var(--nks-ink); color: #fff; }
.nks-ctrl__count { min-width: 64px; text-align: center; font-size: 14px; color: var(--nks-muted); }
.nks-ctrl__count b { color: var(--nks-ink); }
.nks-ctrl__grid { margin-left: 8px; }

/* Danh sách ảnh (gallery) */
.nks-thumbs { list-style: none; position: relative; display: flex; gap: 8px; width: 100%; max-width: var(--nks-w); margin: 14px 0 0; padding: 4px 2px 8px; overflow-x: auto; scrollbar-width: thin; }
.nks-thumbs[hidden] { display: none; }
.nks-thumbs li { flex: 0 0 auto; margin: 0; padding: 0; }
.nks-thumbs__btn { position: relative; display: block; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #d8d8d2; cursor: pointer; opacity: .75; }
.nks-thumbs__btn img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.nks-thumbs__btn span { position: absolute; left: 4px; bottom: 4px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.nks-thumbs__btn:hover { opacity: 1; }
.nks-thumbs__btn.is-active { border-color: var(--nks-ink); opacity: 1; }

/* ---------- Device frames ---------- */
.nks-frame {
	position: relative; background: var(--nks-ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
	max-width: 100%;
}
.nks-frame__screen {
	background: #fff; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch; scrollbar-width: thin; outline: none;
}
.nks-frame__img { display: none; width: 100%; height: auto; margin: 0; max-width: 100%; }
.nks-frame__img.is-active { display: block; }

/* Mobile */
.nks-frame--mobile { width: 320px; padding: 12px; border-radius: 46px; }
.nks-frame--mobile .nks-frame__screen { height: 640px; border-radius: 34px; }
.nks-frame--mobile .nks-frame__screen::-webkit-scrollbar { width: 0; }
.nks-frame__notch { position: absolute; z-index: 2; top: 20px; left: 50%; width: 84px; height: 22px; margin-left: -42px; background: var(--nks-ink); border-radius: 999px; }

/* Tablet */
.nks-frame--tablet { width: 560px; padding: 16px; border-radius: 34px; }
.nks-frame--tablet .nks-frame__screen { height: 720px; border-radius: 18px; }
.nks-frame--tablet .nks-frame__notch { top: 6px; width: 8px; height: 8px; margin-left: -4px; }

/* Desktop */
.nks-frame--desktop { width: 100%; max-width: 980px; padding: 0 0 12px; border-radius: 14px; overflow: hidden; }
.nks-frame__bar { display: flex; gap: 6px; align-items: center; height: 34px; padding: 0 14px; }
.nks-frame__bar i { width: 10px; height: 10px; border-radius: 50%; background: #55555c; }
.nks-frame__bar i:nth-child(1) { background: #ff5f57; }
.nks-frame__bar i:nth-child(2) { background: #febc2e; }
.nks-frame__bar i:nth-child(3) { background: #28c840; }
.nks-frame--desktop .nks-frame__screen { height: 560px; margin: 0 12px; border-radius: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.nks-tp { grid-template-columns: 1fr; padding: 16px; }
	.nks-tp__list { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
	.nks-tp__item { width: 200px; flex: 0 0 auto; }
}
@media (max-width: 640px) {
	.nks-frame--tablet { width: 100%; padding: 10px; border-radius: 24px; }
	.nks-frame--tablet .nks-frame__screen { height: 560px; }
	.nks-frame--desktop .nks-frame__screen { height: 420px; margin: 0 8px; }
	.nks-frame--mobile .nks-frame__screen { height: 560px; }
	.nks-tp__devbtn { padding: 8px 12px; }
}
