.ld-page {
	padding: 1rem 0 2.5rem;
}

.ld-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 1rem;
	position: relative;
}

.ld-card,
.ld-app {
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
}

.ld-muted {
	color: var(--sp-muted);
	font-size: 0.8rem;
}

[hidden] {
	display: none !important;
}

/* ---------- หน้าเข้าสู่ระบบ ---------- */
.ld-signin {
	display: flex;
	flex-direction: column;
	height: 660px;
	overflow: hidden;
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
}

.ld-signin .ld-brand-logo {
	border-radius: 10px;
}

.ld-sec-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--sp-mint);
	background: color-mix(in srgb, var(--sp-mint) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--sp-mint) 30%, transparent);
}

.ld-sign-body {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: 360px 1fr;
	gap: 1rem;
	padding: 1rem;
}

.ld-login {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding: 1.1rem 1.1rem 0.9rem;
	border-radius: 14px;
	background: var(--sp-sunken);
	min-height: 0;
}

.ld-sign-head h2 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
}

.ld-sign-head p {
	margin: 0.15rem 0 0;
	font-size: 0.76rem;
	color: var(--sp-muted);
}

.ld-input {
	position: relative;
	display: flex;
	align-items: center;
}

.ld-input > i {
	position: absolute;
	left: 0.7rem;
	font-size: 0.9rem;
	color: var(--sp-muted);
	pointer-events: none;
}

.ld-field .ld-input input {
	padding: 0.6rem 2.4rem 0.6rem 2.1rem;
	background: var(--sp-surface);
}

.ld-input:focus-within > i {
	color: var(--sp-blue);
}

.ld-eye {
	position: absolute;
	right: 0.3rem;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--sp-muted);
	cursor: pointer;
}

.ld-eye:hover {
	color: var(--sp-text);
	background: var(--sp-surface-2);
}

.ld-caps {
	font-size: 0.72rem;
	color: var(--sp-warn);
}

.ld-sign-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.76rem;
}

.ld-sign-row a,
.ld-sign-foot a {
	color: var(--sp-blue);
	text-decoration: none;
}

.ld-sign-row a:hover,
.ld-sign-foot a:hover {
	text-decoration: underline;
}

.ld-check {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--sp-muted);
	cursor: pointer;
	margin: 0;
}

.ld-check input {
	width: 15px;
	height: 15px;
	accent-color: var(--sp-blue);
}

.ld-login .ld-btn {
	padding: 0.65rem;
}

.ld-sign-device {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.65rem;
	border-radius: 12px;
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
}

.ld-sign-device .ld-device-icon {
	width: 32px;
	height: 32px;
}

.ld-sign-device small {
	font-size: 0.66rem;
}

.ld-sign-sec {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.3rem;
}

.ld-sign-sec li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.72rem;
	color: var(--sp-muted);
}

.ld-sign-sec i {
	color: var(--sp-mint);
}

.ld-sign-foot {
	margin: auto 0 0;
	padding-top: 0.6rem;
	border-top: 1px solid var(--sp-border);
	text-align: center;
	font-size: 0.76rem;
	color: var(--sp-muted);
}

.ld-sign-side {
	min-height: 0;
	overflow: hidden;
	padding: 1rem;
	border-radius: 14px;
	background: var(--sp-sunken);
}

.ld-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0;
}

.ld-field > span {
	font-size: 0.75rem;
	color: var(--sp-muted);
}

.ld-field input {
	width: 100%;
	padding: 0.5rem 0.7rem;
	font-size: 0.86rem;
	border-radius: 10px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
	color: var(--sp-text);
}

.ld-field input:focus {
	outline: none;
	border-color: var(--sp-blue);
}

.ld-field input[readonly] {
	opacity: 0.7;
}

.ld-msg {
	min-height: 1.1rem;
	margin: 0;
	font-size: 0.78rem;
	color: var(--sp-muted);
}

.ld-msg.is-err {
	color: #ff6b6b;
}

.ld-msg.is-ok {
	color: var(--sp-mint);
}

.ld-msg.is-warn {
	color: var(--sp-warn);
}

.ld-msg:empty {
	display: none;
}

