* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--radius: 0px;
	--page-margin: 0px;
}

html,
body {
	height: 100%;
}

body {
	font-family: system-ui, sans-serif;
	background: #0e1014;
	color: #e6e6e6;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding: var(--page-margin);
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: none;
	cursor: pointer;
}

/* ---- tab strip (invisible bar) ---- */
#px-tabstrip {
	height: 38px;
	background: transparent;
	display: flex;
	align-items: center;
	flex: none;
}

#px-tabs {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.px-tab:first-child {
	margin-left: 3px;
}

.px-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	flex: 1 1 auto;
	overflow: hidden;
	padding: 0 8px 0 10px;
	min-width: 90px;
	max-width: 250px;
	color: #9aa3af;
	background: #232833;
	border: 1px solid transparent;
	border-radius: 999px;
	white-space: nowrap;
	font-size: 12px;
	user-select: none;
	position: relative;
	transition: transform 0.18s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	will-change: transform;
}

.px-tab:hover {
	background: #2b313c;
	color: #c9d1dc;
}

.px-tab.px-active {
	background: #3f4757;
	border-color: transparent;
	color: #fff;
}

.px-favicon {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	flex: none;
	display: none;
}

.px-tab span {
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
}

.px-tab .px-tabclose {
	width: 18px;
	height: 18px;
	border-radius: 999px;
	color: #9aa3af;
	flex: none;
	padding: 0;
}

.px-tab .px-tabclose:hover {
	color: #fff;
}

.px-tab .px-tabclose svg {
	width: 14px;
	height: 14px;
	display: block;
	margin: auto;
	fill: currentColor;
}

.px-tab.px-dragging {
	z-index: 20;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
	background: #3f4757;
	scale: 1.06;
	cursor: grabbing;
}

#px-tabspacer {
	flex: 1 1 0;
}

#px-newtab {
	height: 30px;
	width: 30px;
	padding: 0;
	border-radius: 999px;
	color: #9aa3af;
	flex: none;
}

#px-newtab:hover {
	color: #fff;
	background: #191d24;
}

/* ---- content window (nav bar + content) ---- */
#px-window {
	flex: 1;
	min-height: 0;
	width: 100%;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

#px-nav {
	flex: none;
	height: 44px;
	background: #14171d;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 8px;
	border-radius: var(--radius) var(--radius) 0 0;
	z-index: 30;
}

#px-nav button {
	width: 34px;
	height: 34px;
	border-radius: 6px;
	padding: 0;
	color: #8b93a1;
}

#px-nav button:disabled {
	color: #3d434e;
}

#px-nav button:not(:disabled):hover {
	color: #ffffff;
}

#px-nav svg path,
#px-newtab svg path {
	fill: currentColor;
}

#px-nav svg,
#px-newtab svg {
	display: block;
	margin: auto;
}

#px-url {
	flex: 1;
	margin: 0 8px;
	padding: 8px 16px;
	background: #0e1014;
	border: 1px solid #2a303b;
	border-radius: 999px;
	color: #e6e6e6;
	font-size: 14px;
	outline: none;
}

#px-url:focus {
	border-color: #3b82f6;
}

#px-content {
	position: relative;
	flex: 1;
	min-height: 0;
	background: #fff;
	border-radius: 0 0 var(--radius) var(--radius);
	overflow: hidden;
}

#px-error {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 6px 14px;
	background: #fee2e2;
	color: #b91c1c;
	display: none;
	z-index: 40;
	font-size: 13px;
}

.px-view {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	background: #fff;
	z-index: 10;
}

#px-home.px-view {
	background: #0e1014;
	color: #e6e6e6;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
}

#px-home-box {
	text-align: center;
}

#px-home-box h1 {
	font-size: 22px;
	font-weight: 500;
	margin-bottom: 24px;
	color: #9aa3af;
}

#px-homesearch {
	display: flex;
	align-items: center;
	gap: 10px;
	width: min(520px, 88vw);
	margin: 0 auto 28px;
	padding: 7px 7px 7px 20px;
	background: #1a1f28;
	border: 1px solid #2a303b;
	border-radius: 999px;
}

#px-homesearch:focus-within {
	background: #1c222d;
	border-color: #3b82f6;
}

#px-homesearch input {
	flex: 1;
	min-width: 0;
	background: none;
	border: none;
	outline: none;
	color: #e6e6e6;
	font-size: 17px;
	padding: 6px 0;
}

#px-homesearch input::placeholder {
	color: #6b7280;
}

#px-homesearch button {
	width: 40px;
	height: 40px;
	flex: none;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #2563eb;
	color: #fff;
}

#px-homesearch button:hover {
	color: #fff;
	background: #3b82f6;
}

#px-homesearch svg path {
	fill: currentColor;
}

#px-homesearch svg {
	width: 21px;
	height: 21px;
	transform: rotate(0deg) translate(0, 1.5px);
	transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#px-homesearch.px-rotated svg {
	transform: rotate(42deg) translate(0, 1.5px);
}

#px-homesearch button:hover svg {
	transform: rotate(0deg) translate(0, 1.5px) scale(1.18);
}

#px-homesearch.px-rotated button:hover svg {
	transform: rotate(42deg) translate(0, 1.5px) scale(1.18);
}

#px-home-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	max-width: 480px;
}

#px-home-links button {
	padding: 7px 16px;
	background: #1a1f28;
	border: 1px solid #2a303b;
	border-radius: 999px;
	font-size: 13px;
	color: #c9d1dc;
}

#px-home-links button:hover {
	background: #232833;
	color: #fff;
}

#px-qlink-plus {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 7px 12px;
}

#px-qlink-plus svg path {
	fill: currentColor;
}

.px-qlink-custom {
	border-style: dashed;
}

.px-qlink-custom::before {
	content: "✦";
	font-size: 9px;
	color: #6b7280;
	margin-right: 6px;
}

#px-qlink-popup {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

#px-qlink-popup.px-open {
	display: flex;
}

#px-qlink-popup .px-qlink-box {
	background: #1a1f28;
	border: 1px solid #2a303b;
	border-radius: 12px;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 300px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#px-qlink-popup h3 {
	font-size: 14px;
	color: #e6e6e6;
}

#px-qlink-popup input {
	padding: 8px 12px;
	background: #0e1014;
	border: 1px solid #2a303b;
	border-radius: 8px;
	color: #e6e6e6;
	font: inherit;
	font-size: 13px;
	outline: none;
}

#px-qlink-popup input:focus {
	border-color: #2563eb;
}

#px-qlink-popup .px-qlink-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

#px-qlink-popup .px-qlink-actions button {
	padding: 7px 14px;
	border-radius: 8px;
	font-size: 13px;
	background: #232833;
	color: #c9d1dc;
}

#px-qlink-popup .px-qlink-actions button:hover {
	background: #2b313c;
	color: #fff;
}

#px-qlink-popup #px-qlink-save {
	background: #2563eb;
	color: #fff;
}

#px-qlink-popup #px-qlink-save:hover {
	background: #3b82f6;
}
