/* UI-стили конфигуратора (вынесено из index.html) */

		html, body {
			touch-action: none;
			margin: 0;
			border: 0 none;
			padding: 0;
			height: 100%;
			text-align: center;
			background-color: #0d0e10;
			overflow: hidden;
		}
		body { display: flex; flex-direction: column; }

		#stage {
			position: relative;
			flex: 1 1 auto;
			min-height: 0;
		}

		#canvas {
			display: block;
			width: 100%;
			height: 100%;
			margin: 0;
			color: white;
		}

		#canvas:focus {
			outline: none;
		}

		.godot {
			font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
			color: #e0e0e0;
			background-color: #3b3943;
			background-image: linear-gradient(to bottom, #403e48, #35333c);
			border: 1px solid #45434e;
			box-shadow: 0 0 1px 1px #2f2d35;
		}


		/* Status display
		 * ============== */

		#status {
			position: absolute;
			left: 0;
			top: 0;
			right: 0;
			bottom: 0;
			display: flex;
			justify-content: center;
			align-items: center;
			/* don't consume click events - make children visible explicitly */
			visibility: hidden;
		}

		#status-progress {
			width: 366px;
			height: 7px;
			background-color: #38363A;
			border: 1px solid #444246;
			padding: 1px;
			box-shadow: 0 0 2px 1px #1B1C22;
			border-radius: 2px;
			visibility: visible;
		}

		@media only screen and (orientation:portrait) {
			#status-progress {
				width: 61.8%;
			}
		}

		#status-progress-inner {
			height: 100%;
			width: 0;
			box-sizing: border-box;
			transition: width 0.5s linear;
			background-color: #202020;
			border: 1px solid #222223;
			box-shadow: 0 0 1px 1px #27282E;
			border-radius: 3px;
		}

		#status-indeterminate {
			visibility: visible;
			position: relative;
		}

		#status-indeterminate > div {
			width: 4.5px;
			height: 0;
			border-style: solid;
			border-width: 9px 3px 0 3px;
			border-color: #2b2b2b transparent transparent transparent;
			transform-origin: center 21px;
			position: absolute;
		}

		#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
		#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
		#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
		#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
		#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
		#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
		#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
		#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }

		#status-notice {
			margin: 0 100px;
			line-height: 1.3;
			visibility: visible;
			padding: 4px 6px;
			visibility: visible;
		}

		/* Панель управления — ПОД сценой (не перекрывает машину) */
		#ui {
			flex: 0 0 auto;
			display: flex;
			flex-wrap: wrap;
			gap: 8px;
			justify-content: center;
			align-items: center;
			padding: 12px 14px;
			max-height: 40vh;
			overflow-y: auto;
			background: #0d0e10;
			border-top: 1px solid rgba(255, 255, 255, 0.06);
			font-family: -apple-system, 'Segoe UI', 'Noto Sans', Arial, sans-serif;
		}
		#ui .grp {
			display: flex;
			flex-wrap: wrap;
			align-items: center;
			max-width: 100%;
			gap: 8px;
			padding: 8px;
			background: rgba(18, 20, 24, 0.72);
			-webkit-backdrop-filter: blur(14px);
			backdrop-filter: blur(14px);
			border: 1px solid rgba(255, 255, 255, 0.08);
			border-radius: 16px;
			pointer-events: auto;
		}
		#ui #cyberGrp { order: -1; }  /* CT-настройки (тонно/балка/Basecamp/привод) — в начало панели, не уезжают под скролл */
		#ui button {
			cursor: pointer;
			color: #e8e8ea;
			background: rgba(255, 255, 255, 0.06);
			border: 1px solid rgba(255, 255, 255, 0.12);
			border-radius: 11px;
			padding: 9px 15px;
			font-size: 13px;
			font-weight: 500;
			transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
		}
		#ui button:hover { background: rgba(255, 255, 255, 0.15); }
		#ui button:active { transform: scale(0.95); }
		#ui button.on { background: #2b6fff; border-color: #2b6fff; color: #fff; }
		#ui .sw { width: 28px; height: 28px; padding: 0; border-radius: 50%; }
		#ui .sw:hover { transform: scale(1.12); }
		#ui .lbl { color: #9aa0a6; font-size: 12px; font-weight: 600; align-self: center; padding: 0 6px 0 2px; }
		/* Верхний переключатель моделей */
		#topbar {
			position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
			z-index: 10; display: flex; gap: 6px; padding: 7px;
			background: rgba(18, 20, 24, 0.72);
			-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
			border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px;
			font-family: -apple-system, 'Segoe UI', 'Noto Sans', Arial, sans-serif;
		}
		#topbar button {
			cursor: pointer; color: #cfd2d6; background: transparent;
			border: 1px solid transparent; border-radius: 9px;
			padding: 8px 14px; font-size: 13px; font-weight: 600;
			transition: background 0.15s ease, color 0.15s ease;
		}
		#topbar button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
		#topbar button.on { background: #2b6fff; color: #fff; }
		/* Под-бар «тип/версия» (разные кузова) */
		#typebar {
			position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
			z-index: 10; display: none; gap: 6px; padding: 5px;
			background: rgba(18, 20, 24, 0.6);
			-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
			border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 11px;
			font-family: -apple-system, 'Segoe UI', 'Noto Sans', Arial, sans-serif;
			flex-wrap: wrap; justify-content: center; max-width: 94vw;
		}
		#typebar button {
			cursor: pointer; color: #b9bdc2; background: transparent;
			border: 1px solid transparent; border-radius: 8px;
			padding: 6px 12px; font-size: 12px; font-weight: 600;
		}
		#typebar button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
		#typebar button.on { background: rgba(43, 111, 255, 0.85); color: #fff; }
		/* Экран загрузки с процентами */
		#loader {
			position: fixed; inset: 0; z-index: 100;
			display: flex; flex-direction: column; justify-content: center; align-items: center;
			background: #0d0e10; color: #e8e8ea;
			font-family: -apple-system, 'Segoe UI', 'Noto Sans', Arial, sans-serif;
			transition: opacity 0.5s ease;
		}
		#loader.hidden { opacity: 0; pointer-events: none; }
		#loadpct { font-size: 46px; font-weight: 700; letter-spacing: 0.5px; }
		#loadbar { width: 240px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); margin: 18px 0 12px; overflow: hidden; }
		#loadbar-inner { height: 100%; width: 0; background: #2b6fff; transition: width 0.2s ease; }
		#loadlabel { font-size: 14px; color: #c7cacf; }
		#loadhint { font-size: 12px; color: #6b7177; margin-top: 6px; }
		#ui label.win { color: #cfd2d6; font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
		#ui input[type=range] {
			-webkit-appearance: none; appearance: none;
			width: 64px; height: 4px; border-radius: 4px; margin: 0;
			background: rgba(255, 255, 255, 0.18); cursor: pointer;
		}
		#ui input[type=range]::-webkit-slider-thumb {
			-webkit-appearance: none; appearance: none;
			width: 14px; height: 14px; border-radius: 50%; background: #2b6fff; cursor: pointer;
		}
		/* --- Адаптация под размер экрана --- */
		@media (max-width: 900px) {
			#topbar { flex-wrap: wrap; justify-content: center; max-width: 94vw; top: 8px; padding: 5px; gap: 4px; }
			#topbar button { padding: 6px 10px; font-size: 12px; }
			#ui { gap: 6px; padding: 8px; max-height: 50vh; }
			#ui .grp { padding: 6px; gap: 5px; border-radius: 12px; }
			#ui button { padding: 7px 10px; font-size: 12px; border-radius: 9px; }
			#ui .lbl { font-size: 11px; padding: 0 4px 0 2px; }
			#ui input[type=range] { width: 54px; }
		}
		@media (max-width: 480px) {
			#topbar button { padding: 5px 8px; font-size: 11px; }
			#ui button { padding: 6px 8px; font-size: 11px; }
			#ui .sw { width: 24px; height: 24px; }
			#ui label.win { font-size: 9px; }
		}
		/* --- Телефон: модель ~50% экрана; переключатель и настройки НЕ поверх машины --- */
		@media (max-width: 640px) {
			#topbar, #typebar { position: static; transform: none; left: auto; top: auto; right: auto; width: 100%; max-width: 100%; box-sizing: border-box; margin: 0; border-radius: 0; border-left: 0; border-right: 0; }
			#topbar { padding: 8px 6px; gap: 5px; }
			#typebar { padding: 6px; }
			#stage { flex: 0 0 50vh; }
			#ui { flex: 1 1 auto; max-height: none; }
		}