.ld-msg.ld-alert {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.65rem 0.75rem;
	border-radius: 12px;
	border: 1px solid color-mix(in srgb, #ff6b6b 45%, transparent);
	background: color-mix(in srgb, #ff6b6b 10%, var(--sp-surface));
	color: var(--sp-text);
	line-height: 1.45;
}

.ld-alert b {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	color: #ff6b6b;
}

.ld-alert span {
	font-size: 0.76rem;
	color: var(--sp-muted);
}

.ld-alert span:first-of-type {
	color: var(--sp-text);
}

.ld-alert a {
	align-self: flex-start;
	margin-top: 0.15rem;
	font-size: 0.76rem;
	font-weight: 600;
	color: var(--sp-blue);
	text-decoration: none;
}

.ld-alert a:hover {
	text-decoration: underline;
}

.ld-input.is-bad input {
	border-color: #ff6b6b;
	box-shadow: 0 0 0 3px color-mix(in srgb, #ff6b6b 18%, transparent);
	animation: ld-shake 0.35s;
}

.ld-input.is-bad > i {
	color: #ff6b6b;
}

@keyframes ld-shake {
	20%, 60% { transform: translateX(-4px); }
	40%, 80% { transform: translateX(4px); }
}

#ldConnect.is-locked {
	background: color-mix(in srgb, #ff6b6b 18%, var(--sp-surface));
	color: #ff9b9b;
	opacity: 1;
}

.ld-hwhelp {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.75rem 0.8rem;
	border-radius: 12px;
	background: color-mix(in srgb, var(--sp-warn) 10%, var(--sp-surface));
	border: 1px solid color-mix(in srgb, var(--sp-warn) 40%, transparent);
}

.ld-hwhelp b {
	font-size: 0.85rem;
	color: var(--sp-warn);
}

.ld-hwhelp p {
	margin: 0;
	font-size: 0.74rem;
	color: var(--sp-muted);
	line-height: 1.45;
}

.ld-hwhelp .ld-hwhelp-left {
	color: var(--sp-text);
	font-weight: 600;
}

.ld-hwhelp .ld-hwhelp-left.is-bad {
	color: var(--sp-danger);
}

.ld-hwhelp-acts {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: 0.4rem;
	margin-top: 0.2rem;
}

.ld-hwhelp-acts .ld-btn {
	min-width: 0;
	padding-inline: 0.4rem;
	font-size: 0.72rem;
	white-space: nowrap;
	text-decoration: none;
}

.ld-hwhelp-acts [hidden] + .ld-btn {
	grid-column: 1 / -1;
}

.ld-sign-device.is-sim {
	border-color: color-mix(in srgb, var(--sp-warn) 45%, transparent);
}

.ld-sign-device.is-sim .ld-device-icon {
	color: var(--sp-warn);
}

.ld-sim-chip {
	margin-left: 0.25rem;
	padding: 0.02rem 0.4rem;
	border-radius: 999px;
	font-style: normal;
	font-size: 0.62rem;
	font-weight: 700;
	color: var(--sp-warn);
	background: color-mix(in srgb, var(--sp-warn) 15%, transparent);
}

.ld-sim-btn {
	flex-shrink: 0;
	font-size: 0.72rem;
	white-space: nowrap;
}

.ld-sim-btn.is-armed {
	color: var(--sp-warn);
}

/* ---------- ปุ่ม ---------- */
.ld-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.55rem 0.9rem;
	font-size: 0.85rem;
	font-weight: 600;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--sp-blue), var(--sp-mint));
	color: var(--sp-on-accent, #0b1220);
	cursor: pointer;
	white-space: nowrap;
	transition: filter 0.15s, opacity 0.15s;
}

.ld-btn:hover {
	filter: brightness(1.08);
}

.ld-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ld-btn-sm {
	padding: 0.38rem 0.7rem;
	font-size: 0.78rem;
}

.ld-btn-ghost {
	background: var(--sp-sunken);
	color: var(--sp-text);
	border: 1px solid var(--sp-border);
}

.ld-btn-danger {
	background: rgba(255, 107, 107, 0.14);
	color: #ff8787;
	border: 1px solid rgba(255, 107, 107, 0.35);
}

.ld-btn.is-armed {
	background: var(--sp-warn);
	color: #1b1200;
	border-color: transparent;
}

.ld-icon-btn {
	flex: none;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
	color: var(--sp-text);
	cursor: pointer;
}

.ld-link {
	border: 0;
	background: none;
	padding: 0;
	font-size: 0.78rem;
	color: var(--sp-blue);
	cursor: pointer;
}

/* ---------- แอป ---------- */
/* หน้าต่างสูงเท่ากันทุกแท็บ — เนื้อหาที่ยาวเลื่อนอยู่ภายในแผง */
.ld-app {
	display: flex;
	flex-direction: column;
	height: 660px;
	overflow: hidden;
}

.ld-app[hidden] {
	display: none !important;
}

.ld-top,
.ld-tabs {
	flex: none;
}

.ld-panel {
	flex: 1;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: none;
}

.ld-panel::-webkit-scrollbar {
	display: none;
}

/* ---------- แบ่งหน้า ---------- */
.ld-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	min-height: 32px;
	margin-top: 0.7rem;
}

.ld-pager button {
	min-width: 32px;
	height: 32px;
	padding: 0 0.5rem;
	border-radius: 9px;
	border: 1px solid var(--sp-border);
	background: var(--sp-surface);
	color: var(--sp-text);
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.ld-pager button:hover:not(:disabled) {
	border-color: var(--sp-blue);
}

.ld-pager button.is-on {
	background: var(--sp-blue);
	border-color: var(--sp-blue);
	color: #fff;
}

.ld-pager button:disabled {
	opacity: 0.35;
	cursor: default;
}

.ld-pager span {
	color: var(--sp-muted);
	font-size: 0.78rem;
}

.ld-pager small {
	margin-left: 0.35rem;
	font-size: 0.68rem;
	color: var(--sp-muted);
	white-space: nowrap;
}

.ld-top {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--sp-border);
}

.ld-avatar,
.ld-avatar-row img {
	flex: none;
	width: 38px;
	height: 38px;
	min-width: 38px;
	max-width: 38px;
	aspect-ratio: 1;
	border-radius: 50%;
	object-fit: cover;
	object-position: center;
	background: var(--sp-surface-2);
}

.ld-avatar {
	border: 1px solid var(--sp-border-strong);
}

