html {
	min-height: 100%;
	background: #edf2f8;
}

body {
	font-family: Arial, sans-serif;
	margin: 0;
	padding: 28px 16px 48px;
	color: #182230;
	min-height: 100vh;
	background-color: #edf2f8;
	background-image: linear-gradient(180deg, #f3f6fb 0%, #edf2f8 100%);
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
}

.page-shell {
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
}

.page-header {
	margin-bottom: 14px;
}


.page-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.page-badge {
	display: inline-flex;
	align-items: center;
	padding: 5px 14px;
	border-radius: 999px;
	background: #eaf2ff;
	color: #0b63ce;
	font-size: 20px;
	font-weight: bold;
	letter-spacing: 0.02em;
	margin-bottom: 1px;
}

.page-header h1 {
	margin: 0;
	font-size: 24px;
	line-height: 1.15;
}

.page-header p {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: #475467;
}

.stage-tracker {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 14px;
}

.stage-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid #dbe4ee;
	font-size: 11px;
	color: #475467;
	box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}

.stage-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #eef2f6;
	color: #344054;
	font-size: 11px;
	font-weight: bold;
	flex: 0 0 auto;
}

.stage-text {
	font-weight: bold;
	line-height: 1.1;
}

.stage-item.is-active {
	border-color: #84caff;
	background: #eff8ff;
	color: #0b63ce;
}

.stage-item.is-active .stage-number {
	background: #0b63ce;
	color: #fff;
}

.stage-item.is-complete {
	border-color: #a6f4c5;
	background: #ecfdf3;
	color: #067647;
}

.stage-item.is-complete .stage-number {
	background: #12b76a;
	color: #fff;
}

.container {
	background: rgba(255, 255, 255, 0.96);
	padding: 18px 18px 20px;
	border-radius: 14px;
	box-shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
	border: 1px solid rgba(208, 218, 232, 0.7);
	width: auto;
	backdrop-filter: blur(8px);
}

.container + .container {
	margin-top: 16px;
}

.section-heading {
	margin-bottom: 10px;
}

.section-kicker {
	font-size: 11px;
	font-weight: bold;
	color: #0b63ce;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 5px;
}

.section-heading h2,
.history-header h2 {
	margin: 0;
	font-size: 21px;
	line-height: 1.15;
}

label {
	font-weight: bold;
	display: block;
	margin-top: 10px;
	font-size: 13px;
}

input {
	width: 100%;
	padding: 9px 10px;
	margin-top: 5px;
	border: 1px solid #cfd8e3;
	border-radius: 8px;
	font-size: 13px;
	box-sizing: border-box;
	background: #fff;
}

input:focus,
select:focus {
	outline: none;
	border-color: #84caff;
	box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.10);
}

button {
	margin-top: 15px;
	width: 100%;
	padding: 11px 14px;
	background: linear-gradient(180deg, #1b75ea 0%, #0b63ce 100%);
	color: white;
	border: none;
	border-radius: 9px;
	cursor: pointer;
	font-size: 13px;
	font-weight: bold;
	box-shadow: 0 6px 18px rgba(11, 99, 206, 0.2);
}

button:hover {
	background: linear-gradient(180deg, #1767cf 0%, #0957b3 100%);
}

.secondary-button {
	background: linear-gradient(180deg, #7a8699 0%, #667085 100%);
	box-shadow: 0 6px 18px rgba(102, 112, 133, 0.18);
}

.secondary-button:hover {
	background: linear-gradient(180deg, #6b7687 0%, #596273 100%);
}

.switch {
	position: relative;
	display: inline-block;
	width: 34px;
	height: 20px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #d0d5dd;
	transition: 0.25s;
	border-radius: 20px;
}

.slider:before {
	position: absolute;
	content: "";
	height: 14px;
	width: 14px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.25s;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.22);
}

input:checked + .slider {
	background-color: #0b63ce;
}

input:checked + .slider:before {
	transform: translateX(14px);
}

.settings-group {
	margin-top: 10px;
	padding: 10px 12px 12px;
	background: #f8fafc;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
}

.network-group + .network-group {
	margin-top: 12px;
}

.network-mode-toggle {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	margin-top: 8px;
}

.network-mode-label {
	min-width: auto;
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	display: inline-flex;
	align-items: center;
	color: #98a2b3;
	transition: color 0.2s ease;
}

.network-mode-toggle[data-mode="static"] .network-mode-label-static {
	color: #182230;
}

.network-mode-toggle[data-mode="dhcp"] .network-mode-label-dhcp {
	color: #0b63ce;
}


.network-mode-switch {
	margin: 0;
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	flex: 0 0 auto;
}

.network-mode-toggle .switch {
	margin-top: 0;
}

.address-range-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	align-items: end;
}

.address-range-item label {
	margin-top: 0;
}

.address-range-item input {
	margin-top: 5px;
}

.address-range-inline {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
}

.batch-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	position: relative;
	top: 1px;
}


.batch-count-badge.over-limit {
	background: #fef3f2;
	border: 1px solid #fda29b;
	color: #b42318;
}

.review-intro.is-note {
	font-weight: 600;
}

button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	box-shadow: none;
}

