/* DMX512 Adresleme — dmx512.net
   Görsel yön: sahne cihazı ön paneli. Veri ve rakamlar monospace,
   etiketler ince aralıklı büyük harf, tek vurgu rengi lamba sarısı. */

.dmx-adr {
	/* Yüzeyler */
	--dmx-bg: #ecedea;
	--dmx-surface: #ffffff;
	--dmx-line: #d4d7d1;
	--dmx-line-soft: #e5e7e3;
	--dmx-text: #191c1e;
	--dmx-muted: #6a7075;
	--dmx-head: #1e2226;
	--dmx-head-text: #d8dcdf;

	/* Vurgu ve durum */
	--dmx-on: #e8961e;
	--dmx-on-soft: rgba(232, 150, 30, .14);
	--dmx-on-edge: #a96806;
	--dmx-warn: #b93b26;
	--dmx-warn-bg: #fbeae6;

	/* Gövde (DIP kutusu ve ekran) — iki temada da koyu */
	--dmx-housing: #23282e;
	--dmx-housing-edge: #101316;
	--dmx-lever: #3c444d;
	--dmx-off: #aeb5bd;
	--dmx-display: #14181c;

	--dmx-radius: 10px;
	--dmx-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--dmx-sans: inherit;

	color: var(--dmx-text);
	font-size: 15px;
	line-height: 1.45;
	margin: 0 0 1.6em;
}

.dmx-adr[data-theme="dark"] {
	--dmx-bg: #16191d;
	--dmx-surface: #1c2126;
	--dmx-line: #2d343b;
	--dmx-line-soft: #232930;
	--dmx-text: #e6e9ea;
	--dmx-muted: #99a1a8;
	--dmx-head: #10141a;
	--dmx-head-text: #d8dcdf;
	--dmx-on: #f2a71b;
	--dmx-on-soft: rgba(242, 167, 27, .16);
	--dmx-on-edge: #f2a71b;
	--dmx-warn: #ff8b76;
	--dmx-warn-bg: #331d19;
	--dmx-housing: #0e1216;
	--dmx-housing-edge: #05070a;
	--dmx-lever: #333b44;
	--dmx-off: #5d666f;
	--dmx-display: #0d1013;
}

@media (prefers-color-scheme: dark) {
	.dmx-adr[data-theme="auto"] {
		--dmx-bg: #16191d;
		--dmx-surface: #1c2126;
		--dmx-line: #2d343b;
		--dmx-line-soft: #232930;
		--dmx-text: #e6e9ea;
		--dmx-muted: #99a1a8;
		--dmx-head: #10141a;
		--dmx-head-text: #d8dcdf;
		--dmx-on: #f2a71b;
		--dmx-on-soft: rgba(242, 167, 27, .16);
		--dmx-on-edge: #f2a71b;
		--dmx-warn: #ff8b76;
		--dmx-warn-bg: #331d19;
		--dmx-housing: #0e1216;
		--dmx-housing-edge: #05070a;
		--dmx-lever: #333b44;
		--dmx-off: #5d666f;
		--dmx-display: #0d1013;
	}
}

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

/* Etiket tipografisi: cihaz üzerine baskı hissi */
.dmx-adr__field label,
.dmx-single__label,
.dmx-device__label,
.dmx-uni__label,
.dmx-adr__table thead th {
	font-family: var(--dmx-sans);
	font-size: .72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .11em;
	color: var(--dmx-muted);
}

/* Üst şerit -------------------------------------------------------- */

.dmx-adr__top {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--dmx-text);
}

.dmx-adr__top:empty {
	display: none;
}

.dmx-adr__title {
	margin: 0;
	font-size: 1.3em;
	font-weight: 700;
	letter-spacing: -.015em;
	line-height: 1.2;
}

.dmx-lang {
	display: inline-flex;
	margin-left: auto;
	border: 1px solid var(--dmx-line);
	border-radius: 999px;
	overflow: hidden;
	background: var(--dmx-surface);
	flex: 0 0 auto;
}

.dmx-lang__btn {
	padding: 5px 13px;
	font: inherit;
	font-size: .72em;
	font-weight: 700;
	letter-spacing: .11em;
	color: var(--dmx-muted);
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}