.ld-who {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.ld-who b {
	font-size: 0.9rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ld-who small {
	font-size: 0.72rem;
	color: var(--sp-muted);
}

.ld-who-btn {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.2rem 0.4rem 0.2rem 0.2rem;
	margin: -0.2rem 0 -0.2rem -0.2rem;
	border: 0;
	border-radius: 12px;
	background: none;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.ld-who-btn:hover {
	background: var(--sp-surface);
}

.ld-who b {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	min-width: 0;
}

.ld-who b > span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
}

.ld-avatar-rank {
	border: 2px solid var(--rk, var(--sp-border-strong));
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--rk, transparent) 20%, transparent);
}

.ld-rank {
	--rk: #9ba1ad;
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	font-size: 0.66rem;
	font-weight: 600;
	color: var(--rk);
	background: color-mix(in srgb, var(--rk) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--rk) 40%, transparent);
}

.ld-rank[hidden] {
	display: none;
}

.ld-role {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	font-size: 0.66rem;
	font-weight: 600;
	color: var(--sp-blue);
	background: color-mix(in srgb, var(--sp-blue) 14%, transparent);
}

.ld-role.is-admin {
	color: #ff8787;
	background: rgba(255, 107, 107, 0.14);
}

.ld-top-app {
	gap: 0.8rem;
}

.ld-top-app .ld-avatar {
	width: 44px;
	height: 44px;
	min-width: 44px;
	max-width: 44px;
}

.ld-who b > span:last-child {
	display: inline-flex;
	gap: 0.3rem;
}

.ld-who-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.7rem;
	margin-top: 0.1rem;
}

.ld-who-meta span {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	white-space: nowrap;
}

.ld-who-meta:empty {
	display: none;
}

.ld-top-stats {
	flex: none;
	display: flex;
	gap: 0.35rem;
}

.ld-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 84px;
	padding: 0.35rem 0.6rem;
	border-radius: 10px;
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	text-align: center;
	line-height: 1.25;
}

.ld-stat b {
	font-size: 0.86rem;
	white-space: nowrap;
}

.ld-stat small {
	font-size: 0.64rem;
	color: var(--sp-muted);
	white-space: nowrap;
}

.ld-member-form-act {
	display: flex;
	gap: 0.35rem;
}

.ld-member-form-act [hidden] {
	display: none;
}

.ld-rank {
	cursor: help;
}

@media (max-width: 1080px) {
	.ld-who-meta span:nth-child(n + 2) {
		display: none;
	}
}

@media (max-width: 860px) {
	.ld-top-app {
		flex-wrap: wrap;
	}
	.ld-top-stats {
		order: 5;
		width: 100%;
	}
	.ld-stat {
		flex: 1;
		min-width: 0;
	}
}

@media (max-width: 560px) {
	.ld-who-meta {
		display: none;
	}
	.ld-who .ld-role {
		display: none;
	}
	.ld-who .ld-rank {
		gap: 0;
		padding: 0.15rem 0.3rem;
		font-size: 0;
	}
	.ld-who .ld-rank i {
		font-size: 0.68rem;
	}
}

.ld-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 0.3rem;
	border-radius: 50%;
	background: var(--sp-mint);
	box-shadow: 0 0 0 3px rgba(var(--sp-mint-rgb), 0.18);
	vertical-align: 1px;
}

.ld-balance {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.85rem;
	font-weight: 700;
	border-radius: 999px;
	border: 1px solid rgba(var(--sp-mint-rgb), 0.35);
	background: rgba(var(--sp-mint-rgb), 0.1);
	color: var(--sp-mint);
	cursor: pointer;
}

.ld-tabs {
	display: flex;
	gap: 0.25rem;
	padding: 0.45rem 0.6rem;
	border-bottom: 1px solid var(--sp-border);
	overflow-x: auto;
	scrollbar-width: none;
}

.ld-tabs::-webkit-scrollbar {
	display: none;
}

.ld-tab {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.42rem 0.75rem;
	font-size: 0.8rem;
	border: 0;
	border-radius: 9px;
	background: none;
	color: var(--sp-muted);
	cursor: pointer;
}

.ld-tab:hover {
	color: var(--sp-text);
}

.ld-tab.is-on {
	background: var(--sp-sunken);
	color: var(--sp-text);
	font-weight: 600;
}

.ld-tab.is-on i {
	color: var(--sp-blue);
}

.ld-panel {
	padding: 1rem;
}

.ld-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.65rem;
}

.ld-panel-head h2 {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
}

.ld-sub {
	margin: 1rem 0 0.5rem;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--sp-muted);
}

.ld-form .ld-sub:first-child {
	margin-top: 0;
}

/* ---------- รายการ ---------- */
.ld-list {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.ld-logo {
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 9px;
	object-fit: cover;
	background: var(--sp-surface-2);
}

.ld-pill {
	flex: none;
	font-size: 0.68rem;
	font-weight: 600;
	padding: 0.18rem 0.5rem;
	border-radius: 999px;
}

.ld-pill.is-ok {
	background: rgba(var(--sp-mint-rgb), 0.14);
	color: var(--sp-mint);
}

.ld-pill.is-warn {
	background: rgba(255, 176, 32, 0.15);
	color: var(--sp-warn);
}

.ld-pill.is-off {
	background: rgba(255, 107, 107, 0.12);
	color: #ff8787;
}

/* ---------- เช่าโปร ---------- */
.ld-shop-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.55rem;
}

