/* Compiled from scss/main.scss of DualShock Tools (MIT) */
@keyframes shake {
	0%,100% {
		transform: translateX(0);
	}
	10%,30%,50%,70%,90% {
		transform: translateX(-2px);
	}
	20%,40%,60%,80% {
		transform: translateX(2px);
	}
}

@keyframes pulse {
	0%,100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.1);
		opacity: 0.8;
	}
}

@keyframes bounce {
	0%,20%,50%,80%,100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-3px);
	}
	60% {
		transform: translateY(-2px);
	}
}

@keyframes glow {
	0%,100% {
		text-shadow: 0 0 5px rgba(var(--ds-accent-rgb), 0.5);
	}
	50% {
		text-shadow: 0 0 15px rgba(var(--ds-accent-rgb), 0.8), 0 0 25px rgba(var(--ds-accent-rgb), 0.6);
	}
}

@keyframes blink {
	0%,50% {
		opacity: 1;
	}
	51%,100% {
		opacity: 0.3;
	}
}

@keyframes pulse-text {
	0%,100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

/* Set text color to red for internationalized elements */
/* .ds-i18n {
  color: red;
} */

body {
	padding-bottom: 80px;
}

dl.row {
	dt {
		font-weight: normal;
	}
	dd {
		font-family: monospace;
	}
}

#left-stick-card {
	cursor: pointer;
	outline: none !important;
}

#right-stick-card {
	cursor: pointer;
	outline: none !important;
}

.stick-card-active {
	border: 1px solid var(--ds-accent-text) !important;
	box-shadow: 0 0 10px rgba(var(--ds-accent-rgb), 0.3) !important;
	.card-header {
		background-color: var(--ds-neon) !important;
		color: var(--ds-ink) !important;
	}
}

.accordion-item {
	&:has(.accordion-collapse.show) {
		i.fas.test-icon-usb {
			animation: pulse 1s ease-in-out infinite !important;
		}
		i.fas.test-icon-buttons {
			animation: bounce 0.6s ease-in-out infinite !important;
		}
		i.fas.test-icon-imu {
			animation: pulse 1s ease-in-out infinite !important;
		}
		i.fas.test-icon-trackpad {
			animation: pulse 1s ease-in-out infinite !important;
		}
		i.fas.test-icon-haptic {
			animation: shake 0.5s ease-in-out infinite !important;
		}
		i.fas.test-icon-adaptive {
			animation: pulse 1s ease-in-out infinite !important;
		}
		i.fas.test-icon-speaker {
			animation: bounce 0.6s ease-in-out infinite !important;
		}
		i.fas.test-icon-microphone {
			animation: glow 1.5s ease-in-out infinite !important;
		}
		i.fas.test-icon-lights {
			animation: glow 1.2s ease-in-out infinite !important;
		}
		i.fas.test-icon-headphone {
			animation: pulse 1s ease-in-out infinite !important;
		}
	}
}

#quickTestAccordion {
	.accordion-button {
		padding: 0.5rem 1rem;
	}
	.accordion-collapse {
		.accordion-body {
			background-color: rgba(var(--ds-accent-rgb), .05);
		}
	}
}

.skip-btn {
	opacity: 0;
	transition: opacity 0.2s ease-in-out;
}

.accordion-header {
	&:hover {
		.skip-btn {
			opacity: 1;
		}
	}
}

.blink-text {
	animation: blink 1s infinite;
}

.pulsing-text {
	animation: pulse-text 0.75s ease-in-out infinite;
}

/* Quick test check badges (IMU, trackpad): bold glyphs, stable pill width */
.test-check {
	font-weight: 900;
	font-size: 0.85em;
	min-width: 1.8em;
}

/* IMU test center-zero bar meters (Bootstrap vars follow data-bs-theme) */
.imu-bar {
	position: relative;
	height: 4px;
	margin-bottom: 4px;
	background: var(--bs-border-color);
	border-radius: 3px;

	&::before {
		/* center (zero) marker */
		content: '';
		position: absolute;
		left: 50%;
		top: -2px;
		bottom: -2px;
		width: 1px;
		background: var(--bs-secondary-color);
	}
}

.imu-bar-fill {
	/* spans the right half; JS sets transform: scaleX(-1..1) around the center */
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 50%;
	border-radius: 3px;
	transform: scaleX(0);
	transform-origin: left center;
}

/* VR2 button panel: pills light up light blue on capacitive touch and
   dark blue while clicked */
.vr2-btn {
	/* Bootstrap theme variables follow data-bs-theme */
	background-color: var(--bs-secondary-bg);
	color: var(--bs-secondary-color);
	font-size: 0.9rem;
	transition: background-color 0.1s, color 0.1s;

	&.touched {
		background-color: #7ecbff; /* same light blue as the controller SVG body */
		color: #0b3050;
	}

	&.pressed {
		background-color: #1a237e; /* same dark blue as the SVG pressed infill */
		color: #ffffff;
	}
}

/* VR2 raw input report: one cell per byte, recently changed bytes highlighted */
.vr2-raw-cell {
	display: inline-block;
	min-width: 2.6em;
	text-align: center;
	border-radius: 3px;
}

.vr2-raw-hot {
	background-color: var(--bs-warning-bg-subtle);
	color: var(--bs-warning-text-emphasis);
}

/* ---- Xbox panel ---- */
.xbx-trig { display:grid; grid-template-columns: 28px 1fr 44px; gap:8px; align-items:center; font-size:.8rem; margin:3px 0; }
.xbx-trig .progress { height:10px; } .xbx-trig .progress-bar { background: var(--ds-neon); transition:none; }
.xbx-log { max-height:180px; overflow:auto; background: var(--bs-tertiary-bg); border-radius:6px; padding:6px; font-size:.72rem; }
.xbx-log .err { color: var(--bs-danger); } .xbx-log .write { color: var(--bs-warning); font-weight:600; } .xbx-log .info { color: var(--ds-accent-text, var(--bs-success)); }
.xbx-steps li { margin-bottom: .45rem; }
.xbx-cal-plots { display:grid; grid-template-columns: 1fr 1fr; gap:10px; text-align:center; }
.xbx-cal-plots canvas { width:100%; max-width:440px; aspect-ratio:1; display:block; margin:6px auto; }
.xbx-legend { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; color: var(--bs-secondary-color); }
.xbx-legend i { display:inline-block; width:12px; height:3px; vertical-align:middle; margin-right:4px; }
.xbx-ring { display:flex; gap:2px; justify-content:center; margin:2px 0; }
.xbx-ring span { width:10px; height:7px; border-radius:2px; background: var(--bs-secondary-bg); }
.xbx-ring span.on { background: var(--ds-neon); }
#xbox-svg-placeholder svg { max-width: 100%; }
.xbx-pulse { animation: xbxPulse 1.4s ease-in-out infinite; color: var(--ds-ink) !important; }
@keyframes xbxPulse { 50% { box-shadow: 0 0 0 6px rgba(var(--ds-neon-rgb), .35); } }