:root[data-theme="dark"] .batch-count-badge.over-limit {
	background: rgba(180, 35, 24, 0.18);
	border: 1px solid rgba(253, 162, 155, 0.5);
	color: #fecaca;
}


.collapsible-fields[hidden] {
	display: none !important;
}

.group-fields {
	margin-top: 10px;
}

.group-fields label {
	margin-top: 10px;
}

.field-help {
	margin-top: 2px;
	font-size: 11px;
	line-height: 1.35;
	color: #667085;
}

.group-fields input {
	margin-top: 5px;
}

input:disabled {
	background-color: #f7f9fc;
	color: #667085;
	cursor: not-allowed;
}

select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #cfd8e3;
	border-radius: 8px;
	background-color: white;
	cursor: pointer;
	font-size: 13px;
	box-sizing: border-box;
}

.review-intro {
	margin: 4px 0 10px;
	color: #475467;
	font-size: 11px;
	line-height: 1.3;
}

.review-card {
	border: 1px solid #d8dee6;
	border-radius: 8px;
	padding: 7px 9px;
	background: #fafbfd;
	font-size: 12px;
	line-height: 1.25;
}

.review-card-title {
	font-weight: bold;
	font-size: 12px;
	margin-bottom: 6px;
}

.review-grid {
	display: grid;
	grid-template-columns: 138px 1fr;
	gap: 5px 10px;
	align-items: start;
}

.review-label {
	font-weight: bold;
	color: #333;
	font-size: 11px;
}

.review-value {
	word-break: break-word;
	color: #111;
	font-size: 11px;
}

.button-row {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}

.button-row button {
	margin-top: 0;
}

.firmware-info-card {
	margin-top: 10px;
	padding: 12px 12px 10px;
	border: 1px solid #d8dee6;
	border-radius: 8px;
	background: #fafbfd;
	width: 100%;
	box-sizing: border-box;
	font-size: 12px;
	line-height: 1.25;
}

.firmware-info-card label {
	margin-top: 0;
}

.firmware-info-card select {
	margin-top: 6px;
	margin-bottom: 12px;
	font-weight: bold;
}

.firmware-info-title {
	font-weight: bold;
	font-size: 12px;
	margin-bottom: 6px;
}

.firmware-info-grid {
	display: grid;
	grid-template-columns: 86px 1fr;
	gap: 5px 8px;
	align-items: start;
}

.firmware-info-label {
	font-weight: bold;
	color: #333;
	font-size: 11px;
}

.firmware-info-value {
	word-break: break-word;
	color: #111;
	font-size: 11px;
}

.firmware-info-muted {
	color: #666;
	font-size: 11px;
}

.firmware-info-loading {
	opacity: 0.9;
}

.firmware-info-error {
	border-color: #f0c2c2;
	background: #fff7f7;
}

.firmware-info-error-text {
	color: #b42318;
}

.validation-summary {
	margin-top: 14px;
	padding: 10px 12px;
	border: 1px solid #f1b7b2;
	border-radius: 8px;
	background: #fff7f7;
	color: #7a1911;
	font-size: 13px;
}

.validation-summary-title {
	font-weight: bold;
	margin-bottom: 6px;
}

.validation-summary ul {
	margin: 0;
	padding-left: 18px;
}

.validation-summary li + li {
	margin-top: 4px;
}

.field-error {
	display: none;
	margin-top: 5px;
	font-size: 12px;
	color: #b42318;
	line-height: 1.3;
}