.ld-search {
	flex: 1;
	min-width: 180px;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0 0.7rem;
	border-radius: 10px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
}

.ld-search:focus-within {
	border-color: var(--sp-blue);
}

.ld-search i {
	color: var(--sp-muted);
	font-size: 0.85rem;
}

.ld-search input {
	flex: 1;
	min-width: 0;
	height: 36px;
	border: 0;
	outline: 0;
	background: none;
	color: var(--sp-text);
	font-size: 0.82rem;
}

.ld-filter {
	display: flex;
	padding: 3px;
	gap: 2px;
	border-radius: 10px;
	background: var(--sp-sunken);
	border: 1px solid var(--sp-border);
}

.ld-filter button {
	border: 0;
	padding: 0 0.75rem;
	border-radius: 7px;
	background: none;
	color: var(--sp-muted);
	font-size: 0.76rem;
	font-weight: 600;
	cursor: pointer;
}

.ld-filter button.is-on {
	background: var(--sp-surface-3);
	color: var(--sp-text);
}

.ld-shop-hint {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0 0.7rem;
	font-size: 0.74rem;
}

.ld-shop-hint i {
	color: var(--sp-mint);
}

.ld-pgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
	gap: 0.6rem;
}

.ld-pgrid > .ld-empty {
	grid-column: 1 / -1;
}

.ld-pcard {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 0.7rem;
	border-radius: 14px;
	background: var(--sp-sunken);
	border: 1px solid var(--sp-border);
	transition: border-color 0.15s;
}

.ld-pcard:hover {
	border-color: var(--sp-border-strong);
}

.ld-pcard.is-own {
	border-color: rgba(var(--sp-mint-rgb), 0.3);
}

.ld-pcard.is-off {
	opacity: 0.6;
}

.ld-pcard.is-focus {
	border-color: var(--sp-blue);
	box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.18);
}

.ld-pkgs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.35rem;
}

.ld-pkg input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ld-pkg span {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.1rem;
	padding: 0.4rem 0.25rem;
	border-radius: 9px;
	border: 1px solid var(--sp-border);
	background: var(--sp-surface);
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s, background 0.15s;
}

.ld-pkg b {
	font-size: 0.72rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.ld-pkg em {
	font-style: normal;
	font-size: 0.7rem;
	color: var(--sp-muted);
}

.ld-pkg input:checked + span {
	border-color: var(--sp-blue);
	background: rgba(77, 141, 255, 0.1);
}

.ld-pkg input:checked + span b,
.ld-pkg input:checked + span em {
	color: var(--sp-blue);
}

.ld-pkg input:focus-visible + span {
	outline: 2px solid var(--sp-blue);
}

.ld-pcard > .ld-btn {
	width: 100%;
	margin-top: auto;
}

.ld-empty {
	padding: 1.1rem;
	text-align: center;
	font-size: 0.8rem;
	color: var(--sp-muted);
	border: 1px dashed var(--sp-border);
	border-radius: 12px;
}

.ld-list-plain {
	gap: 0;
}

.ld-hrow {
	display: grid;
	grid-template-columns: 9rem 1fr auto;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.2rem;
	font-size: 0.78rem;
	border-bottom: 1px solid var(--sp-border);
}

.ld-hrow span:first-child {
	color: var(--sp-muted);
}

/* ---------- เติมเงิน ---------- */
.ld-big-balance {
	display: flex;
	flex-direction: column;
	padding: 0.8rem 1rem;
	margin-bottom: 0.7rem;
	border-radius: 12px;
	background: rgba(var(--sp-mint-rgb), 0.08);
	border: 1px solid rgba(var(--sp-mint-rgb), 0.25);
}

.ld-big-balance small {
	font-size: 0.74rem;
	color: var(--sp-muted);
}

.ld-big-balance b {
	font-size: 1.4rem;
	color: var(--sp-mint);
}

.ld-channels {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 0.5rem;
}

.ld-channel {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 0.6rem;
	align-items: center;
	padding: 0.65rem 0.75rem;
	text-align: left;
	border-radius: 12px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
	color: var(--sp-text);
	cursor: pointer;
}

.ld-channel:hover {
	border-color: var(--sp-blue);
}

.ld-channel > i:first-child {
	grid-row: span 2;
	font-size: 1.2rem;
	color: var(--sp-blue);
}

.ld-channel b {
	font-size: 0.82rem;
}

.ld-channel small {
	font-size: 0.7rem;
	color: var(--sp-muted);
}

.ld-channel-go {
	position: absolute;
	top: 0.55rem;
	right: 0.6rem;
	font-size: 0.7rem;
	color: var(--sp-muted);
}

.ld-note {
	margin: 0.6rem 0 0;
}

/* ---------- อุปกรณ์ ---------- */
.ld-grid-2.ld-dev {
	grid-template-columns: 1.25fr 1fr;
}

.ld-dev-hero,
.ld-dev-reset {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.75rem;
	border-radius: 12px;
	background: var(--sp-sunken);
	border: 1px solid transparent;
}

.ld-dev-hero.is-ok .ld-device-icon { color: var(--sp-mint); }
.ld-dev-hero.is-off .ld-device-icon { color: var(--sp-muted); }
.ld-dev-hero.is-bad { border-color: color-mix(in srgb, var(--sp-danger) 45%, transparent); }
.ld-dev-hero.is-bad .ld-device-icon { color: var(--sp-danger); }

.ld-dev-chip {
	margin-left: 0.3rem;
	padding: 0.05rem 0.45rem;
	border-radius: 999px;
	font-style: normal;
	font-size: 0.66rem;
	font-weight: 700;
	background: color-mix(in srgb, var(--sp-danger) 16%, transparent);
	color: var(--sp-danger);
}

.ld-dev-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.5rem;
	margin: 0.6rem 0;
}