/* trigger calibration window */
.xbt-step { flex: 1; text-align: center; padding: .35rem .5rem; border-radius: .5rem; border: 1px solid rgba(128,128,128,.35); font-size: .85rem; opacity: .6; }
.xbt-step span { display: inline-block; width: 1.4em; height: 1.4em; line-height: 1.4em; border-radius: 50%; background: rgba(128,128,128,.35); margin-right: .25em; font-weight: 700; }
.xbt-step.active { opacity: 1; border-color: var(--ds-neon, #39FF14); box-shadow: 0 0 0 1px var(--ds-neon, #39FF14) inset; }
.xbt-step.active span, .xbt-step.done span { background: var(--ds-neon, #39FF14); color: #111; }
.xbt-step.done { opacity: .85; }
.xbt-stage { min-height: 100px; padding: .75rem 1rem; border-radius: .75rem; background: rgba(128,128,128,.12); }
.xbt-body { fill: rgba(128,128,128,.35); }
.xbt-trig { fill: none; stroke: var(--ds-neon, #39FF14); stroke-width: 3; }
.xbt-arrow { fill: none; stroke: var(--ds-neon, #39FF14); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; animation: xbtArrow 1.2s ease-in-out infinite; }
.xbt-pullanim { transform-origin: 60px 56px; animation: xbtPull 1.2s ease-in-out infinite; }
.xbt-pullanim .xbt-trig { animation: xbtFill 1.2s ease-in-out infinite; }
@keyframes xbtPull { 0%, 100% { transform: translateY(0) } 45%, 60% { transform: translateY(14px) } }
@keyframes xbtFill { 0%, 100% { fill: transparent } 45%, 60% { fill: rgba(57,255,20,.35) } }
@keyframes xbtArrow { 0%, 100% { transform: translateY(0); opacity: .4 } 50% { transform: translateY(6px); opacity: 1 } }
.xbt-hands { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex: none;
  border: 3px solid #ff9d2e; color: #ff9d2e; position: relative; animation: xbtHand 1.4s ease-in-out infinite; }
.xbt-hands::after { content: ''; position: absolute; width: 80%; height: 3px; background: #ff9d2e; transform: rotate(-45deg); border-radius: 2px; }
.xbt-hands.ok { border-color: var(--ds-neon, #39FF14); color: var(--ds-neon, #39FF14); animation: none; }
.xbt-hands.ok::after { display: none; }
@keyframes xbtHand { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.08) } }
.xbt-restbar { background: #ff9d2e !important; transition: width .1s linear; }
.xbt-dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin: 0 .15em; vertical-align: -.05em; background: rgba(128,128,128,.4); transition: background .2s, transform .2s; }
.xbt-dot.on { background: var(--ds-neon, #39FF14); transform: scale(1.15); }
/* trigger calibration bars */
.xbt-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; font-size: .85rem; }
.xbt-row > b { width: 2.2em; }
.xbt-num { width: 16em; font-size: .8rem; }
.xbt-track { --glow: .25; position: relative; flex: 1; height: 22px; border-radius: 11px; overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(128,128,128,.18)); box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.xbt-seen { position: absolute; top: 0; bottom: 0; background: rgba(57,255,20,.12); border-left: 1px dashed rgba(57,255,20,.45); border-right: 1px dashed rgba(57,255,20,.45); }
.xbt-fill { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 8px; width: 0;
  background: linear-gradient(90deg, rgba(57,255,20,.15), var(--ds-neon, #39FF14)),
              repeating-linear-gradient(115deg, rgba(255,255,255,.0) 0 10px, rgba(255,255,255,.22) 10px 16px);
  background-blend-mode: screen; background-size: 100% 100%, 200px 100%;
  animation: xbtShimmer 1.1s linear infinite;
  box-shadow: 0 0 calc(18px * var(--glow)) rgba(57,255,20, var(--glow)); opacity: calc(.55 + var(--glow) * .45); }
@keyframes xbtShimmer { from { background-position: 0 0, 0 0 } to { background-position: 0 0, 200px 0 } }
.xbt-knob { position: absolute; top: 1px; bottom: 1px; width: 6px; margin-left: -3px; border-radius: 3px; background: #fff;
  box-shadow: 0 0 6px #fff, 0 0 14px var(--ds-neon, #39FF14), 0 0 24px var(--ds-neon, #39FF14); }
.xbt-peak { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ff9d2e; box-shadow: 0 0 8px #ff9d2e; transition: opacity .3s; }
.xbt-row.max .xbt-track { animation: xbtFlash .6s ease-out infinite; }
.xbt-row.max .xbt-knob { background: #ff9d2e; box-shadow: 0 0 8px #ff9d2e, 0 0 20px #ff9d2e; }
@keyframes xbtFlash { 0% { box-shadow: inset 0 1px 3px rgba(0,0,0,.5), 0 0 0 0 rgba(57,255,20,.7) } 100% { box-shadow: inset 0 1px 3px rgba(0,0,0,.5), 0 0 0 8px rgba(57,255,20,0) } }
.xbt-dz { position: absolute; top: 0; bottom: 0; opacity: 0; transition: opacity .3s;
  background: repeating-linear-gradient(45deg, rgba(255,157,46,.35) 0 4px, rgba(255,157,46,.12) 4px 8px); }
.xbt-dzbox { border: 1px solid rgba(128,128,128,.3); border-radius: .6rem; padding: .5rem .75rem; }
.xbt-dzrow + .xbt-dzrow { margin-top: .25rem; }
.xbt-range::-webkit-slider-thumb { background: #ff9d2e; }
.xbt-range::-moz-range-thumb { background: #ff9d2e; }
.xbt-out { color: var(--ds-neon, #39FF14); font-size: 1rem; }

/* ---- Xbox windows: movable + resizable ---- */
.ds-movable .modal-header { cursor: move; user-select: none; }
.ds-movable .modal-content { position: relative; }
.ds-movable.ds-resized .modal-body, #xboxModal .modal-body { overflow: auto; }
.xbx-resize-handle { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize; z-index: 5; opacity: .6;
  background: linear-gradient(135deg, transparent 50%, var(--ds-neon, #39FF14) 50% 58%, transparent 58% 70%, var(--ds-neon, #39FF14) 70% 78%, transparent 78%); }
.xbx-resize-handle:hover { opacity: 1; }
.ds-movable.xbx-moving .modal-dialog, .ds-movable.xbx-sizing .modal-dialog { transition: none !important; }
.ds-movable.xbx-moving .modal-content { box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 0 0 1px var(--ds-neon, #39FF14); }

/* ---- stick dials ---- */
.xbx-cal-plots > div > b { display: block; font-size: 1rem; letter-spacing: .02em; }
.xbx-dial { filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); }

/* ---- pills, checklist, notices ---- */
.xbx-pill { display: inline-flex; align-items: center; gap: .3em; padding: .2em .65em; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.4; margin: 0 .3em .3em 0; border: 1px solid transparent; }
.xbx-pill.good { color: #3ddc84; background: rgba(61,220,132,.12); border-color: rgba(61,220,132,.45); }
.xbx-pill.warn { color: #ffb020; background: rgba(255,176,32,.12); border-color: rgba(255,176,32,.5); }
.xbx-pill.bad  { color: #ff5a5f; background: rgba(255,90,95,.12); border-color: rgba(255,90,95,.5); }
.xbx-chk-sum { margin: .25rem 0 .4rem; }
.xbx-chk { display: grid; gap: 3px; margin-bottom: .6rem; }
.xbx-chk-row { display: flex; gap: .55rem; align-items: flex-start; padding: .32rem .6rem; border-radius: .45rem; font-size: .86rem; line-height: 1.35;
  background: rgba(128,128,128,.08); border-left: 3px solid transparent; color: var(--bs-body-color); }
.xbx-chk-ico { flex: none; width: 1.25em; height: 1.25em; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; margin-top: .05em; }
.xbx-chk-row.good { border-left-color: #3ddc84; }
.xbx-chk-row.good .xbx-chk-ico { background: rgba(61,220,132,.18); color: #3ddc84; }
.xbx-chk-row.warn { border-left-color: #ffb020; background: rgba(255,176,32,.08); }
.xbx-chk-row.warn .xbx-chk-ico { background: rgba(255,176,32,.2); color: #ffb020; }
.xbx-chk-row.bad  { border-left-color: #ff5a5f; background: rgba(255,90,95,.09); }
.xbx-chk-row.bad .xbx-chk-ico { background: rgba(255,90,95,.22); color: #ff5a5f; }
.xbx-notice { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 1rem; border-radius: .65rem; margin-bottom: .6rem; border: 1px solid; border-left-width: 5px; font-size: .9rem; line-height: 1.45; }
.xbx-notice-ico { flex: none; font-size: 1.35rem; line-height: 1; margin-top: .1rem; }
.xbx-notice-title { font-weight: 700; font-size: .98rem; margin-bottom: .15rem; letter-spacing: .01em; }
.xbx-notice.good { border-color: rgba(61,220,132,.5); background: rgba(61,220,132,.08); }
.xbx-notice.good .xbx-notice-ico, .xbx-notice.good .xbx-notice-title { color: #3ddc84; }
.xbx-notice.warn { border-color: rgba(255,176,32,.55); background: rgba(255,176,32,.07); }
.xbx-notice.warn .xbx-notice-ico, .xbx-notice.warn .xbx-notice-title { color: #ffb020; }
.xbx-notice.bad { border-color: rgba(255,90,95,.55); background: rgba(255,90,95,.08); }
.xbx-notice.bad .xbx-notice-ico, .xbx-notice.bad .xbx-notice-title { color: #ff5a5f; }
.xbx-notice-body { color: var(--bs-body-color); }
.xbx-decision label { cursor: pointer; padding: .15rem 0; }
.xbx-dials { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.xbx-dials canvas { width: 100%; max-width: 230px; aspect-ratio: 1; display: block; margin: 4px auto 0; }

/* ---- connect screen ---- */
.cx-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .6rem; }
.cx-title span { font-weight: 400; font-size: .9rem; color: var(--bs-secondary-color); margin-left: .35rem; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.cx-card { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem; border-radius: .8rem;
  border: 1px solid rgba(128,128,128,.3); background: rgba(128,128,128,.06); transition: border-color .2s, box-shadow .2s; }
.cx-card:hover { border-color: var(--ds-neon, #39FF14); box-shadow: 0 0 0 1px var(--ds-neon, #39FF14) inset; }
.cx-head { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.cx-head i { color: var(--ds-neon, #39FF14); }
.cx-sub { font-size: .82rem; color: var(--bs-secondary-color); margin-top: -.25rem; }
.cx-card .btn { margin-top: auto; }
.cx-hint { font-size: .78rem; color: var(--bs-secondary-color); }
.cx-wait { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; border-radius: .4rem;
  border: 1px dashed var(--ds-neon, #39FF14); color: var(--ds-neon, #39FF14); font-weight: 600; font-size: .92rem; }
.cx-pulse { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ds-neon, #39FF14); flex: none; animation: cxPulse 1.3s ease-out infinite; }
@keyframes cxPulse { 0% { box-shadow: 0 0 0 0 rgba(57,255,20,.7) } 100% { box-shadow: 0 0 0 10px rgba(57,255,20,0) } }
.cx-foot { margin-top: .7rem; font-size: .82rem; color: var(--bs-secondary-color); }
.cx-foot b { color: var(--bs-body-color); }
/* raw strip under the trigger bars (Series / One / SCUF window) */
.xbt-raw { position: relative; height: 8px; margin-top: 4px; border-radius: 4px; background: rgba(128,128,128,.22); overflow: hidden; }
.xbt-raw .xbt-seen { border: 0; background: rgba(57,255,20,.35); }
.xbt-raw .xbt-dz { opacity: 0; }
.xbt-rawknob { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 4px #fff; }

/* Elite trigger capture gauge (drawn every frame) */
.xbe-ring { flex: none; }
.xbe-ring circle { fill: none; stroke-linecap: round; }
.xbe-track { stroke: rgba(128,128,128,.28); stroke-width: 10; }
.xbe-arc { stroke: var(--ds-neon, #39FF14); stroke-width: 10; filter: drop-shadow(0 0 4px var(--ds-neon, #39FF14)); }
.xbe-ring .xbe-dot { fill: var(--bs-body-bg, #111); stroke: var(--ds-neon, #39FF14); stroke-width: 4; }
.xbe-count { font: 700 34px system-ui, sans-serif; fill: var(--bs-body-color); text-anchor: middle; dominant-baseline: middle; }
.xbe-pct { font: 500 15px ui-monospace, monospace; fill: var(--bs-secondary-color, #999); text-anchor: middle; }
.xbe-tick { fill: none; stroke: var(--ds-neon, #39FF14); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transform-origin: 100px 150px; transition: opacity .2s, transform .2s; }
.xbe-tick.on { opacity: 1; transform: scale(1); }
/* Series / One trigger window: the rings carry the live display, the slim raw strip under them shows travel and dead zones */
.xbt-slim .xbt-track.main { display: none; }
.xbt-slim .xbt-raw { margin-top: 0; }

/* ---------------- Xbox page: same calm two-column layout as the PlayStation page ---------------- */
.xbx-page { max-width: 1140px; }
.xbx-card .card-header { font-weight: 600; }
.xbx-card .card-body { padding: 1rem 1.25rem; }
/* Controller info: label on the left, value on the right, one per line */
.xbx-kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem; padding: .45rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent); font-size: .95rem; line-height: 1.35; }
.xbx-kv-row:last-child { border-bottom: 0; }
.xbx-kv-row .k { color: var(--bs-secondary-color); white-space: nowrap; }
.xbx-kv-row .v { font-family: var(--bs-font-monospace); font-size: .9rem; color: var(--bs-body-color); text-align: right; }
.xbx-kv-row .v .xbx-wrap { font-family: var(--bs-body-font-family); font-size: .85rem; color: var(--bs-secondary-color); }
.xbx-kv-row.extra { display: none; }
#xbox-info.all .xbx-kv-row.extra { display: flex; }
.xbx-kv-row .xbx-pill { font-family: var(--bs-body-font-family); }
/* the controller picture: big and centred under the info card */
.xbx-art { margin: 1.5rem auto 0; text-align: center; }
.xbx-art svg { width: 100%; max-width: 480px; height: auto; }
/* actions */
#xbox-actions .ds-btn { padding: .55rem 1rem; font-size: .95rem; }
.xbx-tips { font-size: .9rem; color: var(--bs-secondary-color); }
.xbx-tips summary { cursor: pointer; }
/* joystick card */
.xbx-dial-name { font-weight: 600; font-size: .95rem; margin-bottom: .25rem; }
.xbx-axes { display: flex; justify-content: space-around; margin-top: .5rem; font-size: .9rem; }
.xbx-axes span { display: flex; flex-direction: column; align-items: center; color: var(--bs-secondary-color); }
.xbx-axes b { color: var(--bs-body-color); font-weight: 600; }
.xbx-hint { font-size: .85rem; color: var(--bs-secondary-color); }
.xbx-trig { font-size: .9rem; }
.xbx-logbox summary { cursor: pointer; color: var(--bs-secondary-color); }


/* ---------------- Xbox pages and windows: one font, two sizes ----------------
   Everything uses the page font; numbers use tabular figures so they line up without a typewriter font.
   Only the Xbox log stays monospace. Normal text 0.95rem, secondary text 0.85rem. */
#xboxmenu, #xboxbar, #xboxModal { --x-fs: .95rem; --x-fs-sm: .85rem; }
#xboxmenu, #xboxbar, #xboxModal .modal-body, #xboxModal .modal-footer { font-size: var(--x-fs); }
#xboxmenu .font-monospace:not(.xbx-log), #xboxModal .font-monospace, .xbx-kv-row .v, .xbx-axes,
#xboxModal table, #xboxModal code { font-family: var(--bs-body-font-family) !important; font-variant-numeric: tabular-nums; }
#xboxmenu .small, #xboxmenu small, #xboxModal .small, #xboxModal small, .xbx-hint, .xbx-tips, #xboxModal .form-text { font-size: var(--x-fs-sm) !important; }
.xbx-kv-row, .xbx-kv-row .v, .xbx-trig, .xbx-axes, #xbox-actions .btn, #xboxModal .btn { font-size: var(--x-fs); }
#xboxmenu .btn-sm, #xboxModal .btn-sm { font-size: var(--x-fs-sm); }
#xboxmenu .card-header, #xboxModal .modal-title { font-size: 1.05rem; font-weight: 600; }

#xboxModal .btn-group-sm > .btn { font-size: var(--x-fs-sm); }

/* ---------------- Xbox page: tighter spacing ---------------- */
.xbx-bar { max-width: 1140px; margin: 0 auto .75rem; padding: .5rem .75rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  border: 1px solid var(--bs-border-color); border-radius: .6rem; font-size: var(--x-fs, .95rem); }
.xbx-bar-name { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-right: auto; }
.xbx-page .row.g-4 { --bs-gutter-y: 1rem; }
.xbx-page .card-header { padding: .55rem 1rem; }
.xbx-card .card-body { padding: .75rem 1.1rem; }
.xbx-kv-row { padding: .38rem 0; }
.xbx-art { margin-top: 1rem; }
.xbx-art svg { max-width: 430px; }
#xbox-actions { gap: .45rem !important; }
#xbox-actions .ds-btn { padding: .5rem 1rem; }
.xbx-revert { align-self: center; color: var(--bs-secondary-color); text-decoration: none; padding: .1rem; }
.xbx-revert:hover { color: var(--bs-body-color); text-decoration: underline; }
.xbx-page .card.mt-3 { margin-top: .75rem !important; }
.xbx-dials canvas { max-width: 210px; }
.xbx-axes { margin-top: .35rem; }
.xbx-logbox { margin-top: .5rem !important; }

.xbx-pill { font-size: .72rem !important; }

/* ---------------- Backups & restore (one row layout, fixed columns) ---------------- */
.bk-dialog { max-width: 980px; }
.bk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.bk-adv summary { cursor: pointer; color: var(--bs-secondary-color); }
.bkg { border: 1px solid var(--bs-border-color); border-radius: .6rem; margin-bottom: 1rem; overflow: hidden; }
.bkg.mine { border-color: var(--ds-neon, var(--bs-primary)); }
.bkg > header { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: var(--bs-tertiary-bg); border-bottom: 1px solid var(--bs-border-color); }
.bkg > header b { font-size: 1rem; }
.bkg-meta { margin-left: auto; color: var(--bs-secondary-color); font-size: .85rem; font-variant-numeric: tabular-nums; }
.bkg-sub { padding: .55rem 1rem .3rem calc(1rem + 3px); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-secondary-color); border-top: 1px solid var(--bs-border-color); }
.bkg-more { margin: .25rem 0 .5rem calc(1rem + 3px); padding: 0; font-size: .85rem; }
/* every row: 3px accent · when · what · status · actions */
.bkr { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 8.5rem 17.5rem; column-gap: 1rem; align-items: center;
  min-height: 3.4rem; padding: .45rem 1rem; border-left: 3px solid transparent; font-size: .95rem; }
.bkr + .bkr { border-top: 1px solid var(--bs-border-color-translucent); }
.bkr.orig { border-left-color: #198754; background: rgba(25, 135, 84, .08); }
.bkr.latest { border-left-color: #0d6efd; background: rgba(13, 110, 253, .07); }
.bkr-when b { display: block; font-weight: 600; white-space: nowrap; }
.bkr-when span, .bkr-what span { display: block; color: var(--bs-secondary-color); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkr-what b { font-weight: 500; }
.bkr-status { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.bkr-badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; line-height: 1.5; padding: 0 .45rem; border-radius: .3rem; white-space: nowrap; }
.bkr-badge.orig { background: #198754; color: #fff; }
.bkr-badge.latest { background: #0d6efd; color: #fff; }
.bkr-badge.now { color: var(--ds-neon, #198754); border: 1px solid currentColor; font-weight: 600; }
.bkr-badge.conn { border: 1px solid currentColor; font-weight: 600; }
.bkr-act { display: grid; grid-template-columns: 6.6rem 7.2rem 1.6rem 1.6rem; gap: .3rem; align-items: center; justify-items: stretch; }
.bkr-act .btn-outline-warning { width: 100%; padding: .2rem .3rem; font-size: .8rem; white-space: nowrap; }
.bkr-icon { display: flex; justify-content: center; }
.bkr-icon .btn { padding: 0; color: var(--bs-secondary-color); line-height: 1; }
.bkr-icon .btn:hover { color: var(--bs-body-color); }
.bkr-icon .btn.del:hover { color: var(--bs-danger); }
@media (max-width: 900px) { .bkr { grid-template-columns: 1fr auto; row-gap: .35rem; } .bkr-status { flex-direction: row; } .bkr-act { grid-column: 1 / -1; } }
.bkr-slot { display: block; min-width: 0; }

/* ---------------- Calibrate sticks window ---------------- */
.cal-dialog { max-width: min(1180px, 96vw); }
#xboxModal .cal-dialog .modal-body { padding: 1rem 1.25rem; }
.cal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.cal-left { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: 1rem; }
.cal-dials { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cal-dial { text-align: center; }
.cal-dial-name { font-weight: 600; font-size: 1.05rem; margin-bottom: .35rem; }
.cal-dial canvas { width: 100%; max-width: 250px; aspect-ratio: 1; display: block; margin: 0 auto; }
.cal-dial .xbx-ring { margin: .4rem auto 0; min-height: 6px; }
.cal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .6rem; }
.cal-stat { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .35rem .25rem; }
.cal-stat b { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cal-stat span { font-size: .8rem; color: var(--bs-secondary-color); }
.cal-stat.good b { color: var(--bs-success-text-emphasis, #198754); }
.cal-stat.warn b { color: var(--bs-warning-text-emphasis, #b58100); }
.cal-stat.bad b { color: var(--bs-danger-text-emphasis, #dc3545); }
.cal-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }
.cal-tools .btn { font-size: .95rem; }
.cal-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .6rem; font-size: .85rem; color: var(--bs-secondary-color); align-items: center; }
.cal-legend .sw { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.cal-legend .sw.blue { background: hsl(220 85% 58%); } .cal-legend .sw.yellow { background: hsl(55 90% 50%); } .cal-legend .sw.purple { background: hsl(285 70% 60%); }
.cal-right { display: flex; flex-direction: column; gap: .8rem; }
.cal-steps { display: flex !important; gap: .35rem; }
.cal-steps .xbt-step { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-steps .xbt-step { font-size: .85rem; padding: .4rem .2rem; opacity: .75; white-space: nowrap; }
.cal-steps .xbt-step span { margin-right: .3em; }
.cal-steps .xbt-step.active, .cal-steps .xbt-step.done { opacity: 1; }
.cal-stagebox { display: flex; align-items: center; gap: 1.1rem; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: .9rem 1.1rem; }
.cal-stagebox #xbsGauge { flex: none; }
.cal-stagetext { flex: 1; min-width: 0; }
.cal-title { font-size: 1.35rem; font-weight: 700; line-height: 1.2; margin-bottom: .3rem; }
.cal-text { font-size: 1rem; color: var(--bs-body-color); line-height: 1.45; }
#xbsSide { margin-top: .5rem; }
.cal-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cal-controls .btn, .cal-controls .form-select { font-size: 1rem; }
.cal-controls #xbsGo { padding-left: 1.5rem; padding-right: 1.5rem; font-weight: 600; }
.cal-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
.cal-result { border: 1px solid var(--bs-border-color); border-left-width: 4px; border-radius: .6rem; padding: .7rem .9rem; background: var(--bs-tertiary-bg); }
.cal-result.good { border-left-color: var(--bs-success); } .cal-result.bad { border-left-color: var(--bs-danger); }
.cal-result-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: 1.05rem; }
.cal-metric { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--bs-border-color-translucent); }
.cal-metric > span { color: var(--bs-secondary-color); font-size: .9rem; }
.cal-metric > div { display: flex; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }
.cal-metric em { font-style: normal; color: var(--bs-secondary-color); font-size: .95rem; }
.cal-metric b { font-size: 1.35rem; }
.cal-metric i { font-size: .75rem; color: var(--bs-secondary-color); }
.cal-metric .good { color: var(--bs-success-text-emphasis, #198754); } .cal-metric .warn { color: var(--bs-warning-text-emphasis, #b58100); } .cal-metric .bad { color: var(--bs-danger-text-emphasis, #dc3545); }
.cal-metric em.good, .cal-metric em.warn, .cal-metric em.bad { opacity: .75; }
.cal-more { margin-top: .5rem; font-size: .92rem; }
.cal-more summary { cursor: pointer; color: var(--bs-secondary-color); padding: .2rem 0; }
.cal-more summary:hover { color: var(--bs-body-color); }
.cal-note { font-size: .85rem; color: var(--bs-secondary-color); }
#xboxModal .cal-dialog .modal-footer .btn { font-size: 1rem; padding: .5rem 1.25rem; }
@media (max-width: 991px) { .cal-grid { grid-template-columns: 1fr; } }


/* Xbox screen: audio test card */
.xbx-audio .card-body { font-size: .85rem; }
.xa-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 6px 0; }
.xa-row select { min-width: 0; }
.xa-row b { min-width: 3em; text-align: right; font-variant-numeric: tabular-nums; }
.xa-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.xa-note { margin-bottom: 6px; color: var(--bs-secondary-color); }
.xa-ok { color: var(--ds-neon, #39ff14); font-weight: 700; }
.xa-hint { font-size: .76rem; color: var(--bs-secondary-color); }
.xa-wave { width: 100%; height: 110px; display: block; border: 1px solid var(--bs-border-color); border-radius: 8px; background: rgba(0,0,0,.25); margin-top: 6px; }
.xa-meter { position: relative; height: 10px; border-radius: 5px; background: var(--bs-tertiary-bg, #222); margin: 8px 0 4px; overflow: hidden; }
.xa-meter > div { height: 100%; width: 0; background: linear-gradient(90deg, #39ff14 0 70%, #ffb020 70% 90%, #ff3b3b 90%); background-size: 100vw 100%; transition: width .05s linear; }
.xa-meter > i { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 0; }
.xa-stats { font-size: .78rem; } .xa-clip { color: #ff3b3b; } .xa-quiet { color: #ffb020; }
.xa-recdot { color: #ff3b3b; animation: xa-blink 1s steps(2) infinite; } @keyframes xa-blink { 50% { opacity: .2; } }
.xa-step { border: 1px solid var(--bs-border-color); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.xa-step h6 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 700; }
.xa-step h6 small { font-weight: 400; color: var(--bs-secondary-color); font-size: .75rem; }
.xa-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ds-neon, #39ff14); color: #071006; font-size: .8rem; font-weight: 800; }
.xa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 6px 0; }
.xa-b { white-space: nowrap; font-weight: 600; }
.xa-wide { width: 100%; margin-bottom: 4px; }
.xa-done { color: var(--ds-neon, #39ff14); font-weight: 700; }
.xa-ok-step { opacity: .75; } .xa-ok-step .xa-hint { display: none; }
.xa-step .xa-row label { color: var(--bs-secondary-color); }
.xa-btns { display: none; }
.xa-hint summary { cursor: pointer; color: var(--ds-neon, #39ff14); }

/* audio test, compact layout (build cl) */
.xbx-audio .card-body { padding: 10px 12px; }
.xa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 575px) { .xa-cols { grid-template-columns: 1fr; } }
.xa-part { border: 1px solid var(--bs-border-color); border-radius: 10px; padding: 8px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.xa-part h6 { margin: 0; font-weight: 700; font-size: .85rem; display: flex; gap: 6px; align-items: center; }
.xa-part h6 i { color: var(--ds-neon, #39ff14); }
.xa-part .xa-grid { margin: 0; }
.xa-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.xa-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.xa-cols .xa-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.xa-part .xa-b { padding: 3px 4px; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.xa-part .xa-wide { margin: 0; }
.xa-part .xa-row { grid-template-columns: 3.6em minmax(0, 1fr) 3.4em; margin: 0; font-size: .78rem; }
.xa-part .xa-wave { height: 64px; margin: 0; }
.xa-part .xa-meter { margin: 0; }
.xa-part .xa-stats { font-size: .72rem; min-height: 2.2em; }
.xa-part details { font-size: .72rem; }
.xa-perm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px; margin-bottom: 8px; border: 1px dashed var(--ds-neon, #39ff14); border-radius: 10px; }
.xa-perm[hidden] { display: none; }
.xa-perm .xa-hint { flex: 1 1 200px; font-size: .74rem; }
.xa-note:empty { display: none; }
.xa-note { font-size: .78rem; margin-bottom: 6px; }
.xa-part .xa-row { grid-template-columns: 3.4em minmax(0, 1fr) 4.4em; }
.xa-part .xa-row b { white-space: nowrap; }
/* leave room for the audio card under the controller picture */
#xboxmenu .xbx-art { margin-top: .5rem; }
#xboxmenu .xbx-art svg { max-height: none; }
.xa-part .xa-row { grid-template-columns: 4.4em minmax(0, 1fr) 4.4em; }
.xa-part .xa-row label { white-space: nowrap; }
.xa-pick .xa-allow { display: block; width: 100% !important; }

/* Xbox screen tidy-up (build cq) */
#xboxmenu .xbx-art svg { width: 100%; max-width: 560px; max-height: 360px; }
.xbx-infohead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xbx-infohead i.fa-gamepad { color: var(--ds-neon, #39ff14); }
.xbx-infohead .badge { font-size: .68rem; }
.xbx-details { font-size: .8rem; color: var(--ds-neon, #39ff14); text-decoration: none; }
.xbx-details:hover { text-decoration: underline; }
.xbx-x { padding: 1px 6px; color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); }
.xbx-x:hover { color: #ff5a5a; border-color: #ff5a5a; }
.xbx-details[hidden] + .xbx-x { margin-left: auto; }
.xbx-livenote { font-size: .78rem; color: var(--bs-secondary-color); margin-top: 6px; line-height: 1.35; }
.xbx-livenote b { color: var(--bs-body-color); }
.xbx-tip { color: var(--bs-secondary-color); cursor: help; font-size: .85rem; }
/* trigger gauges */
.xbx-gauges { display: grid; gap: 8px; margin-top: 10px; }
.xbx-tg { display: grid; grid-template-columns: 28px minmax(0, 1fr) 46px; gap: 10px; align-items: center; }
.xbx-tg-l { font-weight: 800; font-size: .8rem; letter-spacing: .04em; color: var(--bs-secondary-color); text-align: left; }
.xbx-tg-track { position: relative; height: 14px; border-radius: 7px; background: rgba(128,128,128,.14); border: 1px solid rgba(128,128,128,.28); overflow: hidden; }
.xbx-tg-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 7px; background: linear-gradient(90deg, rgba(57,255,20,.35), var(--ds-neon, #39ff14)); box-shadow: 0 0 8px rgba(57,255,20,.45); }
.xbx-tg-track > i { position: absolute; top: 3px; bottom: 3px; width: 1px; background: rgba(200,200,200,.25); }
.xbx-tg-pk { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; opacity: 0; }
.xbx-tg-pk.on { opacity: .8; } .xbx-tg-pk.full { background: var(--ds-neon, #39ff14); opacity: 1; }
.xbx-tg-v { text-align: right; font-weight: 700; font-size: .85rem; }

/* ---- global scale (build cr): the base text size follows the screen width, and everything sized in rem
   (nearly all of the site) follows it: 14 px on laptops, ~16 px at 1080p, ~19 px at 1440p, 20 px on 4K.
   The page width grows with it, and fit-page.js then shrinks the page to the window height if needed. */
html { font-size: clamp(14px, calc(8px + 0.42vw), 20px); }
@media (min-width: 1200px) { .container { max-width: min(95vw, 71.25rem); } }
@media (min-width: 1400px) { .container { max-width: min(95vw, 82.5rem); } }

/* navbar: Advanced testing as a proper button */
.bench-nav-btn { margin: .25rem .75rem .25rem 0; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }

/* Xbox screen: live-test note in the same type as the rows above */
.xbx-livenote { font-size: var(--x-fs) !important; line-height: 1.5; padding-top: .5rem; margin-top: .35rem; border-top: 1px solid var(--bs-border-color); }
.xbx-livenote b { font-weight: 600; }

/* Set up calibration access: gentle pulse so it's noticed straight away */
.xbx-pulse { animation: xbx-pulse 1.6s ease-in-out infinite; }
@keyframes xbx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57,255,20,.0); filter: brightness(1); }
  50% { box-shadow: 0 0 0 .35rem rgba(57,255,20,.35), 0 0 1.4rem rgba(57,255,20,.55); filter: brightness(1.12); }
}
.xbx-pulse:hover, .xbx-pulse:focus { animation: none; }
@media (prefers-reduced-motion: reduce) { .xbx-pulse { animation: none; } }

/* main page buttons: same height and type everywhere */
#xbox-actions .ds-btn { padding: .5rem .75rem; font-weight: 600; }
.bench-nav-right { margin: 0 0 0 1rem !important; order: 99; }
/* the two mode buttons: same size and right edge, so switching modes never moves them */
.bench-nav-right, .bench-simple { width: 11.5rem; display: inline-flex !important; align-items: center; justify-content: center; gap: .35rem; }
.bench-nav-right, .bench-simple { box-sizing: border-box; }
.bench-nav-right { position: relative; top: 0; }

/* ---- matching top bars (build cw): status pill on the left, theme + mode button on the right ---- */
body > nav.navbar { min-height: 3.25rem; padding-top: .25rem; padding-bottom: .25rem; }
.nav-conn { display: inline-flex; align-items: center; gap: .45rem; margin-left: .5rem; padding: .25rem .7rem; border-radius: 999px; border: 2px solid currentColor;
  font-weight: 800; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.nav-conn .dot { width: .7rem; height: .7rem; border-radius: 50%; background: currentColor; }
.nav-conn .dev { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--bs-body-color); margin-left: .25rem; }
.nav-conn .dev:empty { display: none; }
.nav-conn[data-state="on"] { color: #22c55e; }
.nav-conn[data-state="on"] .dot { box-shadow: 0 0 10px #22c55e; }
.nav-conn[data-state="off"] { color: var(--bs-secondary-color); border-color: var(--bs-border-color); }
@media (max-width: 991px) { .nav-conn .dev { display: none; } }
.nav-right { gap: 0; }
/* same pill as Advanced testing's */
.nav-conn { font-size: 1.05rem; padding: 4px 14px 4px 10px; gap: 8px; line-height: 1.3; }
.nav-conn .dot { width: 14px; height: 14px; }
.nav-conn .dev { font-size: .95rem; margin-left: .5rem; }
.nav-conn { border: 2px solid currentColor; }
/* narrower screens: keep the top bar on one line */
@media (max-width: 1500px) { body > nav.navbar a.badge[href*="github"] { display: none; } }
@media (max-width: 1400px) { .nav-conn .dev { display: none; } body > nav.navbar .navbar-brand { font-size: 1.1rem; } }
@media (max-width: 1200px) { #langMenuButton #curLang { display: none; } }
.xa-tip { font-size: .8em; opacity: .7; cursor: help; margin-left: .25rem; }
.nav-conn[data-state="unstable"] { color: #ffb020; }
.nav-conn[data-state="unstable"] .dot { animation: bench-blink .6s steps(2) infinite; }
@keyframes bench-blink { 50% { opacity: .2; } }
/* SCUF tick box under the controller drawing */
.scuf-tog { display: flex; justify-content: center; margin: .25rem 0 .5rem; }
.scuf-tog label { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border: 1px solid var(--bs-border-color); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.scuf-tog label:hover { border-color: var(--ds-neon, #39ff14); }
.scuf-tog span { color: var(--bs-secondary-color); font-size: .82rem; }
.scuf-tog input { width: 1.05rem; height: 1.05rem; accent-color: var(--ds-neon, #39ff14); }
/* log-in box in the top bars: a button; the fields drop down under it */
.lgn { position: relative; display: inline-flex; align-items: center; margin-right: 1rem; }
.lgn-btn { white-space: nowrap; }
.lgn-form { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1090; display: flex; flex-direction: column; gap: .4rem; width: 15rem;
  padding: .75rem; background: var(--bs-body-bg); border: 1px solid var(--ds-neon, #39ff14); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.lgn-form[hidden] { display: none; }
.lgn-form.bad input { border-color: #ef4444; animation: lgn-shake .3s; }
@keyframes lgn-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.lgn-msg { color: #ef4444; font-size: .78rem; min-height: 0; }
.lgn-msg:empty { display: none; }
.lgn-who { font-size: .88rem; font-weight: 600; white-space: nowrap; }
.lgn-out { padding: 0 0 0 .5rem; font-size: .82rem; }
.bench-tools > .lgn { order: 9; margin: 0 .5rem 0 .25rem; }
/* ☰ Menu (side-menu.js): slides in from the left on both screens */
.sm-ham { display: inline-flex; align-items: center; gap: .5rem; height: 2.1rem; padding: 0 .85rem; margin-right: .85rem; flex: none;
  border: 1.5px solid var(--ds-neon, #39ff14); border-radius: 8px; background: transparent; color: var(--ds-accent-text, var(--ds-neon, #39ff14)); font-weight: 700; }
.sm-ham:hover, .sm-ham.active { background: rgba(var(--ds-neon-rgb, 57,255,20), .12); }
.sm-bars { display: inline-flex; flex-direction: column; gap: 3px; width: 15px; }
.sm-bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
.sm-shade { position: fixed; inset: 0; z-index: 1990; background: rgba(0, 0, 0, .45); }
.sm-side { position: fixed; left: 0; top: 0; bottom: 0; width: 310px; max-width: 88vw; z-index: 1995; display: flex; flex-direction: column;
  background: var(--bs-body-bg); border-right: 1.5px solid var(--ds-neon, #39ff14); box-shadow: 8px 0 30px rgba(0, 0, 0, .45); }
.sm-side.in { animation: sm-in .16s ease-out; }
@keyframes sm-in { from { transform: translateX(-24px); opacity: 0; } }
.sm-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--bs-border-color); }
.sm-head b { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.05rem; letter-spacing: .05em; text-transform: uppercase; }
.sm-body { overflow: auto; padding: 4px 10px 14px; flex: 1; }
.sm-sec { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bs-secondary-color); margin: 14px 8px 4px; }
.sm-it { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--bs-body-color); text-align: left; font-size: .95rem; }
.sm-it:hover, .sm-it:focus-visible { background: rgba(var(--ds-neon-rgb, 57,255,20), .1); outline: none; }
.sm-it.on { background: rgba(var(--ds-neon-rgb, 57,255,20), .16); box-shadow: inset 3px 0 0 var(--ds-neon, #39ff14); }
.sm-it > i, .sm-row > i { width: 20px; text-align: center; color: var(--ds-accent-text, var(--ds-neon, #39ff14)); flex: none; }
.sm-lbl { flex: 1; min-width: 0; }
.sm-lbl small { display: block; color: var(--bs-secondary-color); font-size: .75rem; line-height: 1.2; }
.sm-side kbd { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); font-size: .68rem; padding: 1px 5px; flex: none; }
.sm-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; font-size: .95rem; }
.sm-row kbd { order: 3; }
.sm-ctl { display: inline-flex; align-items: center; flex: none; }
.sm-ctl select { width: auto; max-width: 160px; margin: 0 !important; }
.sm-ctl .form-switch { margin: 0; padding-left: 2.5em; min-height: 0; }
.sm-ctl .bench-themesw { padding: 0; }
.sm-foot { border-top: 1px solid var(--bs-border-color); padding: 10px 16px; font-size: .76rem; color: var(--bs-secondary-color); }
/* what the menu now holds comes off the bars */
.bench-tools > :not(.bench-simple):not(.lgn) { display: none !important; }
body.has-side-menu #navbarNavDropdown, body.has-side-menu .navbar-toggler, body.has-side-menu .nav-right > li.nav-item { display: none !important; }
nav.navbar > .container-fluid { flex-wrap: nowrap; }
body.has-side-menu nav.navbar > .container-fluid { justify-content: flex-start; }
body.has-side-menu nav.navbar .nav-right { margin-left: auto; }
.sm-row .sm-lbl { white-space: nowrap; }
.sm-ctl select { max-width: 145px; }
/* credits: in the menu's About section instead of a footer bar */
body.has-side-menu > footer.fixed-bottom { display: none !important; }
.sm-block { padding: 2px 10px 6px; }
.sm-block .sm-ctl { display: block; }
.sm-block #footbody, .sm-block > .sm-ctl > div { display: block !important; padding: 0 !important; }
.sm-block p { font-size: .78rem; line-height: 1.45; color: var(--bs-secondary-color); margin: 0 0 .5rem; }
.sm-block ul { display: flex; gap: .9rem; margin: 0; padding: 0; list-style: none; }
.sm-block ul li { margin: 0 !important; }
.sm-row .sm-lbl { overflow: hidden; text-overflow: ellipsis; }
.sm-ctl select { max-width: 128px; }

/* side menu: collapsible sections */
.sm-tog { display: flex; width: calc(100% - 16px); padding: 0; justify-content: space-between; align-items: center; background: none; border: 0; cursor: pointer; color: inherit; text-align: left; }
.sm-tog i { font-size: .7em; transition: transform .15s; }
.sm-tog.open i { transform: rotate(180deg); }

/* who's on the site (admin) */
.vis-shade { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; }
.vis-shade[hidden] { display: none; }
.vis-box { background: var(--bs-body-bg, #1b1b1b); color: var(--bs-body-color, #eee); border: 1.5px solid var(--ds-neon, #39ff14); border-radius: 12px; width: min(900px, 100%); max-height: 86vh; display: flex; flex-direction: column; }
.vis-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--bs-border-color, #333); }
.vis-body { padding: 12px 16px; overflow: auto; }
.vis-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.vis-tiles div { background: rgba(127,127,127,.12); border-radius: 8px; padding: 8px; text-align: center; }
.vis-tiles b { display: block; font-size: 1.4rem; } .vis-tiles span { font-size: .78rem; opacity: .75; }
.vis-t { width: 100%; border-collapse: collapse; font-size: .85rem; }
.vis-t th, .vis-t td { padding: 6px; border-bottom: 1px solid var(--bs-border-color, #333); text-align: left; vertical-align: top; }
.vis-t th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.vis-t small { opacity: .7; } .vis-t code { font-size: .8rem; }
.vis-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.vis-note { font-size: .76rem; opacity: .7; margin: 10px 0 0; }

/* interface tips: small, bottom left, out of the way */
.tip-card { position: fixed; left: 14px; bottom: 14px; z-index: 1900; width: min(340px, calc(100vw - 28px)); padding: 10px 12px 9px; border-radius: 10px;
  background: rgba(var(--ds-d-surface-rgb, 22,22,22), .96); color: var(--bs-body-color, #e8e8e8); border: 1px solid rgba(var(--ds-neon-rgb), .45);
  box-shadow: 0 6px 24px rgba(0,0,0,.45); font-size: .84rem; line-height: 1.4; opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s; }
[data-bs-theme="light"] .tip-card { background: rgba(255,255,255,.97); }
.tip-card.in { opacity: 1; transform: none; }
.tip-top { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ds-neon); font-weight: 700; margin-bottom: 4px; }
.tip-x { border: 0; background: none; color: inherit; opacity: .6; font-size: 1.2rem; line-height: 1; padding: 0 2px; }
.tip-x:hover { opacity: 1; }
.tip-text kbd { font-size: .75rem; padding: 1px 5px; }
.tip-foot { display: flex; gap: 10px; align-items: center; margin-top: 7px; }
.tip-go { border: 1px solid var(--ds-neon); background: transparent; color: var(--ds-neon); border-radius: 6px; padding: 2px 10px; font-weight: 600; font-size: .8rem; }
.tip-go:hover { background: rgba(var(--ds-neon-rgb), .15); }
.tip-off { margin-left: auto; border: 0; background: none; color: var(--bs-secondary-color); font-size: .74rem; text-decoration: underline; padding: 0; }
.tip-point { outline: 3px solid var(--ds-neon) !important; outline-offset: 3px; animation: tip-pulse 1s ease-in-out 3; border-radius: 6px; }
@keyframes tip-pulse { 50% { outline-color: rgba(var(--ds-neon-rgb), .2); } }

/* theme creator */
.tc-box { position: fixed; top: 70px; right: 20px; z-index: 2100; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 90px); display: flex; flex-direction: column;
  background: var(--bs-body-bg); color: var(--bs-body-color); border: 1.5px solid var(--ds-neon); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.55); }
.tc-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--bs-border-color); cursor: move; user-select: none; }
.tc-body { padding: 8px 14px; overflow: auto; }
.tc-from { display: flex; gap: 8px; align-items: center; font-size: .85rem; margin-bottom: 4px; } .tc-from select { flex: 1; }
.tc-sec { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bs-secondary-color); margin: 10px 0 2px; }
.tc-row { display: grid; grid-template-columns: 7.5rem 1fr 3rem; gap: 8px; align-items: center; font-size: .85rem; margin: 3px 0; }
.tc-row output { text-align: right; font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--bs-secondary-color); }
.tc-range { width: 100%; accent-color: var(--ds-neon); }
.tc-hue { -webkit-appearance: none; appearance: none; height: 10px; border-radius: 6px; background: var(--tc-track); }
.tc-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #222; box-shadow: 0 0 0 1px #fff; }
.tc-hue::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #222; }
.tc-swatches { display: flex; align-items: center; gap: 6px; margin: 12px 0 4px; font-size: .74rem; color: var(--bs-secondary-color); }
.tc-swatches i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(127,127,127,.4); }
.tc-swatches span { margin-left: 4px; }
.tc-foot { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--bs-border-color); }
.tc-sp { flex: 1; }
.xbx-chanline { min-height: 1.4em; }
.xbx-chan { color: var(--bs-secondary-color); } .xbx-chan.bad { color: #ffb020; }
.tc-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 6px; }
.tc-preset { display: flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid; border-radius: 8px; font-size: .8rem; font-weight: 600; text-align: left; }
.tc-preset i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.tc-preset span { margin-left: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-preset:hover { outline: 2px solid var(--ds-neon); outline-offset: 1px; }
.faq-sec { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ds-neon); padding: 14px 20px 6px; }

/* Set up calibration access: instructions with the how-to film beside them */
.xbx-gw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 40%); gap: 18px; align-items: start; }
.xbx-gw-vid { position: sticky; top: 0; }
.xbx-gw-vt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bs-secondary-color); margin-bottom: 6px; }
@media (max-width: 991px) { .xbx-gw { grid-template-columns: 1fr; } .xbx-gw-vid { position: static; order: -1; } }
[data-sv] { transition: box-shadow .3s, border-color .3s; }
[data-sv].sv-now { border-color: var(--ds-neon) !important; box-shadow: 0 0 0 1px var(--ds-neon), 0 0 14px rgba(var(--ds-neon-rgb), .25); }

.sv { border: 1px solid var(--bs-border-color); border-radius: 10px; overflow: hidden; background: #0c0f14; }
.sv-stage { position: relative; aspect-ratio: 16 / 11; overflow: hidden; font: 11px/1.35 "Segoe UI", system-ui, sans-serif; color: #e6e6e6;
  background: radial-gradient(120% 90% at 20% 10%, #1c3550 0%, #0f1a2a 55%, #0a0f18 100%); }
.sv-stage * { box-sizing: border-box; }
.sv-stage > div { opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none; }
.sv-stage > div.on, .sv-stage > .sv-keys.on { opacity: 1; }
/* the site, small */
.sv-page { position: absolute; left: 6%; top: 8%; width: 88%; height: 62%; background: #1b1b1b; border: 1px solid #39ff14; border-radius: 8px; }
.sv-bar { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-bottom: 1px solid #333; font-weight: 600; font-size: 10px; color: #bbb; }
.sv-bar i { width: 7px; height: 7px; border-radius: 50%; background: #444; }
.sv-bar span { margin-left: 6px; }
.sv-p1, .sv-p2, .sv-p3 { display: none; padding: 14px 12px; }
.sv-p1.on, .sv-p2.on, .sv-p3.on { display: block; }
.sv-cmd { display: flex; gap: 6px; align-items: center; }
.sv-cmd code { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: #0d0d0d; border: 1px solid #444; border-radius: 4px; padding: 5px 6px; color: #aaa; font-size: 9.5px; }
.sv-btn { display: inline-block; background: #39ff14; color: #061206; border-radius: 5px; padding: 5px 10px; font-size: 10.5px; transition: transform .12s, filter .12s; white-space: nowrap; }
.sv-btn.big { display: block; width: 70%; margin: 12px auto 0; text-align: center; padding: 9px; font-size: 12px; }
.sv-btn.down { transform: scale(.94); filter: brightness(.8); }
.sv-ok { opacity: 0; text-align: center; margin-top: 12px; color: #39ff14; font-weight: 700; transition: opacity .3s; } .sv-ok.on { opacity: 1; }
/* keys pressed */
.sv-keys { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); display: flex; gap: 5px; align-items: center; z-index: 9; }
.sv-keys kbd { background: #f2f2f2; color: #111; border-radius: 5px; padding: 4px 8px; font: 700 12px system-ui; box-shadow: 0 3px 0 #999; border: 0; }
.sv-keys span { color: #fff; font-weight: 700; }
/* windows */
.sv-win { position: absolute; background: #f3f3f3; color: #111; border-radius: 7px; box-shadow: 0 12px 30px rgba(0,0,0,.55); overflow: hidden; transform: translateY(6px); }
.sv-win.on { transform: none; }
.sv-t { background: #fff; padding: 5px 9px; font-size: 10px; border-bottom: 1px solid #ddd; }
.sv-b { padding: 8px 10px; }
.sv-small { color: #555; font-size: 9.5px; margin: 3px 0 6px; }
.sv-rb { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.sv-rb b { border: 1px solid #aaa; border-radius: 4px; padding: 3px 12px; font-weight: 500; background: #fff; }
.sv-rb b.pri { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.sv-run { left: 4%; top: 46%; width: 62%; }
.sv-in { display: flex; gap: 5px; align-items: center; margin-top: 6px; }
.sv-in em { flex: 1; min-width: 0; font-style: normal; border: 1px solid #0067c0; background: #fff; padding: 3px 4px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 19px; }
.sv-con { left: 8%; top: 12%; width: 84%; height: 66%; background: #0c0c0c; color: #ccc; }
.sv-con .sv-t { background: #1f1f1f; color: #ddd; border-color: #333; }
.sv-term { font: 10px/1.5 Consolas, ui-monospace, monospace; } .sv-term .g { color: #3ce03c; } .sv-term .q { color: #fff; }
.sv-ask { left: 8%; top: 12%; width: 74%; }
.sv-chk { display: flex; gap: 6px; align-items: center; font-size: 9.5px; }
.sv-chk i { width: 12px; height: 12px; border: 1.5px solid #555; border-radius: 3px; display: inline-block; }
.sv-chk.done i { background: #1a73e8; border-color: #1a73e8; box-shadow: inset 0 0 0 2px #fff; }
.sv-help { left: 14%; top: 10%; width: 72%; height: 80%; display: flex; flex-direction: column; }
.sv-help .sv-b { flex: 1; display: flex; flex-direction: column; }
.sv-help .sv-rb { margin-top: auto; }
.sv-list { border: 1px solid #ccc; border-radius: 4px; padding: 5px 7px; display: flex; flex-direction: column; }
.sv-list.sel { background: #dbeafe; border-color: #1a73e8; }
.sv-list small { color: #555; }
.sv-steps div { margin-top: 4px; color: #888; } .sv-steps div::before { content: '○ '; }
.sv-steps div.done { color: #111; } .sv-steps div.done::before { content: '✓ '; color: #16a34a; font-weight: 700; }
.sv-done { opacity: 0; color: #16a34a; font-weight: 700; margin-top: 6px; transition: opacity .3s; } .sv-done.on { opacity: 1; }
.sv-uac { left: 18%; top: 24%; width: 64%; border-top: 4px solid #0067c0; z-index: 5; }
.sv-pick { left: 14%; top: 30%; width: 70%; }
.sv-item { margin-top: 6px; border: 1px solid #ccc; border-radius: 4px; padding: 5px 7px; } .sv-item.sel { background: #dbeafe; border-color: #1a73e8; }
/* the cable */
.sv-plug { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0; }
.sv-pad { font-size: 54px; }
.sv-cable { width: 32%; height: 6px; background: #888; border-radius: 3px; position: relative; transition: transform .6s ease; }
.sv-cable i { position: absolute; right: -10px; top: -6px; width: 14px; height: 18px; background: #bbb; border-radius: 2px; }
.sv-pc { margin-left: 14px; padding: 12px 8px; border: 2px solid #bbb; border-radius: 4px; font-weight: 700; color: #bbb; }
.sv-plug.out .sv-cable { transform: translateX(-30%); }
/* cursor */
.sv-cur { position: absolute; z-index: 10; overflow: visible; filter: drop-shadow(0 1px 2px #000); transform-origin: 0 0; }
.sv-cur.click { animation: sv-click .35s ease; }
@keyframes sv-click { 40% { transform: scale(.78); } }


@keyframes sv-ring { from { border-color: rgba(57,255,20,.9); transform: scale(.4); } to { border-color: rgba(57,255,20,0); transform: scale(1.6); } }
.sv-stage.paused * { animation-play-state: paused !important; }
/* controls */
.sv-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #11161d; border-top: 1px solid #222; }
.sv-play { border: 1px solid #39ff14; background: transparent; color: #39ff14; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-size: 10px; }
.sv-chips { display: flex; gap: 4px; }
.sv-chips button { border: 1px solid #444; background: transparent; color: #bbb; border-radius: 5px; width: 22px; height: 22px; font-size: 11px; font-weight: 700; padding: 0; }
.sv-chips button.on { border-color: #39ff14; color: #071006; background: #39ff14; }
.sv-cap { font-size: .8rem; color: #ddd; }
.sv-prog { height: 3px; background: #1d232b; } .sv-prog i { display: block; height: 100%; width: 0; background: #39ff14; }
/* Xbox: calibration tips (easy to read) and the Xbox log (logged in only) */
.xbx-tipsbox { border: 1px solid var(--bs-border-color); border-radius: 10px; padding: 8px 14px; background: rgba(var(--ds-neon-rgb), .04); }
.xbx-tipsbox summary { cursor: pointer; font-weight: 600; font-size: 1rem; }
.xbx-tipsbox summary i { color: var(--ds-neon); }
.xbx-tipsbox ul { margin: 10px 0 4px; padding-left: 1.2rem; font-family: Inter, "Segoe UI", system-ui, sans-serif; font-size: .95rem; line-height: 1.6; color: var(--bs-body-color); }
.xbx-tipsbox li + li { margin-top: 6px; }
.xbx-logbox { display: none; }
body.logged-in .xbx-logbox { display: block; }

/* AIO Dead Zone: logo, stencil name and the slogan of the day */
.navbar .navbar-brand.dz-brand { display: flex; align-items: center; gap: 10px; padding: 2px 0; margin-right: 12px; width: 440px; max-width: 46vw; min-width: 0; font-size: 0; }
.dz-mark { display: inline-flex; align-items: center; flex: none; }
.dz-mark img.dz-company { display: block; width: auto; max-width: 150px; object-fit: contain; border-radius: 4px; }
.dz-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.dz-word { display: block; flex: none; filter: drop-shadow(0 0 6px rgba(var(--ds-neon-rgb), .25)); }
[data-bs-theme="light"] .dz-word, [data-bs-theme="light"] .dz-logo { filter: none; }
[data-bs-theme="light"] .dz-brand { --ds-neon: var(--ds-l-accent); }
.dz-slogan { font: italic 600 .74rem/1.2 Inter, "Segoe UI", system-ui, sans-serif; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bench-top .dz-mark { margin-right: 2px; }
.bench-top .dz-mark img.dz-company { max-width: 90px; }
/* the Build line at the foot of the side menus */
.sm-build { border: 1px solid rgba(var(--ds-neon-rgb), .5); background: transparent; color: var(--ds-neon); border-radius: 6px; padding: 2px 8px; font: 600 .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; }
.sm-build:hover { background: rgba(var(--ds-neon-rgb), .12); }