input.input-error,
select.input-error {
	border-color: #d92d20;
	background: #fff8f7;
	box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.status-output {
	white-space: pre-line;
	margin-top: 16px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f8fafc;
	border: 1px solid #e4e7ec;
	font-size: 12px;
	line-height: 1.45;
	min-height: 72px;
	box-sizing: border-box;
}

.build-report-section {
	margin-top: 18px;
}

.build-report-card {
	border: 1px solid #d8dee6;
	border-radius: 8px;
	padding: 7px 9px;
	background: #fafbfd;
	font-size: 12px;
	line-height: 1.25;
}

.build-report-title {
	font-weight: bold;
	font-size: 12px;
	margin-bottom: 6px;
}

.build-report-grid {
	display: grid;
	grid-template-columns: 138px 1fr;
	gap: 5px 10px;
	align-items: start;
}

.build-report-label {
	font-weight: bold;
	color: #333;
	font-size: 11px;
}

.build-report-value {
	word-break: break-word;
	color: #111;
	font-size: 11px;
}

.build-report-value.is-success {
	color: #067647;
	font-weight: bold;
}

.build-report-value.is-download-complete {
	color: #0056b3;
	font-weight: bold;
}

.build-report-value.is-in-progress {
	color: #0b63ce;
	font-weight: bold;
}

.build-report-actions {
	margin-top: 14px;
	display: flex;
	gap: 10px;
}

.build-report-info {
	margin-top: 8px;
	font-size: 11px;
	color: #444;
	line-height: 1.3;
}



.history-launch-btn {
	width: auto;
	min-width: 140px;
	margin-top: 0;
	padding: 9px 14px;
	border-radius: 10px;
	font-size: 12px;
	box-shadow: 0 6px 16px rgba(11, 99, 206, 0.12);
}

.page-header-history-btn {
	flex: 0 0 auto;
	width: var(--header-action-width);
	max-width: 100%;
	box-sizing: border-box;
}

.history-section {
	margin-bottom: 16px;
}

.history-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.history-subtitle {
	margin: 6px 0 0;
	font-size: 11px;
	line-height: 1.3;
	color: #475467;
}

.history-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.history-clear-btn {
	width: auto;
	min-width: 110px;
	margin-top: 0;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 12px;
	box-shadow: 0 6px 16px rgba(11, 99, 206, 0.12);
}

.history-close-btn {
	width: 34px;
	height: 34px;
	min-width: 34px;
	padding: 0;
	margin-top: 0;
	border-radius: 10px;
	font-size: 22px;
	line-height: 1;
	font-weight: bold;
	background: #ffffff;
	color: #101828;
	border: 1px solid #101828;
	box-shadow: 0 4px 10px rgba(16, 24, 40, 0.08);
}

.history-close-btn:hover {
	background: #f8fafc;
	color: #101828;
}

.history-list {
	display: grid;
	gap: 10px;
}

.history-card {
	border: 1px solid #d8dee6;
	border-radius: 8px;
	padding: 7px 9px;
	background: #fafbfd;
	font-size: 12px;
	line-height: 1.25;
}

.history-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
}

.history-card-time {
	font-size: 11px;
	color: #475467;
}

.history-status {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: bold;
	white-space: nowrap;
}

.history-status.is-success {
	background: #ecfdf3;
	color: #067647;
	border: 1px solid #a6f4c5;
}

.history-status.is-downloaded {
	background: #eff8ff;
	color: #0b63ce;
	border: 1px solid #84caff;
}

.history-status.is-failed {
	background: #fff7f7;
	color: #b42318;
	border: 1px solid #f1b7b2;
}

.history-card-grid {
	display: grid;
	grid-template-columns: 86px 1fr;
	gap: 5px 8px;
	align-items: start;
}

.history-label {
	font-weight: bold;
	color: #333;
	font-size: 11px;
}

.history-value {
	word-break: break-word;
	color: #111;
	font-size: 11px;
}

.history-empty {
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid #d8dee6;
	background: #fafbfd;
	font-size: 11px;
	line-height: 1.35;
	color: #475467;
}

.history-empty-error {
	background: #fff7f7;
	border-color: #f1b7b2;
	color: #b42318;
}

.details-group {
	margin-top: 18px;
}

.details-group-title {
	font-weight: bold;
	font-size: 13px;
	color: #101828;
	margin-bottom: 2px;
}

@media (max-width: 560px) {
	body {
		padding-left: 10px;
		padding-right: 10px;
	}

	.stage-tracker {
		grid-template-columns: repeat(2, 1fr);
	}

	.button-row,
	.history-header,
	.page-header-top {
		flex-direction: column;
	}

	.history-actions {
		justify-content: stretch;
	}

	.page-header-top {
		align-items: stretch;
	}

	.history-launch-btn,
	.history-clear-btn,
	.page-header-history-btn {
		width: 100%;
	}
}