.ld-dev-stats > div {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.6rem 0.7rem;
	border-radius: 12px;
	background: var(--sp-sunken);
	min-width: 0;
}

.ld-dev-stats small {
	font-size: 0.68rem;
	color: var(--sp-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ld-dev-stats b {
	font-size: 0.92rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ld-dev-stats b.is-ok { color: var(--sp-mint); }
.ld-dev-stats b.is-warn { color: var(--sp-warn); }
.ld-dev-stats b.is-bad { color: var(--sp-danger); }

.ld-dev-reset {
	justify-content: space-between;
}

.ld-dev-reset > div {
	min-width: 0;
}

.ld-dev-reset b {
	display: block;
	font-size: 0.85rem;
}

.ld-dev-reset small {
	display: block;
	font-size: 0.74rem;
	color: var(--sp-muted);
}

.ld-dev-reset small.is-err { color: var(--sp-warn); }

.ld-dev-reset .ld-btn {
	flex-shrink: 0;
}

.ld-dev-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.4rem;
}

.ld-dev-steps li {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.8rem;
}

.ld-dev-steps b { font-weight: 500; }

.ld-dev-steps span {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font-size: 0.7rem;
	font-weight: 800;
	background: var(--sp-surface-2);
	color: var(--sp-blue);
}

.ld-dev-rules {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}

.ld-dev-rules li {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	padding: 0.55rem 0.65rem;
	border-radius: 10px;
	background: var(--sp-sunken);
	font-size: 0.76rem;
	line-height: 1.45;
	color: var(--sp-muted);
}

.ld-dev-rules i {
	color: var(--sp-blue);
	font-size: 0.95rem;
	line-height: 1.3;
}

.ld-device-icon {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: var(--sp-surface-2);
	color: var(--sp-blue);
}

.ld-device-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.ld-device-info small {
	font-size: 0.72rem;
	color: var(--sp-muted);
}

.ld-device-info code {
	font-size: 0.78rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--sp-text);
}

/* ---------- บัญชี / ตั้งค่า ---------- */
.ld-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.ld-grid-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1.15fr;
	gap: 1rem;
}

.ld-sub-note {
	margin-left: 0.3rem;
	font-weight: 400;
	font-size: 0.7rem;
	opacity: 0.8;
}

.ld-themes {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.35rem;
}

.ld-theme {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	padding: 0.4rem 0.2rem 0.35rem;
	border-radius: 10px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
	color: var(--sp-muted);
	font-size: 0.66rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}

.ld-theme > span:last-child {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ld-theme:hover {
	border-color: var(--sp-border-strong);
	color: var(--sp-text);
}

.ld-theme.is-on {
	border-color: var(--sp-blue);
	color: var(--sp-text);
	box-shadow: 0 0 0 2px rgba(var(--sp-blue-rgb), 0.2);
}

.ld-theme-sw {
	width: 100%;
	max-width: 54px;
	height: 22px;
	border-radius: 6px;
	border: 1px solid rgba(127, 127, 127, 0.25);
	background:
		linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%) right 5px center / 18px 10px no-repeat,
		var(--sw-bg);
}

.ld-log-hint {
	display: flex;
	gap: 0.35rem;
	margin: -0.2rem 0 0.55rem;
	font-size: 0.72rem;
}

.ld-form {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	align-items: stretch;
}

.ld-form > .ld-btn {
	align-self: flex-start;
}

.ld-avatar-row {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.ld-seg {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.ld-seg-btn {
	padding: 0.38rem 0.7rem;
	font-size: 0.78rem;
	border-radius: 9px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
	color: var(--sp-text);
	text-decoration: none;
	font-family: inherit;
	cursor: pointer;
}

.ld-seg-btn:disabled {
	opacity: 0.6;
	cursor: progress;
}

.ld-seg-btn.is-on {
	border-color: var(--sp-blue);
	color: var(--sp-blue);
	font-weight: 600;
}

.ld-dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.35rem 0.8rem;
	margin: 0;
	font-size: 0.78rem;
}

.ld-dl dt {
	font-weight: 400;
	color: var(--sp-muted);
}

.ld-dl dd {
	margin: 0;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ld-sub-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ld-log {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--sp-border);
	border-radius: 12px;
	background: var(--sp-sunken);
}

.ld-log .ld-empty {
	border: 0;
}

.ld-log-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0.65rem;
	font-size: 0.76rem;
	border-bottom: 1px solid var(--sp-border);
}

.ld-log-row:last-child {
	border-bottom: 0;
}

.ld-log-row > i {
	flex: none;
	width: 26px;
	height: 26px;
	display: inline-grid;
	place-items: center;
	border-radius: 8px;
	background: rgba(var(--sp-mint-rgb), 0.12);
	color: var(--sp-mint);
}