.dmx-lang__btn:hover {
	color: var(--dmx-text);
}

.dmx-lang__btn.is-active {
	color: #14181c;
	background: var(--dmx-on);
}

/* Tek adres paneli --------------------------------------------------- */

.dmx-single {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px 32px;
	padding: 22px 24px;
	background: var(--dmx-bg);
	border: 1px solid var(--dmx-line);
	border-radius: var(--dmx-radius);
}

.dmx-single__entry {
	flex: 0 0 auto;
}

.dmx-single__label {
	display: block;
	margin-bottom: 8px;
}

/* Adres ekranı: cihaz göstergesi */
.dmx-single__stepper {
	display: flex;
	align-items: stretch;
	width: max-content;
	background: var(--dmx-display);
	border: 1px solid var(--dmx-housing-edge);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .18);
}

.dmx-single__stepper input[type="number"] {
	width: 4.2ch;
	min-width: 0;
	padding: 8px 6px;
	font-family: var(--dmx-mono);
	font-size: 2.4em;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.05;
	text-align: center;
	color: var(--dmx-on);
	text-shadow: 0 0 14px rgba(242, 167, 27, .45);
	background: transparent;
	border: 0;
	border-radius: 0;
	margin: 0;
	-moz-appearance: textfield;
	appearance: textfield;
}

.dmx-single__stepper input[type="number"]::-webkit-outer-spin-button,
.dmx-single__stepper input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.dmx-single__step {
	width: 48px;
	font: inherit;
	font-size: 1.4em;
	line-height: 1;
	color: #8e979f;
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}

.dmx-single__step:first-child {
	border-right: 1px solid rgba(255, 255, 255, .08);
}

.dmx-single__step:last-child {
	border-left: 1px solid rgba(255, 255, 255, .08);
}

.dmx-single__step:hover {
	color: var(--dmx-on);
	background: rgba(242, 167, 27, .12);
}

.dmx-single__hint {
	margin: 10px 0 0;
	font-size: .8em;
	color: var(--dmx-muted);
}

.dmx-single__dip {
	flex: 1 1 auto;
	display: flex;
	justify-content: flex-end;
}

.dmx-single__readout {
	flex: 1 0 100%;
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid var(--dmx-line);
	font-size: .92em;
	color: var(--dmx-muted);
}

.dmx-single__readout b {
	color: var(--dmx-text);
	font-family: var(--dmx-mono);
	font-weight: 600;
}

.dmx-single__math {
	display: inline-block;
	margin-left: 12px;
	padding: 2px 9px;
	border-radius: 4px;
	background: var(--dmx-surface);
	border: 1px solid var(--dmx-line-soft);
	font-family: var(--dmx-mono);
	font-size: .86em;
	color: var(--dmx-text);
}

.dmx-single__readout[data-state="warn"],
.dmx-single__readout[data-state="warn"] b {
	color: var(--dmx-warn);
}

.dmx-single__readout[data-state="warn"] .dmx-single__math {
	color: var(--dmx-warn);
	background: var(--dmx-warn-bg);
	border-color: transparent;
}

/* Cihaz tipi --------------------------------------------------------- */

.dmx-device {
	flex: 1 0 100%;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 14px;
}

.dmx-device select {
	flex: 1 1 260px;
	max-width: 100%;
	padding: 8px 11px;
	font: inherit;
	font-size: .86em;
	color: var(--dmx-text);
	background: var(--dmx-surface);
	border: 1px solid var(--dmx-line);
	border-radius: 6px;
	margin: 0;
}

/* Evren şeridi ------------------------------------------------------- */

.dmx-uni {
	margin-top: 14px;
	padding: 14px 16px 10px;
	background: var(--dmx-surface);
	border: 1px solid var(--dmx-line);
	border-radius: var(--dmx-radius);
}

.dmx-uni__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 9px;
}

.dmx-uni__stat {
	font-family: var(--dmx-mono);
	font-size: .78em;
	color: var(--dmx-muted);
}

