/* Captioner: BroadTools Console (tokens em /_kit/bt-console.css).
   A tela do operador é a mesa: prévia da saída num monitor rebaixado, ajustes
   num painel à direita, estado na barra de baixo. A saída (display.html) não
   usa nada disto. */
@font-face { font-family: Archivo; src: url(../fontes/archivo.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

html, body { height: 100%; }
body { min-height: 100%; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.tecla.pequena { height: 32px; padding: 0 12px; font-size: 13px; }
.tecla.ico { width: 36px; padding: 0; }
.topo .tecla.fantasma { color: #8d939b; height: 34px; }
.topo .tecla.fantasma:hover { color: #ecebe6; background: #ffffff12; }
.topo .tecla.fantasma[aria-pressed="true"] { color: #ecebe6; background: #ffffff10; box-shadow: inset 0 0 0 1px #3a3e45; }
.tecla.perigo { color: #ffc9c7; box-shadow: inset 0 1px 0 #ffffff12, 0 1px 0 #00000080, 0 0 0 1px #e5322d88; }
.tecla.prog { min-width: 150px; }
#startStopBtn { min-width: 150px; }
code { font: 600 12px/1 var(--fonte); background: var(--tecla); padding: 2px 5px; border-radius: 4px; color: var(--texto); }

/* ------------------------------------------------------------ login */
.cartao-login .icone-app { width: 64px; height: 64px; margin: -4px 0 2px -4px; }
.cartao-login .credito-login { font-size: 11.5px; color: var(--apagado); border-top: 1px solid var(--linha); padding-top: 12px; }
#assinar { height: 40px; }

/* ------------------------------------------------------------ cabeçalho */
.topo { gap: 10px; }
.topo .marca { margin-right: 6px; }
#localeSelect { width: 220px; min-height: 34px; height: 34px; }
.no-ar { display: inline-flex; align-items: center; height: 26px; }
.no-ar .tag { display: none; font-stretch: 75%; font-weight: 800; font-size: 13px; color: #fff; background: var(--programa); border-radius: 4px; padding: 3px 8px; box-shadow: 0 0 12px #e5322d88; }
.no-ar .parado { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #8d939b; }
.no-ar .parado::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lamp-off); box-shadow: inset 0 1px 1px #0008; }
.no-ar.live .tag { display: inline-block; }
.no-ar.live .parado { display: none; }

/* ------------------------------------------------------------ mesa */
.app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body:has(.app:not([hidden])) { height: 100vh; overflow: hidden; }
.area { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }

.palco { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 14px; }
.palco-topo { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.rotulo-palco { font-weight: 650; font-size: 13px; }
.escala { font-size: 12px; }
.palco > .msg { flex: none; }

.stage {
	flex: 1; min-height: 0; position: relative; display: grid; place-items: center;
	background: var(--poco); border-radius: 10px; box-shadow: inset 0 1px 3px #000c, 0 0 0 1px #ffffff08;
	padding: 14px; container-type: size;
}
/* O quadro é a tela 1920x1080 em escala. O xadrez aparece onde o fundo é transparente. */
.quadro {
	position: relative; aspect-ratio: 16 / 9; width: min(100cqw, 100cqh * 16 / 9);
	background-color: #121315;
	background-image: linear-gradient(45deg, #1b1d20 25%, transparent 25%, transparent 75%, #1b1d20 75%), linear-gradient(45deg, #1b1d20 25%, transparent 25%, transparent 75%, #1b1d20 75%);
	background-size: 16px 16px; background-position: 0 0, 8px 8px;
	box-shadow: 0 0 0 1px #2e3137, 0 12px 40px -12px #000;
	overflow: hidden;
}
.stage:fullscreen { padding: 0; border-radius: 0; background: #000; }
.stage:fullscreen .quadro { width: 100%; height: 100%; aspect-ratio: auto; box-shadow: none; background: #000; }
.caption-wrap { position: absolute; inset: 0; overflow: hidden; }
.caption-text {
	overflow-y: auto; overflow-x: hidden; width: 100%; scrollbar-width: none;
	word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.caption-text::-webkit-scrollbar { display: none; }
.placeholder {
	display: block; color: #8d939b !important; font: 500 15px/1.6 var(--fonte) !important; font-stretch: 100% !important;
	text-transform: none !important; letter-spacing: normal !important; text-shadow: none !important; font-style: normal !important;
}
.placeholder b { color: #ecebe6; font-weight: 650; }

/* ------------------------------------------------------------ painel */
.panel {
	width: 392px; min-height: 0; display: none; flex-direction: column;
	background: var(--painel); border-left: 1px solid #0000004d; box-shadow: inset 1px 0 0 #ffffff08;
}
.panel.open { display: flex; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0 16px; font-weight: 650; font-size: 13px; }
.panel-tabs { margin: 10px 12px 0; display: grid !important; grid-template-columns: repeat(5, auto); }
.panel-tabs button { justify-content: center; padding: 0 6px; font-size: 12.5px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; scrollbar-width: thin; scrollbar-color: #3a3e45 transparent; }
.panel-body section { display: flex; flex-direction: column; gap: 10px; }
.h3 { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--linha); font-size: 12px; font-weight: 650; color: var(--texto); }
.panel-body section > .h3:first-child { border-top: 0; padding-top: 8px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .rot { font-size: 12px; font-weight: 600; color: var(--mudo); display: flex; justify-content: space-between; gap: 8px; flex-direction: row; }
.field .value { color: var(--texto); font-variant-numeric: tabular-nums; font-weight: 600; white-space: pre; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: end; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.hint { margin: 0; font-size: 12px; color: var(--mudo); line-height: 1.5; }
.hint b { color: var(--texto); font-weight: 600; }
.hint:empty { display: none; }
.panel select, .panel input[type=text], .panel input[type=number] { min-height: 34px; height: 34px; }
.panel textarea { min-height: 140px; font-size: 13px; line-height: 1.5; }

/* Grupo de posição: segmentado em grade */
.seg-grade { padding: 3px; border-radius: 8px; background: var(--poco); box-shadow: inset 0 1px 2px #0009; }
.seg-grade button { height: 30px; padding: 0 4px; font-size: 12px; white-space: normal; line-height: 1.1; color: var(--mudo); background: none; box-shadow: none; border-radius: 6px; }
.seg-grade button:hover { color: var(--texto); background: #ffffff08; }
.seg-grade button.on { color: var(--texto); background: linear-gradient(#22324d, #1b2840); box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 1px var(--edicao); }

/* Faixa deslizante */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--poco); box-shadow: inset 0 1px 2px #000, 0 0 0 1px #ffffff0a; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 18px; margin-top: -7px; border-radius: 4px; background: linear-gradient(#4a4f57, #33373d); box-shadow: inset 0 1px 0 #ffffff26, 0 1px 2px #000c, 0 0 0 1px #0008; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--poco); }
input[type=range]::-moz-range-thumb { width: 14px; height: 18px; border: 0; border-radius: 4px; background: linear-gradient(#4a4f57, #33373d); }
input[type=range]:focus-visible { outline: 2px solid var(--edicao); outline-offset: 2px; }

/* Chave liga/desliga com lâmpada */
.chave-linha { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; font-size: 13px; font-weight: 500; color: var(--texto); cursor: pointer; }
input.chave { -webkit-appearance: none; appearance: none; flex: none; width: 40px; height: 22px; margin: 0; border-radius: 11px; cursor: pointer; position: relative;
	background: var(--poco); box-shadow: inset 0 1px 2px #000c, 0 0 0 1px #ffffff0f; transition: background .15s; }
input.chave::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(#4a4f57, #33373d); box-shadow: inset 0 1px 0 #ffffff26, 0 1px 2px #000c; transition: transform .15s; }
input.chave:checked { background: #0f2a1c; box-shadow: inset 0 1px 2px #000c, 0 0 0 1px var(--preview), 0 0 10px #23b26a33; }
input.chave:checked::after { transform: translateX(18px); background: linear-gradient(#3ad485, #23b26a); }
input.chave:disabled { opacity: .4; cursor: default; }

/* Cor */
.cor { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--texto); cursor: pointer; min-height: 34px; }
#panel .cor input[type=color] { -webkit-appearance: none; appearance: none; width: 34px; height: 34px; padding: 3px; border: 0; border-radius: 7px; background: var(--poco); box-shadow: inset 0 1px 2px #000a, 0 0 0 1px #ffffff14; cursor: pointer; flex: none; }
.cor input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cor input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.cor input[type=color]::-moz-color-swatch { border: 0; border-radius: 4px; }

.desligado { opacity: .4; pointer-events: none; }
#shadowControls { display: flex; flex-direction: column; gap: 10px; }

/* Substituições */
#replList { display: flex; flex-direction: column; gap: 6px; }
#replList:empty { display: none; }
.repl-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 6px; }
.repl-row input { min-width: 0; }
.icon-btn { width: 34px; height: 34px; padding: 0; color: var(--mudo); }
.icon-btn:hover { color: #ffc9c7; }

.atalhos { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.atalhos div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; }
.atalhos dt { display: flex; gap: 3px; }
.atalhos dd { margin: 0; color: var(--mudo); }
kbd { font: 700 11px/1 var(--fonte); font-stretch: 85%; color: var(--texto); background: linear-gradient(#30343a, #2a2d32); border-radius: 4px; padding: 4px 6px; box-shadow: inset 0 1px 0 #ffffff12, 0 1px 0 #000; }
.relay-estado { display: flex; align-items: center; gap: 12px; min-height: 22px; font-size: 12px; }
#relayLink { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }

/* ------------------------------------------------------------ barra de status */
.status { min-height: 32px; gap: 16px; flex-wrap: wrap; }
.status b { color: var(--texto); font-weight: 650; }
.status .tempo { font-size: 17px; color: var(--texto); letter-spacing: .01em; }
.meter { width: 140px; height: 6px; border-radius: 3px; background: var(--poco); box-shadow: inset 0 1px 2px #000; overflow: hidden; display: inline-block; }
.meter > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #1f9e5d, #3ad485); transition: width .08s linear; }
.meter.low > i { background: var(--apagado); }
.meter.high > i { background: linear-gradient(90deg, #f0a43a, #e5322d); }
.volume-hint { color: var(--atencao); }
.volume-hint:empty { display: none; }

/* ------------------------------------------------------------ avisos */
.toasts { position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--tecla); color: var(--texto); padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 1px #0008, 0 12px 28px #000a; animation: sobe .18s ease; max-width: 90vw; }
@keyframes sobe { from { opacity: 0; transform: translateY(6px); } }
.modal-bg { position: fixed; inset: 0; background: #000a; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 480px; padding: 22px 22px 18px; background: var(--painel); border-radius: 12px; box-shadow: inset 0 1px 0 #ffffff0d, 0 0 0 1px #0000004d, 0 24px 60px #000c; line-height: 1.55; }
.modal h2 { margin: 0 0 10px; font-stretch: 112%; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.modal p { margin: 0 0 10px; color: var(--mudo); font-size: 13.5px; }
.modal p b { color: var(--texto); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ------------------------------------------------------------ telas menores */
@media (max-width: 1180px) {
	#localeSelect { width: 170px; }
	.escala { display: none; }
}
@media (max-width: 900px) {
	body:has(.app:not([hidden])) { height: auto; overflow: auto; }
	.topo { flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; }
	.topo .marca { order: 0; }
	.no-ar { order: 1; }
	.topo .espaco { order: 2; }
	#offline, .topo .quem, #fullscreenBtn, #painelBtn, #sair { order: 3; }
	#localeSelect { order: 4; flex: 1 1 140px; width: auto; }
	#startStopBtn { order: 5; flex: 1 1 150px; }
	#clearBtn { order: 6; }
	.topo .quem { display: block; max-width: 26vw; }
	.topo { gap: 8px; }
	#painelBtn, #panelClose { display: none; }
	.area { grid-template-columns: minmax(0, 1fr); }
	.palco { padding: 10px 12px; }
	.stage { flex: none; container-type: inline-size; padding: 8px; }
	.quadro { width: 100%; }
	/* No celular os ajustes ficam sempre abertos, abaixo da prévia. */
	.panel, .panel:not(.open) { display: flex; width: auto; border-left: 0; border-top: 1px solid #0000004d; }
	.panel-body { overflow: visible; }
	.panel-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.panel-tabs button { font-size: 12px; padding: 0 2px; }
	.status { position: sticky; bottom: 0; padding: 6px 12px; gap: 10px 14px; }
	.meter { width: 90px; }
	#fullscreenBtn { display: none; }
}