.ld-log-row.is-err > i {
	background: rgba(255, 107, 107, 0.12);
	color: #ff8787;
}

.ld-log-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.ld-log-main b {
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ld-log-main time {
	font-size: 0.68rem;
	color: var(--sp-muted);
}

.ld-log-row em {
	flex: none;
	max-width: 45%;
	font-style: normal;
	font-size: 0.72rem;
	font-weight: 600;
	text-align: right;
	color: var(--sp-text);
}

.ld-log-row em.is-err {
	font-weight: 400;
	color: #ff8787;
}

/* ---------- เกมของฉัน: การ์ดเกม + อัปเดตเกมด้านข้าง ---------- */
.ld-games {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

.ld-games > * {
	min-width: 0;
}

.ld-count {
	display: inline-grid;
	place-items: center;
	min-width: 1.4rem;
	height: 1.4rem;
	padding: 0 0.35rem;
	margin-left: 0.3rem;
	font-size: 0.7rem;
	border-radius: 999px;
	background: var(--sp-sunken);
	color: var(--sp-muted);
	vertical-align: 1px;
}

.ld-count:empty {
	display: none;
}

.ld-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
	gap: 0.55rem;
}

.ld-tiles > .ld-empty {
	grid-column: 1 / -1;
}

.ld-tile {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 0.7rem;
	border-radius: 12px;
	background: var(--sp-sunken);
	border: 1px solid var(--sp-border);
}

.ld-tile-head {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
}

.ld-tile-name {
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.ld-tile-name b {
	font-size: 0.86rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ld-tile-name small {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.7rem;
	color: var(--sp-muted);
}

.ld-tile-name small i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.ld-tile-name small.is-ok {
	color: var(--sp-mint);
}

.ld-tile-name small.is-warn {
	color: var(--sp-warn);
}

.ld-tile-name small.is-off {
	color: #ff8787;
}

.ld-tile-time {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.5rem;
	font-size: 0.74rem;
	border-radius: 8px;
	background: var(--sp-surface);
	color: var(--sp-muted);
}

.ld-tile-time strong {
	margin-left: auto;
	color: var(--sp-text);
}

.ld-tile.is-soon .ld-tile-time {
	background: rgba(255, 176, 32, 0.12);
}

.ld-tile.is-soon .ld-tile-time strong {
	color: var(--sp-warn);
}

.ld-tile.is-urgent {
	border-color: rgba(255, 107, 107, 0.4);
}

.ld-tile.is-urgent .ld-tile-time {
	background: rgba(255, 107, 107, 0.12);
}

.ld-tile.is-urgent .ld-tile-time strong {
	color: #ff8787;
}

.ld-tile-act {
	display: flex;
	gap: 0.35rem;
	margin-top: auto;
}

.ld-tile.is-hold {
	border-color: color-mix(in srgb, var(--sp-warn) 40%, transparent);
	background: color-mix(in srgb, var(--sp-warn) 5%, var(--sp-sunken));
}

.ld-tile-hold {
	display: flex;
	gap: 0.45rem;
	padding: 0.45rem 0.55rem;
	border-radius: 8px;
	background: color-mix(in srgb, var(--sp-warn) 12%, transparent);
	font-size: 0.7rem;
	line-height: 1.4;
	color: var(--sp-muted);
}

.ld-tile-hold > i {
	color: var(--sp-warn);
	font-size: 0.95rem;
	line-height: 1.2;
}

.ld-tile-hold > span {
	min-width: 0;
}

.ld-tile-hold b {
	display: block;
	font-size: 0.76rem;
	color: var(--sp-warn);
}

.ld-tile-hold small {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.68rem;
}

.ld-btn.is-wait,
.ld-btn.is-wait:disabled {
	background: var(--sp-surface);
	color: var(--sp-muted);
	border: 1px dashed var(--sp-border);
	opacity: 1;
	cursor: not-allowed;
}

.ld-btn.is-wait .bi-hourglass-split {
	display: inline-block;
	animation: ld-flip 2s ease-in-out infinite;
}

@keyframes ld-flip {
	0%, 40% { transform: rotate(0); }
	60%, 100% { transform: rotate(180deg); }
}

.ld-tile.is-fresh {
	border-color: color-mix(in srgb, var(--sp-mint) 55%, transparent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-mint) 15%, transparent);
}

.ld-tile.is-off {
	opacity: 0.75;
}

.ld-games-note {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0 0 0.55rem;
	padding: 0.45rem 0.65rem;
	border-radius: 10px;
	font-size: 0.74rem;
	color: var(--sp-text);
	background: color-mix(in srgb, var(--sp-warn) 10%, var(--sp-surface));
	border: 1px solid color-mix(in srgb, var(--sp-warn) 35%, transparent);
}

.ld-games-note[hidden] {
	display: none;
}

.ld-games-note i {
	color: var(--sp-warn);
}

.ld-tile-act .ld-btn {
	flex: 1;
}

.ld-tile-act .ld-icon-btn {
	width: 32px;
	height: 32px;
}

/* อัปเดตเกมแบบย่อในคอลัมน์ข้าง */
.ld-games-side {
	padding: 0.7rem;
	border-radius: 12px;
	border: 1px solid var(--sp-border);
	background: var(--sp-sunken);
}

.ld-games-side .ld-panel-head h2 {
	font-size: 0.85rem;
}

.ld-games-side .hx-patch-sum {
	padding: 3px 8px;
	font-size: 0.66rem;
}

.ld-games-side .hx-patches {
	gap: 2px;
}

.ld-games-side .hx-patch {
	gap: 0.55rem;
	padding: 0.4rem;
	border-radius: 10px;
}

.ld-games-side .hx-patch img {
	width: 32px;
	height: 32px;
	border-radius: 8px;
}

.ld-games-side .hx-patch-name b {
	font-size: 0.8rem;
}

.ld-games-side .hx-patch-text small {
	font-size: 0.68rem;
}

.ld-games-side .hx-patch-text small > span:last-child {
	display: none;
}

.ld-games-side .hx-patch-state {
	padding: 2px 6px;
	font-size: 0.64rem;
}

.ld-games-side .hx-patch-state span {
	display: none;
}

.ld-games-side .hx-patch-side {
	flex-direction: row-reverse;
	align-items: center;
	gap: 0.4rem;
}

.ld-games-side .ld-patch-foot {
	font-size: 0.68rem;
}

/* ---------- อัปเดตเกม (ย่อให้เล็กลง) ---------- */
.ld-patch-host:empty {
	display: none;
}

.ld-patch .hx-patches {
	margin: 0;
}

.ld-patch-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	margin-top: 0.5rem;
	font-size: 0.74rem;
	color: var(--sp-muted);
}

.ld-patch-foot a {
	margin-left: auto;
	color: var(--sp-blue);
	text-decoration: none;
}

/* ---------- toast ---------- */
.ld-toast {
	position: fixed;
	left: 50%;
	bottom: 5.5rem;
	z-index: 1080;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	max-width: min(92vw, 420px);
	padding: 0.6rem 0.9rem;
	font-size: 0.82rem;
	border-radius: 12px;
	background: var(--sp-surface-3);
	border: 1px solid var(--sp-border-strong);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	transform: translate(-50%, 20px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
}

.ld-toast.is-show {
	opacity: 1;
	transform: translate(-50%, 0);
}

.ld-toast.is-ok i {
	color: var(--sp-mint);
}

.ld-toast.is-err i {
	color: #ff8787;
}

.ld-toast.is-warn i {
	color: var(--sp-warn);
}

@media (max-width: 860px) {
	.ld-signin {
		height: auto;
	}
	.ld-sign-body,
	.ld-grid-2,
	.ld-grid-3,
	.ld-games,
	.ld-grid-2.ld-dev {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 560px) {
	.ld-wrap {
		padding: 0 0.6rem;
	}
	.ld-tab span,
	.ld-sec-badge span {
		display: none;
	}
	.ld-tab {
		padding: 0.5rem 0.8rem;
		font-size: 1rem;
	}
	.ld-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.45rem;
	}
	.ld-tile {
		padding: 0.55rem;
	}
	.ld-tile-time > span {
		display: none;
	}
	.ld-tile-time strong {
		margin-left: 0;
	}
	.ld-app {
		height: calc(100dvh - 150px);
		min-height: 520px;
	}
	.ld-filter {
		width: 100%;
	}
	.ld-filter button {
		flex: 1;
		padding: 0.45rem 0;
	}
	.ld-hrow {
		grid-template-columns: 1fr auto;
	}
	.ld-hrow span:first-child {
		grid-column: span 2;
	}
}

.ld-login.has-help .ld-sign-sec,
.ld-login.has-help .ld-sign-foot,
.ld-login.has-alert .ld-sign-sec,
.ld-login.has-alert .ld-sign-foot {
	display: none;
}

.ld-balance.is-bump {
	animation: ld-bump 0.9s ease;
}

@keyframes ld-bump {
	0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--sp-mint-rgb), 0.55); }
	30% { transform: scale(1.08); }
	100% { transform: scale(1); box-shadow: 0 0 0 12px rgba(var(--sp-mint-rgb), 0); }
}