.dmx-uni__track {
	position: relative;
	height: 16px;
	background: var(--dmx-bg);
	border: 1px solid var(--dmx-line-soft);
	border-radius: 3px;
	overflow: hidden;
}

.dmx-uni__block {
	position: absolute;
	top: 0;
	bottom: 0;
	background: var(--dmx-head);
	border-right: 1px solid var(--dmx-surface);
	opacity: .82;
}

.dmx-uni__block.is-over {
	background: var(--dmx-warn);
}

.dmx-uni__marker {
	position: absolute;
	top: -3px;
	bottom: -3px;
	width: 2px;
	margin-left: -1px;
	background: var(--dmx-on);
	box-shadow: 0 0 6px rgba(242, 167, 27, .8);
	transition: left .18s ease;
}

.dmx-uni__scale {
	display: flex;
	justify-content: space-between;
	margin-top: 5px;
	font-family: var(--dmx-mono);
	font-size: .65em;
	color: var(--dmx-muted);
}

/* Liste bölümü ------------------------------------------------------- */

.dmx-batch {
	margin-top: 14px;
	background: var(--dmx-surface);
	border: 1px solid var(--dmx-line);
	border-radius: var(--dmx-radius);
	overflow: hidden;
}

.dmx-batch__summary {
	padding: 13px 16px;
	font-size: .82em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .09em;
	color: var(--dmx-muted);
	background: var(--dmx-bg);
	cursor: pointer;
	list-style: none;
	transition: color .15s ease;
}

.dmx-batch__summary:hover {
	color: var(--dmx-text);
}

.dmx-batch__summary::-webkit-details-marker {
	display: none;
}

.dmx-batch__summary::before {
	content: "+";
	display: inline-block;
	width: 1.4em;
	font-family: var(--dmx-mono);
	color: var(--dmx-on-edge);
}

.dmx-batch[open] .dmx-batch__summary {
	border-bottom: 1px solid var(--dmx-line);
	color: var(--dmx-text);
}

.dmx-batch[open] .dmx-batch__summary::before {
	content: "−";
}

.dmx-adr__panel {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 20px;
	align-items: flex-end;
	padding: 18px 16px;
	background: var(--dmx-surface);
}

.dmx-adr__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	flex: 1 1 130px;
}

.dmx-adr__field--wide {
	flex: 1 0 100%;
}

