/* BroadTools Console: base comum do Talks (tokens de redesign/console.css).
   Chassi grafite, poços rebaixados, comandos como teclas físicas.
   Cor só com significado: vermelho = no ar (eu falando), verde = ligado / alguém falando,
   âmbar = atenção (chamada, teste), azul = seleção/edição. */
@font-face { font-family: Archivo; src: url(/fontes/archivo.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

:root {
  --chassi: #17191c; --topo: #121417; --poco: #0e0f11; --painel: #1f2226;
  --tecla: #2a2d32; --tecla-2: #33373d; --linha: #2e3137; --linha-2: #3a3e45;
  --texto: #ecebe6; --mudo: #8d939b; --apagado: #5c626a;
  --programa: #e5322d; --preview: #23b26a; --atencao: #f0a43a; --edicao: #4f8ef7;
  --raio: 8px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Archivo, system-ui, sans-serif; font-size: 13px; font-weight: 500; font-stretch: 100%;
  color: var(--texto); background: var(--chassi); line-height: 1.35;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
[hidden], .hidden { display: none !important; }
a { color: #9cc0ff; }
:focus-visible { outline: 2px solid var(--edicao); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Marca: grade 3×2 com a 2ª tecla acesa em vermelho + nome do app */
.marca { display: flex; align-items: center; gap: 10px; font-stretch: 112%; font-weight: 750; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; color: var(--texto); text-decoration: none; }
.marca .grade { display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
.marca .grade i { width: 6px; height: 6px; border-radius: 1.5px; background: #3b3f46; }
.marca .grade i:nth-child(2) { background: var(--programa); box-shadow: 0 0 6px #e5322d88; }
.marca small { font-stretch: 100%; font-weight: 500; font-size: 12px; color: var(--mudo); }

/* Lâmpada (LED) + texto */
.lamp { display: inline-flex; align-items: center; gap: 7px; color: var(--mudo); font-size: 12px; white-space: nowrap; }
.lamp::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3b3f46; box-shadow: inset 0 1px 1px #0008; flex: none; }
.lamp.verde::before { background: var(--preview); box-shadow: 0 0 6px #23b26a99; }
.lamp.vermelho::before { background: var(--programa); box-shadow: 0 0 7px #e5322daa; }
.lamp.ambar::before { background: var(--atencao); box-shadow: 0 0 6px #f0a43a99; }
.lamp b { color: var(--texto); font-weight: 600; }

/* Teclas */
button, .tecla {
  font: inherit; color: var(--texto); background: linear-gradient(#30343a, #2a2d32); border: 0; border-radius: 7px;
  box-shadow: inset 0 1px 0 #ffffff12, 0 1px 0 #00000080, 0 0 0 1px #0000004d; height: 34px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-weight: 600; cursor: pointer;
  text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button:hover { background: linear-gradient(#363a41, #2f3237); }
button:active { transform: translateY(1px); box-shadow: inset 0 1px 2px #0008, 0 0 0 1px #0000004d; }
button:disabled { opacity: .45; cursor: default; transform: none; }
button .atalho { font-stretch: 75%; font-weight: 700; font-size: 11px; color: var(--mudo); background: #00000040; border-radius: 3px; padding: 1px 5px; }
.tecla.grande, button.grande { height: 46px; font-size: 14px; padding: 0 18px; }
button.ico { width: 34px; padding: 0; }
button.fantasma { background: none; box-shadow: none; color: var(--mudo); }
button.fantasma:hover { color: var(--texto); background: #ffffff0a; }
button.prog { background: linear-gradient(#3a1414, #2d1011); box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 1px var(--programa), 0 0 14px #e5322d55; color: #fff; }
button.verde { box-shadow: inset 0 1px 0 #ffffff12, 0 0 0 1px var(--preview), 0 0 12px #23b26a33; }
button.ambar { box-shadow: inset 0 1px 0 #ffffff12, 0 0 0 1px var(--atencao), 0 0 12px #f0a43a44; color: #ffd9a3; }
button.vai-verde { background: linear-gradient(#27c072, #1f9e5d); box-shadow: inset 0 1px 0 #ffffff33, 0 1px 0 #0009; color: #fff; }
button.vai-verde:hover { background: linear-gradient(#2bcc7a, #21a662); }
button.perigo { color: #ff9b97; }
button.perigo.armado { background: linear-gradient(#e83a35, #cf2a25); color: #fff; }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Controle segmentado */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--poco); box-shadow: inset 0 1px 2px #0009; }
.seg button { height: 28px; padding: 0 12px; background: none; box-shadow: none; color: var(--mudo); border-radius: 6px; }
.seg button:hover { color: var(--texto); background: none; }
.seg button.on { color: var(--texto); background: linear-gradient(#34383e, #2c2f34); box-shadow: inset 0 1px 0 #ffffff14, 0 1px 2px #0008; }

/* Poço e rótulos */
.poco { background: var(--poco); border-radius: var(--raio); box-shadow: inset 0 1px 3px #000c, 0 0 0 1px #ffffff08; }
.rotulo { font-size: 12px; font-weight: 600; color: var(--mudo); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.rotulo .linha-fim { flex: 1; height: 1px; background: var(--linha); }
.leitura { font-stretch: 72%; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.mudo { color: var(--mudo); }
.dica { color: var(--mudo); font-size: 12px; line-height: 1.45; max-width: 68ch; }

/* Campos */
input[type=text], input[type=password], input[type=email], input[type=number], select {
  font: inherit; color: var(--texto); height: 34px; padding: 0 12px; background: var(--poco); border: 0; border-radius: 7px;
  box-shadow: inset 0 1px 2px #000a, 0 0 0 1px #ffffff0a; width: 100%; min-width: 0;
}
input::placeholder { color: var(--apagado); }
input:focus, select:focus { outline: none; box-shadow: inset 0 1px 2px #000a, 0 0 0 1px var(--edicao); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--mudo) 50%), linear-gradient(135deg, var(--mudo) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.campo { display: grid; gap: 6px; margin: 0 0 12px; }
.campo > span { font-size: 12px; font-weight: 600; color: var(--mudo); }
input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; flex: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }

/* Chave liga/desliga (checkbox) */
input.chave { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 10px; background: #3a3e45; position: relative; box-shadow: inset 0 1px 2px #0008; flex: none; cursor: pointer; margin: 0; }
input.chave::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #c9ccd1; box-shadow: 0 1px 2px #0009; transition: left .12s; }
input.chave:checked { background: var(--preview); }
input.chave:checked::after { left: 17px; background: #fff; }
.linha-ajuste { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 0; }
.linha-ajuste > span:first-child { flex: 1; }
.linha-ajuste small { display: block; color: var(--mudo); font-size: 12px; font-weight: 500; margin-top: 2px; line-height: 1.4; }

/* Fader (input range) */
input[type=range] { -webkit-appearance: none; appearance: none; background: none; height: 28px; margin: 0; cursor: pointer; min-width: 60px; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--poco); box-shadow: inset 0 1px 2px #000, 0 0 0 1px #ffffff0a; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--poco); box-shadow: inset 0 1px 2px #000; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 24px; margin-top: -9px; border-radius: 4px;
  background: linear-gradient(#5a5f67, #3a3e45 45%, #c9ccd1 46%, #c9ccd1 54%, #3a3e45 55%, #2f3237); box-shadow: 0 1px 3px #000c, inset 0 1px 0 #ffffff26; }
input[type=range]::-moz-range-thumb { width: 16px; height: 24px; border: 0; border-radius: 4px;
  background: linear-gradient(#5a5f67, #3a3e45 45%, #c9ccd1 46%, #c9ccd1 54%, #3a3e45 55%, #2f3237); box-shadow: 0 1px 3px #000c; }

/* Medidor (VU) em segmentos */
.vu { position: relative; height: 8px; border-radius: 2px; background: var(--poco); box-shadow: inset 0 1px 2px #000; overflow: hidden; min-width: 40px; }
.vu b { position: absolute; inset: 0; clip-path: inset(0 100% 0 0); transition: clip-path .08s linear;
  background: linear-gradient(90deg, #1f9e5d 0 70%, #d9b23a 70% 88%, #e5322d 88%); }
.vu::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 5px, #0e0f11 5px 6px); }

.etiqueta { font-stretch: 75%; font-weight: 800; font-size: 11px; letter-spacing: .04em; border-radius: 4px; padding: 2px 6px; line-height: 1.2; }
.etiqueta.noar { color: #fff; background: var(--programa); box-shadow: 0 0 10px #e5322d77; }
.erro { color: #ffb4b0; background: #2a1112; box-shadow: inset 0 0 0 1px #e5322d55; border-radius: 7px; padding: 10px 12px; line-height: 1.45; }
.erro a { color: #fff; }