/* โปรแกรม Loader (Windows): หน้านี้เต็มหน้าต่างโปรแกรม */
body.ld-app-mode {
	overflow: hidden;
}

.ld-app-mode main {
	animation: none !important;
}

.ld-app-mode .ld-page {
	padding: 0;
}

.ld-app-mode .ld-wrap {
	max-width: none;
	padding: 0;
}

.ld-app-mode .ld-signin,
.ld-app-mode .ld-app {
	height: 100vh;
	min-height: 0;
	border: 0;
	border-radius: 0;
}

/* Loader 1.1+: แถบหัวหน้าต่างของโปรแกรม (แทนกรอบ Windows) */
.ld-titlebar {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 1000;
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	height: 38px;
	background: linear-gradient(180deg, var(--sp-surface-2), var(--sp-surface));
	border-bottom: 1px solid var(--sp-border);
	user-select: none;
	-webkit-user-select: none;
	cursor: default;
}

.ld-titlebar::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 2px;
	background: linear-gradient(90deg, var(--sp-mint), var(--sp-blue) 55%, transparent);
	opacity: 0.85;
	pointer-events: none;
}

.ld-tb-brand {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
	padding: 0 0.85rem;
}

.ld-tb-brand img {
	width: 20px;
	height: 20px;
	border-radius: 6px;
	object-fit: cover;
	box-shadow: 0 0 0 1px var(--sp-border-strong), 0 0 12px rgba(var(--sp-mint-rgb), 0.35);
	pointer-events: none;
}