:root {
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	body {
		background: linear-gradient(180deg, #0a0a0a 0%, #161616 100%);
		color: #e5edf7;
	}

	.page-badge {
		background: #1f1f1f;
		color: #f5f5f5;
	}

	.page-header p,
	.history-subtitle,
	.review-intro,
	.field-help,
	.history-card-time,
	.history-empty,
	.build-report-info,
	.firmware-info-muted {
		color: #b8b8b8;
	}

	.stage-item {
		background: rgba(20, 20, 20, 0.94);
		border-color: #303030;
		color: #d4d4d4;
		box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
	}

	.stage-number {
		background: #2a2a2a;
		color: #f0f0f0;
	}

	.stage-item.is-active {
		border-color: #6b7280;
		background: #202020;
		color: #f5f5f5;
	}

	.stage-item.is-active .stage-number {
		background: #111111;
		color: #ffffff;
	}

	.stage-item.is-complete {
		border-color: #1f8f5a;
		background: #0d2a20;
		color: #86efac;
	}

	.stage-item.is-complete .stage-number {
		background: #16a34a;
		color: #f0fdf4;
	}

	.container {
		background: rgba(18, 18, 18, 0.96);
		border-color: rgba(48, 48, 48, 0.96);
		box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
	}

	.section-kicker {
		color: #d4d4d4;
	}

	label,
	.details-group-title,
	.review-label,
	.firmware-info-label,
	.build-report-label,
	.history-label,
	.review-card-title,
	.firmware-info-title,
	.build-report-title,
	.section-heading h2,
	.history-header h2,
	.page-header h1,
	.stage-text {
		color: #f3f7fc;
	}

	input,
	select {
		background: #121212;
		border-color: #3a3a3a;
		color: #e5edf7;
	}

	input::placeholder {
		color: #7f93ad;
	}

	input:focus,
	select:focus {
		border-color: #6b7280;
		box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
	}

	button {
		background: linear-gradient(180deg, #2f2f2f 0%, #151515 100%);
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
	}

	button:hover {
		background: linear-gradient(180deg, #3c3c3c 0%, #202020 100%);
	}

	.secondary-button {
		background: linear-gradient(180deg, #59657a 0%, #475467 100%);
		box-shadow: 0 10px 24px rgba(2, 6, 23, 0.34);
	}

	.secondary-button:hover {
		background: linear-gradient(180deg, #647189 0%, #515f73 100%);
	}

	.button-row button,
	.build-report-actions button,
	.history-launch-btn,
	.history-clear-btn {
		border: 0;
	}

	.thing {
		background-color: #3a3a3a;
	}

	.thing.alt {
		background-color: #16a34a;
	}

	.thing.active {
		background-color: #4b5563;
	}

	.thing-label {
		color: #d4d4d4;
	}

	.thing-label.complete,
	.thing-label.alt {
		color: #86efac;
	}

	.thing-label.active {
		color: #f5f5f5;
	}

	.thing-circle {
		border-color: rgba(255, 255, 255, 0.18);
	}

	.slider {
		background-color: #3a3a3a;
	}

	.slider:before {
		background-color: #f8fafc;
	}

	input:checked + .slider {
		background-color: #4b5563;
	}

	.settings-group,
	.review-card,
	.firmware-info-card,
	.build-report-card,
	.history-card,
	.history-empty,
	.status-output {
		background: #171717;
		border-color: #3a3a3a;
	}

	.review-value,
	.firmware-info-value,
	.build-report-value,
	.history-value,
	.status-output,
	#info {
		color: #f0f0f0;
	}

	.validation-summary {
		background: #331616;
		border-color: #7f1d1d;
		color: #fecaca;
	}

	.input-error,
	input.input-error,
	select.input-error {
		background: #2b1515;
		border-color: #ef4444;
		box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
	}

	.field-error,
	.firmware-info-error-text,
	.history-empty-error {
		color: #fca5a5;
	}

	.firmware-info-error,
	.history-empty-error {
		border-color: #7f1d1d;
		background: #331616;
	}

	.build-report-value.is-success {
		color: #86efac;
	}

	.build-report-value.is-download-complete,
	.history-status.is-downloaded {
		color: #f5f5f5;
	}

	.build-report-value.is-in-progress {
		color: #f5f5f5;
	}

	.history-status.is-success {
		background: #0d2a20;
		border-color: #1f8f5a;
		color: #86efac;
	}

	.history-status.is-downloaded {
		background: #202020;
		border-color: #2563eb;
	}

	.history-status.is-failed {
		background: #331616;
		border-color: #7f1d1d;
		color: #fca5a5;
	}

	.history-close-btn {
		background: #121212;
		color: #f8fafc;
		border-color: #475467;
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
	}

	.history-close-btn:hover {
		background: #f8fafc;
		color: #101828;
	}

	input:disabled,
	select:disabled {
		background-color: #202020;
		color: #9ca3af;
		border-color: #3a3a3a;
	}

	input:-webkit-autofill,
	input:-webkit-autofill:hover,
	input:-webkit-autofill:focus,
	select:-webkit-autofill {
		-webkit-text-fill-color: #f0f0f0;
		-webkit-box-shadow: 0 0 0px 1000px #121212 inset;
		transition: background-color 9999s ease-in-out 0s;
	}
}


.page-header-actions {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	justify-content: flex-end;
	gap: 8px;
	flex: 0 0 auto;
	--header-action-width: 160px;
}

.theme-toggle-wrap,
.mode-toggle-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: var(--header-action-width);
	max-width: 100%;
	box-sizing: border-box;
	margin-top: 0;
	padding: 6px 10px;
	border-radius: 10px;
	border: 1px solid #dbe4ee;
	box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
}

.theme-toggle-label,
.mode-toggle-label {
	font-size: 12px;
	font-weight: bold;
	line-height: 1;
	user-select: none;
}

.theme-switch-control,
.mode-switch-control {
	margin: 0;
}

@media (max-width: 560px) {
	.page-header-actions {
		width: 100%;
		align-items: stretch;
	}

	.theme-toggle-wrap,
	.mode-toggle-wrap {
		width: 100%;
		justify-content: center;
	}
}


:root[data-theme="light"] .theme-toggle-wrap,
:root[data-theme="light"] .mode-toggle-wrap {
	background: rgba(255, 255, 255, 0.92);
	border-color: #dbe4ee;
}

:root[data-theme="light"] .theme-toggle-label,
:root[data-theme="light"] .mode-toggle-label {
	color: #344054;
}

:root[data-theme="dark"] .theme-toggle-wrap,
:root[data-theme="dark"] .mode-toggle-wrap {
	background: rgba(24, 28, 37, 0.96);
	border-color: #343b48;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .theme-toggle-label,
:root[data-theme="dark"] .mode-toggle-label {
	color: #e5e7eb;
}

:root[data-theme="light"] {
	color-scheme: light;
}

:root[data-theme="dark"] {
	color-scheme: dark;
}

:root[data-theme="light"] html {
	background: #edf2f8;
}

:root[data-theme="light"] body {
	background-color: #edf2f8;
	background-image: linear-gradient(180deg, #f3f6fb 0%, #edf2f8 100%);
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
	color: #182230;
}

:root[data-theme="light"] .page-badge {
	background: #eaf2ff;
	color: #0b63ce;
}

:root[data-theme="light"] .page-header p,
:root[data-theme="light"] .history-subtitle,
:root[data-theme="light"] .review-intro,
:root[data-theme="light"] .field-help,
:root[data-theme="light"] .history-card-time,
:root[data-theme="light"] .history-empty,
:root[data-theme="light"] .build-report-info,
:root[data-theme="light"] .firmware-info-muted {
	color: #475467;
}


:root[data-theme="light"] .batch-count-badge {
	background: #eff8ff;
	border: 1px solid #b2ddff;
	color: #175cd3;
}

:root[data-theme="light"] .stage-item {
	background: rgba(255, 255, 255, 0.7);
	border-color: #dbe4ee;
	color: #475467;
	box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}

:root[data-theme="light"] .stage-number {
	background: #eef2f6;
	color: #344054;
}

:root[data-theme="light"] .stage-item.is-active {
	border-color: #84caff;
	background: #eff8ff;
	color: #0b63ce;
}

:root[data-theme="light"] .stage-item.is-active .stage-number {
	background: #0b63ce;
	color: #fff;
}

:root[data-theme="light"] .stage-item.is-complete {
	border-color: #a6f4c5;
	background: #ecfdf3;
	color: #067647;
}

:root[data-theme="light"] .stage-item.is-complete .stage-number {
	background: #12b76a;
	color: #fff;
}

:root[data-theme="light"] .container {
	background: rgba(255, 255, 255, 0.96);
	border-color: rgba(208, 218, 232, 0.7);
	box-shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
}

:root[data-theme="light"] .section-kicker {
	color: #0b63ce;
}

:root[data-theme="light"] label,
:root[data-theme="light"] .details-group-title,
:root[data-theme="light"] .review-label,
:root[data-theme="light"] .firmware-info-label,
:root[data-theme="light"] .build-report-label,
:root[data-theme="light"] .history-label,
:root[data-theme="light"] .review-card-title,
:root[data-theme="light"] .firmware-info-title,
:root[data-theme="light"] .build-report-title,
:root[data-theme="light"] .section-heading h2,
:root[data-theme="light"] .history-header h2,
:root[data-theme="light"] .page-header h1,
:root[data-theme="light"] .stage-text {
	color: #101828;
}

:root[data-theme="light"] input,
:root[data-theme="light"] select {
	background: #fff;
	border-color: #cfd8e3;
	color: #182230;
}

:root[data-theme="light"] input::placeholder {
	color: #98a2b3;
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus {
	border-color: #84caff;
	box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.10);
}

:root[data-theme="light"] button {
	background: linear-gradient(180deg, #1b75ea 0%, #0b63ce 100%);
	box-shadow: 0 6px 18px rgba(11, 99, 206, 0.2);
}

:root[data-theme="light"] button:hover {
	background: linear-gradient(180deg, #1767cf 0%, #0957b3 100%);
}

:root[data-theme="light"] .secondary-button {
	background: linear-gradient(180deg, #7a8699 0%, #667085 100%);
	box-shadow: 0 6px 18px rgba(102, 112, 133, 0.18);
}

:root[data-theme="light"] .secondary-button:hover {
	background: linear-gradient(180deg, #6b7687 0%, #596273 100%);
}

:root[data-theme="light"] .slider {
	background-color: #d0d5dd;
}

:root[data-theme="light"] .slider:before {
	background-color: white;
}

:root[data-theme="light"] input:checked + .slider {
	background-color: #0b63ce;
}

:root[data-theme="light"] .settings-group,
:root[data-theme="light"] .review-card,
:root[data-theme="light"] .firmware-info-card,
:root[data-theme="light"] .build-report-card,
:root[data-theme="light"] .history-card,
:root[data-theme="light"] .history-empty,
:root[data-theme="light"] .status-output {
	background: #fafbfd;
	border-color: #d8dee6;
}

:root[data-theme="light"] .settings-group {
	background: #f8fafc;
	border-color: #e4e7ec;
}

:root[data-theme="light"] .review-value,
:root[data-theme="light"] .firmware-info-value,
:root[data-theme="light"] .build-report-value,
:root[data-theme="light"] .history-value,
:root[data-theme="light"] .status-output,
:root[data-theme="light"] #info {
	color: #111;
}

:root[data-theme="light"] .mode-notice {
	background: #eef4ff;
	border: 1px solid #bfd8ff;
	color: #0b63ce;
}

:root[data-theme="light"] .validation-summary {
	background: #fff7f7;
	border-color: #f1b7b2;
	color: #7a1911;
}

:root[data-theme="light"] .input-error,
:root[data-theme="light"] input.input-error,
:root[data-theme="light"] select.input-error {
	background: #fff8f7;
	border-color: #d92d20;
	box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

:root[data-theme="light"] .field-error,
:root[data-theme="light"] .firmware-info-error-text,
:root[data-theme="light"] .history-empty-error {
	color: #b42318;
}

:root[data-theme="light"] .firmware-info-error,
:root[data-theme="light"] .history-empty-error {
	border-color: #f1b7b2;
	background: #fff7f7;
}

:root[data-theme="light"] .build-report-value.is-success {
	color: #067647;
}

:root[data-theme="light"] .build-report-value.is-download-complete {
	color: #0056b3;
}

:root[data-theme="light"] .build-report-value.is-in-progress {
	color: #0b63ce;
}

:root[data-theme="light"] .history-status.is-success {
	background: #ecfdf3;
	border-color: #a6f4c5;
	color: #067647;
}

:root[data-theme="light"] .history-status.is-downloaded {
	background: #eff8ff;
	border-color: #84caff;
	color: #0b63ce;
}

:root[data-theme="light"] .history-status.is-failed {
	background: #fff7f7;
	border-color: #f1b7b2;
	color: #b42318;
}

:root[data-theme="light"] .history-close-btn {
	background: #ffffff;
	color: #101828;
	border-color: #101828;
	box-shadow: 0 4px 10px rgba(16, 24, 40, 0.08);
}

:root[data-theme="light"] .history-close-btn:hover {
	background: #f8fafc;
	color: #101828;
}

:root[data-theme="light"] input:disabled,
:root[data-theme="light"] select:disabled {
	background-color: #f7f9fc;
	color: #667085;
	border-color: #cfd8e3;
}

:root[data-theme="light"] input:-webkit-autofill,
:root[data-theme="light"] input:-webkit-autofill:hover,
:root[data-theme="light"] input:-webkit-autofill:focus,
:root[data-theme="light"] select:-webkit-autofill {
	-webkit-text-fill-color: #182230;
	-webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
	transition: background-color 9999s ease-in-out 0s;
}


:root[data-theme="dark"] .batch-count-badge {
	background: rgba(37, 99, 235, 0.18);
	border: 1px solid rgba(96, 165, 250, 0.35);
	color: #dbeafe;
}

:root[data-theme="dark"] html {
	background: #0a0a0a;
}

:root[data-theme="dark"] body {
	background-color: #0a0a0a;
	background-image: linear-gradient(180deg, #0a0a0a 0%, #161616 100%);
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
	color: #e5edf7;
}

:root[data-theme="dark"] .page-badge {
	background: #1f1f1f;
	color: #f5f5f5;
}

:root[data-theme="dark"] .page-header p,
:root[data-theme="dark"] .history-subtitle,
:root[data-theme="dark"] .review-intro,
:root[data-theme="dark"] .field-help,
:root[data-theme="dark"] .history-card-time,
:root[data-theme="dark"] .history-empty,
:root[data-theme="dark"] .build-report-info,
:root[data-theme="dark"] .firmware-info-muted {
	color: #b8b8b8;
}

:root[data-theme="dark"] .network-mode-label {
	color: #7f8693;
}

:root[data-theme="dark"] .network-mode-toggle[data-mode="static"] .network-mode-label-static {
	color: #f3f4f6;
}

:root[data-theme="dark"] .network-mode-toggle[data-mode="dhcp"] .network-mode-label-dhcp {
	color: #60a5fa;
}

:root[data-theme="dark"] .stage-item {
	background: rgba(20, 20, 20, 0.94);
	border-color: #303030;
	color: #d4d4d4;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .stage-number {
	background: #2a2a2a;
	color: #f0f0f0;
}

:root[data-theme="dark"] .stage-item.is-active {
	border-color: #6b7280;
	background: #202020;
	color: #f5f5f5;
}

:root[data-theme="dark"] .stage-item.is-active .stage-number {
	background: #0b63ce;
	color: #ffffff;
}

:root[data-theme="dark"] .stage-item.is-complete {
	border-color: #1f8f5a;
	background: #0d2a20;
	color: #86efac;
}

:root[data-theme="dark"] .stage-item.is-complete .stage-number {
	background: #16a34a;
	color: #f0fdf4;
}

:root[data-theme="dark"] .container {
	background: rgba(18, 18, 18, 0.96);
	border-color: rgba(48, 48, 48, 0.96);
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .section-kicker {
	color: #d4d4d4;
}

:root[data-theme="dark"] label,
:root[data-theme="dark"] .details-group-title,
:root[data-theme="dark"] .review-label,
:root[data-theme="dark"] .firmware-info-label,
:root[data-theme="dark"] .build-report-label,
:root[data-theme="dark"] .history-label,
:root[data-theme="dark"] .review-card-title,
:root[data-theme="dark"] .firmware-info-title,
:root[data-theme="dark"] .build-report-title,
:root[data-theme="dark"] .section-heading h2,
:root[data-theme="dark"] .history-header h2,
:root[data-theme="dark"] .page-header h1,
:root[data-theme="dark"] .stage-text {
	color: #f3f7fc;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
	background: #121212;
	border-color: #3a3a3a;
	color: #e5edf7;
}

:root[data-theme="dark"] input::placeholder {
	color: #7f93ad;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus {
	border-color: #6b7280;
	box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

:root[data-theme="dark"] button {
	background: linear-gradient(180deg, #3150c9 0%, #1f3fae 100%);
	box-shadow: 0 10px 24px rgba(10, 20, 60, 0.34);
}

:root[data-theme="dark"] button:hover {
	background: linear-gradient(180deg, #3a5ddd 0%, #2649bf 100%);
}

:root[data-theme="dark"] .secondary-button {
	background: linear-gradient(180deg, #5066c9 0%, #3e53b2 100%);
	box-shadow: 0 10px 24px rgba(10, 20, 60, 0.30);
}

:root[data-theme="dark"] .secondary-button:hover {
	background: linear-gradient(180deg, #5d73d6 0%, #4a60be 100%);
}


:root[data-theme="dark"] .button-row button,
:root[data-theme="dark"] .build-report-actions button,
:root[data-theme="dark"] .history-launch-btn,
:root[data-theme="dark"] .history-clear-btn,
:root[data-theme="dark"] .theme-toggle-btn {
	border: 0;
}

:root[data-theme="dark"] .slider {
	background-color: #3a3a3a;
}

:root[data-theme="dark"] .slider:before {
	background-color: #f8fafc;
}

:root[data-theme="dark"] input:checked + .slider {
	background-color: #0b63ce;
}

:root[data-theme="dark"] .settings-group,
:root[data-theme="dark"] .review-card,
:root[data-theme="dark"] .firmware-info-card,
:root[data-theme="dark"] .build-report-card,
:root[data-theme="dark"] .history-card,
:root[data-theme="dark"] .history-empty,
:root[data-theme="dark"] .status-output {
	background: #171717;
	border-color: #3a3a3a;
}

:root[data-theme="dark"] .review-value,
:root[data-theme="dark"] .firmware-info-value,
:root[data-theme="dark"] .build-report-value,
:root[data-theme="dark"] .history-value,
:root[data-theme="dark"] .status-output,
:root[data-theme="dark"] #info {
	color: #f0f0f0;
}

:root[data-theme="dark"] .mode-notice {
	background: #172554;
	border: 1px solid #1d4ed8;
	color: #bfdbfe;
}

:root[data-theme="dark"] .validation-summary {
	background: #331616;
	border-color: #7f1d1d;
	color: #fecaca;
}

:root[data-theme="dark"] .input-error,
:root[data-theme="dark"] input.input-error,
:root[data-theme="dark"] select.input-error {
	background: #2b1515;
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

:root[data-theme="dark"] .field-error,
:root[data-theme="dark"] .firmware-info-error-text,
:root[data-theme="dark"] .history-empty-error {
	color: #fca5a5;
}

:root[data-theme="dark"] .firmware-info-error,
:root[data-theme="dark"] .history-empty-error {
	border-color: #7f1d1d;
	background: #331616;
}

:root[data-theme="dark"] .build-report-value.is-success {
	color: #86efac;
}

:root[data-theme="dark"] .build-report-value.is-download-complete,
:root[data-theme="dark"] .history-status.is-downloaded,
:root[data-theme="dark"] .build-report-value.is-in-progress {
	color: #f5f5f5;
}

:root[data-theme="dark"] .history-status.is-success {
	background: #0d2a20;
	border-color: #1f8f5a;
	color: #86efac;
}

:root[data-theme="dark"] .history-status.is-downloaded {
	background: #202020;
	border-color: #2563eb;
}

:root[data-theme="dark"] .history-status.is-failed {
	background: #331616;
	border-color: #7f1d1d;
	color: #fca5a5;
}

:root[data-theme="dark"] .history-close-btn {
	background: #121212;
	color: #f8fafc;
	border-color: #475467;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .history-close-btn:hover {
	background: #f8fafc;
	color: #101828;
}

:root[data-theme="dark"] input:disabled,
:root[data-theme="dark"] select:disabled {
	background-color: #202020;
	color: #9ca3af;
	border-color: #3a3a3a;
}

:root[data-theme="dark"] input:-webkit-autofill,
:root[data-theme="dark"] input:-webkit-autofill:hover,
:root[data-theme="dark"] input:-webkit-autofill:focus,
:root[data-theme="dark"] select:-webkit-autofill {
	-webkit-text-fill-color: #f0f0f0;
	-webkit-box-shadow: 0 0 0px 1000px #121212 inset;
	transition: background-color 9999s ease-in-out 0s;
}


/* Responsive phone fixes */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	min-height: 100%;
}

*, *::before, *::after {
	box-sizing: border-box;
}

body {
	overflow-x: hidden;
}

.page-shell,
.container,
.settings-group,
.firmware-info-card,
.review-card,
.build-report-card,
.history-card,
.stage-item,
.page-header-top,
.page-header-actions {
	min-width: 0;
}

@media (max-width: 768px) {
	body {
		padding: 16px 12px 28px;
	}

	.page-shell {
		max-width: 100%;
	}

	.page-header {
		margin-bottom: 12px;
	}

	.page-badge {
		font-size: 12px;
		padding: 6px 12px;
		margin-bottom: 10px;
	}

	.page-header-top {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.page-header h1 {
		font-size: 22px;
		line-height: 1.15;
	}

	.page-header p {
		font-size: 14px;
		line-height: 1.45;
	}

	.page-header-actions {
		width: 100%;
		align-items: stretch;
		gap: 10px;
	}

	.theme-toggle-wrap,
	.mode-toggle-wrap,
	.history-launch-btn,
	.page-header-history-btn {
		width: 100%;
		max-width: none;
	}

	.stage-tracker {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}

	.stage-item {
		padding: 10px 8px;
		gap: 6px;
	}

	.stage-number {
		width: 20px;
		height: 20px;
		font-size: 11px;
	}

	.stage-text {
		min-width: 0;
		font-size: 11px;
		line-height: 1.15;
		white-space: normal;
		overflow-wrap: anywhere;
	}

	.container {
		padding: 16px 14px 18px;
		border-radius: 14px;
	}

	.section-heading h2,
	.history-header h2 {
		font-size: 19px;
	}

	#configForm input:not([type="checkbox"]),
	#configForm select,
	.group-fields input,
	.firmware-info-card select {
		width: 100% !important;
		max-width: 100%;
	}

	.address-range-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.address-range-inline {
		width: 100%;
		justify-content: flex-start;
		flex-wrap: wrap;
	}

	.batch-count-badge {
		min-height: 30px;
	}

	.network-mode-toggle {
		justify-content: flex-start;
		gap: 8px;
	}

	.network-mode-label {
		min-width: auto;
		font-size: 11px;
		line-height: 20px;
	}

	#configForm input#bcu {
		max-width: 110px;
	}

	.button-row,
	.history-header {
		flex-direction: column;
	}

	.button-row button,
	.history-actions,
		.history-clear-btn,
		history-close-btn {
		width: 100%;
	}

	.history-actions {
		display: flex;
		flex-direction: row;
		align-items: stretch;
		gap: 8px;
	}

	.history-clear-btn {
		flex: 1 1 auto;
	}

	.history-close-btn {
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		min-width: 44px;
	}

	.review-grid,
	.firmware-info-grid,
	.build-report-grid,
	.history-card-grid {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.review-label,
	.firmware-info-label,
	.build-report-label,
	.history-label {
		font-size: 11px;
	}

	.review-value,
	.firmware-info-value,
	.build-report-value,
	.history-value {
		font-size: 12px;
	}
}

@media (max-width: 420px) {
	body {
		padding: 12px 10px 24px;
	}

	.page-header h1 {
		font-size: 20px;
	}

	.page-header p {
		font-size: 13px;
	}

	.theme-toggle-wrap {
		padding: 8px 10px;
	}

	.stage-item {
		padding: 9px 7px;
	}

	.stage-number {
		width: 18px;
		height: 18px;
		font-size: 10px;
	}

	.stage-text {
		font-size: 10px;
	}

	.container {
		padding: 14px 12px 16px;
	}

	.firmware-info-card,
	.settings-group {
		padding: 12px 10px;
	}
}

:root[data-theme="light"] .batch-count-badge.over-limit {
	background: #fef3f2;
	border: 1px solid #fda29b;
	color: #b42318;
}

:root[data-theme="dark"] .batch-count-badge.over-limit {
	background: rgba(180, 35, 24, 0.18);
	border: 1px solid rgba(253, 162, 155, 0.5);
	color: #fecaca;
}