.dmx-adr__field label span:last-child {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.dmx-adr__field input,
.dmx-adr__field select {
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	font-family: var(--dmx-mono);
	font-size: 1em;
	color: var(--dmx-text);
	background: var(--dmx-bg);
	border: 1px solid var(--dmx-line);
	border-radius: 6px;
	margin: 0;
}

.dmx-adr__field input[aria-invalid="true"] {
	border-color: var(--dmx-warn);
}

.dmx-adr__actions {
	display: flex;
	gap: 8px;
	flex: 0 0 auto;
}

.dmx-adr__btn {
	min-height: 40px;
	padding: 9px 15px;
	font: inherit;
	font-size: .84em;
	font-weight: 600;
	color: var(--dmx-text);
	background: var(--dmx-bg);
	border: 1px solid var(--dmx-line);
	border-radius: 6px;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.dmx-adr__btn:hover {
	color: var(--dmx-on-edge);
	border-color: var(--dmx-on);
	background: var(--dmx-on-soft);
}

.dmx-adr__note {
	margin: 0 16px;
	font-family: var(--dmx-mono);
	font-size: .8em;
	color: var(--dmx-muted);
}

.dmx-adr__note[data-state="warn"] {
	color: var(--dmx-warn);
	background: var(--dmx-warn-bg);
	border-radius: 6px;
	padding: 9px 11px;
	font-family: var(--dmx-sans);
}

/* Tablo -------------------------------------------------------------- */

.dmx-adr__tablewrap {
	margin: 14px 16px 16px;
	overflow-x: auto;
	border: 1px solid var(--dmx-line);
	border-radius: 8px;
}

.dmx-adr__table {
	width: 100%;
	border-collapse: collapse;
	background: var(--dmx-surface);
	margin: 0;
	font-size: .94em;
}

.dmx-adr__table th,
.dmx-adr__table td {
	padding: 10px 13px;
	text-align: left;
	border-bottom: 1px solid var(--dmx-line-soft);
	vertical-align: middle;
}

.dmx-adr__table thead th {
	background: var(--dmx-head);
	color: var(--dmx-head-text);
	border-bottom: none;
	white-space: nowrap;
}

.dmx-adr__table tbody tr:last-child td {
	border-bottom: none;
}

/* Beşerli gruplama — sayarken göz kaymasın */
.dmx-adr__table tbody tr:nth-child(5n+1):not(:first-child) td {
	border-top: 1px solid var(--dmx-line);
}

.dmx-adr__table tbody tr:hover td {
	background: var(--dmx-on-soft);
}

.dmx-adr__table tbody tr[data-over="1"] td {
	background: var(--dmx-warn-bg);
	color: var(--dmx-warn);
}

.dmx-adr__col-no,
.dmx-adr__col-num,
.dmx-adr__table td.is-num {
	text-align: right;
	font-family: var(--dmx-mono);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	width: 1%;
}

.dmx-adr__table td.is-num:first-child {
	color: var(--dmx-muted);
}

.dmx-adr__col-dip,
.dmx-adr__table td.dmx-adr__dipcell {
	text-align: right;
	white-space: nowrap;
	width: 1%;
}

.dmx-adr__empty {
	text-align: center;
	color: var(--dmx-muted);
	padding: 26px 12px;
}

.dmx-adr__legend {
	margin: 12px 2px 0;
	font-size: .8em;
	line-height: 1.55;
	color: var(--dmx-muted);
}

/* DIP switch kutusu -------------------------------------------------- */

.dmx-dip {
	display: inline-flex;
	align-items: center;
	gap: 11px;
}

.dmx-dip__block {
	display: inline-flex;
	align-items: stretch;
	gap: 2px;
	padding: 4px;
	background: var(--dmx-housing);
	border: 1px solid var(--dmx-housing-edge);
	border-radius: 4px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.dmx-dip__on {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px 0 2px;
	font-family: var(--dmx-mono);
	font-size: 8px;
	font-weight: 700;
	letter-spacing: .12em;
	color: #9aa3ac;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
}

.dmx-dip__sw {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	width: 14px;
}

.dmx-dip__lever {
	position: relative;
	display: block;
	width: 12px;
	height: 22px;
	background: var(--dmx-lever);
	border-radius: 2px;
	overflow: hidden;
	transition: background-color .15s ease;
}

.dmx-dip__lever::after {
	content: "";
	position: absolute;
	left: 1px;
	right: 1px;
	top: 11px;
	height: 9px;
	background: var(--dmx-off);
	border-radius: 1px;
	transition: top .13s ease, background-color .13s ease, box-shadow .13s ease;
}

.dmx-dip__sw.is-on .dmx-dip__lever::after {
	top: 2px;
	background: var(--dmx-on);
	box-shadow: 0 0 5px rgba(242, 167, 27, .6);
}

.dmx-dip__sw.is-mode .dmx-dip__lever {
	opacity: .45;
}

.dmx-dip__num {
	font-family: var(--dmx-mono);
	font-size: 9px;
	line-height: 1;
	color: #99a2ab;
	transition: color .15s ease;
}

.dmx-dip__sw.is-on .dmx-dip__num {
	color: var(--dmx-on);
}

.dmx-dip__text {
	min-width: 8ch;
	font-family: var(--dmx-mono);
	font-size: .78em;
	color: var(--dmx-muted);
	text-align: left;
}

.dmx-dip__text b {
	color: var(--dmx-text);
	font-weight: 600;
}

/* Büyük, dokunmatik blok */

.dmx-dip__block--lg {
	padding: 7px;
	gap: 5px;
	border-radius: 6px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 6px rgba(0, 0, 0, .15);
}

.dmx-dip__block--lg .dmx-dip__on {
	font-size: 11px;
	padding: 0 7px 0 3px;
}

.dmx-dip__block--lg .dmx-dip__sw {
	width: 26px;
	gap: 5px;
}

.dmx-dip__block--lg .dmx-dip__lever {
	width: 22px;
	height: 46px;
	border-radius: 3px;
}

.dmx-dip__block--lg .dmx-dip__lever::after {
	left: 2px;
	right: 2px;
	top: 25px;
	height: 19px;
	border-radius: 2px;
}

.dmx-dip__block--lg .dmx-dip__sw.is-on .dmx-dip__lever::after {
	top: 4px;
	box-shadow: 0 0 10px rgba(242, 167, 27, .65);
}

.dmx-dip__block--lg .dmx-dip__num {
	font-size: 12px;
}

button.dmx-dip__sw {
	padding: 0;
	font: inherit;
	background: none;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

button.dmx-dip__sw:hover .dmx-dip__lever {
	background: #4e5864;
}

button.dmx-dip__sw:hover .dmx-dip__num {
	color: #ffffff;
}

/* Odak halkası ------------------------------------------------------- */

.dmx-adr input:focus-visible,
.dmx-adr select:focus-visible,
.dmx-adr button:focus-visible,
.dmx-adr summary:focus-visible {
	outline: 2px solid var(--dmx-on);
	outline-offset: 2px;
}

.dmx-single__stepper input:focus-visible,
.dmx-single__step:focus-visible,
.dmx-lang__btn:focus-visible {
	outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
	.dmx-adr * {
		transition: none !important;
	}
}

/* Mobil -------------------------------------------------------------- */

@media (max-width: 720px) {
	.dmx-single {
		padding: 16px;
		gap: 14px;
	}

	.dmx-single__entry,
	.dmx-single__dip {
		flex: 1 0 100%;
		justify-content: flex-start;
	}

	.dmx-single__dip {
		overflow-x: auto;
		padding-bottom: 4px;
	}

	.dmx-single__math {
		display: block;
		margin: 8px 0 0;
	}

	.dmx-adr__tablewrap {
		border: none;
		overflow: visible;
		margin: 12px 10px 14px;
	}

	.dmx-adr__note {
		margin: 0 10px;
	}

	.dmx-adr__table,
	.dmx-adr__table tbody,
	.dmx-adr__table tr,
	.dmx-adr__table td {
		display: block;
		width: auto;
	}

	.dmx-adr__table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.dmx-adr__table tbody tr {
		margin-bottom: 10px;
		padding: 8px 4px;
		background: var(--dmx-surface);
		border: 1px solid var(--dmx-line);
		border-radius: 8px;
	}

	.dmx-adr__table tbody tr:nth-child(5n+1):not(:first-child) td {
		border-top: 0;
	}

	.dmx-adr__table td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		width: auto;
		padding: 5px 12px;
		text-align: right;
		border-bottom: none;
	}

	.dmx-adr__table td::before {
		content: attr(data-label);
		font-size: .7em;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: .1em;
		color: var(--dmx-muted);
		text-align: left;
	}

	.dmx-adr__table td.dmx-adr__dipcell {
		display: block;
		padding-top: 10px;
		text-align: center;
	}

	.dmx-adr__table td.dmx-adr__dipcell::before {
		display: block;
		margin-bottom: 8px;
		text-align: left;
	}

	.dmx-dip {
		flex-direction: column;
		gap: 6px;
	}
}

/* Yazdırma ------------------------------------------------------------ */

@media print {
	.dmx-adr {
		--dmx-surface: #fff;
		--dmx-bg: #fff;
		--dmx-head: #eee;
		--dmx-head-text: #000;
		--dmx-housing: #fff;
		--dmx-housing-edge: #000;
		--dmx-lever: #fff;
		--dmx-off: #fff;
		--dmx-on: #000;
	}

	.dmx-adr__panel,
	.dmx-adr__actions,
	.dmx-lang,
	.dmx-single__stepper,
	.dmx-single__hint,
	.dmx-batch__summary {
		display: none !important;
	}

	.dmx-dip__block {
		box-shadow: none;
	}

	.dmx-dip__lever {
		border: 1px solid #000;
	}

	.dmx-dip__num,
	.dmx-dip__on {
		color: #000;
	}

	.dmx-adr__table thead th {
		border-bottom: 1px solid #000;
	}

	.dmx-adr__table tbody tr {
		page-break-inside: avoid;
	}
}