.ld-tb-name {
	color: var(--sp-text);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.ld-tb-name b {
	color: var(--sp-mint);
	font-weight: 700;
}

.ld-tb-ver {
	padding: 0.05rem 0.45rem;
	border: 1px solid rgba(var(--sp-mint-rgb), 0.35);
	border-radius: 999px;
	background: rgba(var(--sp-mint-rgb), 0.1);
	color: var(--sp-mint);
	font-size: 0.66rem;
	font-weight: 600;
	line-height: 1.5;
}

.ld-tb-secure {
	color: var(--sp-muted);
	font-size: 0.72rem;
	opacity: 0.7;
}

.ld-tb-ctrls {
	display: flex;
}

.ld-tb-btn {
	display: grid;
	place-items: center;
	width: 46px;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--sp-muted);
	transition: background-color 0.12s ease, color 0.12s ease;
}

.ld-tb-btn svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.1;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ld-tb-btn:hover {
	background: var(--sp-surface-3);
	color: var(--sp-text);
}

.ld-tb-btn:active {
	background: var(--sp-sunken);
}

.ld-tb-btn.is-close:hover {
	background: #e5484d;
	color: #fff;
}

.ld-tb-btn.is-close:active {
	background: #c4353a;
	color: #fff;
}

.ld-tb-btn .i-restore,
.ld-maxed .ld-tb-btn .i-max {
	display: none;
}

.ld-maxed .ld-tb-btn .i-restore {
	display: inline;
}

.ld-frameless .ld-page {
	padding-top: 38px;
}

.ld-app-mode.ld-frameless .ld-signin,
.ld-app-mode.ld-frameless .ld-app {
	height: calc(100vh - 38px);
}

.ld-frameless:not(.ld-maxed)::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 1001;
	border: 1px solid var(--sp-border-strong);
	pointer-events: none;
}

.ld-rz {
	position: fixed;
	z-index: 1002;
}

.ld-maxed .ld-rz {
	display: none;
}

.ld-rz-n, .ld-rz-s { left: 8px; right: 8px; height: 4px; cursor: ns-resize; }
.ld-rz-e, .ld-rz-w { top: 8px; bottom: 8px; width: 4px; cursor: ew-resize; }
.ld-rz-n { top: 0; }
.ld-rz-s { bottom: 0; }
.ld-rz-e { right: 0; }
.ld-rz-w { left: 0; }
.ld-rz-ne, .ld-rz-nw, .ld-rz-se, .ld-rz-sw { width: 8px; height: 8px; }
.ld-rz-ne { top: 0; right: 0; cursor: nesw-resize; }
.ld-rz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.ld-rz-nw { top: 0; left: 0; cursor: nwse-resize; }
.ld-rz-se { bottom: 0; right: 0; cursor: nwse-resize; }

/* Loader 1.2+: สถานะอัปเดตอัตโนมัติ */
.ld-tb-upd {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	height: 22px;
	margin-left: 0.35rem;
	padding: 0 0.6rem;
	overflow: hidden;
	border: 1px solid rgba(var(--sp-mint-rgb), 0.3);
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(var(--sp-mint-rgb), 0.22) var(--p, 0%), rgba(var(--sp-mint-rgb), 0.06) var(--p, 0%));
	color: var(--sp-text);
	font-size: 0.68rem;
	white-space: nowrap;
	cursor: default;
}

.ld-tb-upd.is-ready {
	background: rgba(var(--sp-mint-rgb), 0.16);
	border-color: rgba(var(--sp-mint-rgb), 0.55);
	cursor: pointer;
	animation: ld-upd-glow 2.4s ease-in-out infinite;
}

.ld-tb-upd.is-ready:hover {
	background: rgba(var(--sp-mint-rgb), 0.28);
}

.ld-tb-upd b {
	color: var(--sp-mint);
}

@keyframes ld-upd-glow {
	50% { box-shadow: 0 0 10px rgba(var(--sp-mint-rgb), 0.45); }
}

.ld-upd-force {
	position: fixed;
	inset: 38px 0 0 0;
	z-index: 999;
	display: grid;
	place-items: center;
	background: rgba(8, 9, 11, 0.78);
	backdrop-filter: blur(6px);
}

.ld-upd-card {
	width: min(420px, 90vw);
	padding: 1.6rem 1.5rem;
	border: 1px solid var(--sp-border-strong);
	border-radius: 16px;
	background: var(--sp-surface);
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.ld-upd-ico {
	color: var(--sp-mint);
	font-size: 2rem;
}

.ld-upd-force.is-failed .ld-upd-ico {
	color: var(--sp-warn);
}

.ld-upd-card h3 {
	margin: 0.5rem 0 0.35rem;
	font-size: 1.05rem;
}

.ld-upd-card p {
	margin: 0 0 1rem;
	color: var(--sp-muted);
	font-size: 0.82rem;
}

.ld-upd-bar {
	height: 6px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--sp-sunken);
}

.ld-upd-bar span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--sp-mint), var(--sp-blue));
	transition: width 0.3s ease;
}

.ld-upd-acts {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1rem;
}
