/* Faixa de abas do painel (tabs.js). A aba ativa tem a cor da página e "encaixa" no conteúdo, com a borda de cima âmbar. */
:root { --tabs-h: 0px; }

.tabstrip { position: relative; display: flex; align-items: flex-end; gap: 4px; margin: -26px -30px 18px; padding: 10px 30px 0; background: var(--side); border-bottom: 1px solid var(--line); }
.tabstrip:empty { display: none; }
.tabs-list { position: relative; display: flex; align-items: flex-end; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; } /* relative: offsetLeft das abas conta a partir da lista */
.tabs-list::-webkit-scrollbar { display: none; }

.tab { position: relative; flex: 0 0 auto; display: flex; align-items: center; max-width: 300px; height: 38px; margin-bottom: -1px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: var(--dim); transition: background-color .12s, color .12s; }
.tab:hover { color: var(--fg); background: rgba(255,255,255,.035); }
.tab.on { color: var(--fg); background: var(--bg); border-color: var(--line); box-shadow: inset 0 2px 0 var(--amber); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--bg); } /* cobre a linha da faixa: a aba se liga à tela */
.tab.sortable-ghost { opacity: .4; }

.tab-main { display: flex; align-items: center; gap: 8px; height: 100%; min-width: 0; padding: 0 6px 0 12px; border: 0; background: none; color: inherit; font: 500 .84rem var(--f-body); cursor: pointer; border-radius: 9px 9px 0 0; }
.tab-main:last-child { padding-right: 14px; }
.tab-main svg, .tm-item svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on .tab-main svg { color: var(--amber); }
.tab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-ch { flex-shrink: 1; display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; padding: 1px 6px; border: 1px solid rgba(255,178,36,.4); border-radius: 5px; font: 600 .64rem/1.3 var(--f-mono); color: var(--amber); }
.tab-chn { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 .7rem/1.3 var(--f-body); color: var(--dim); }
.tab.on .tab-chn { color: var(--fg); }

.tab-x { display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; margin-right: 7px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dim); font-size: 1.05rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s, background-color .12s; }
.tab:hover .tab-x, .tab.on .tab-x, .tab-x:focus-visible { opacity: 1; }
.tab-x:hover { background: rgba(255,255,255,.09); color: var(--fg); }

.tab-add { flex: 0 0 auto; width: 32px; height: 32px; margin: 0 0 3px 2px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--dim); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.tab-add:hover, .tab-add[aria-expanded="true"] { color: var(--fg); background: rgba(255,255,255,.05); border-color: var(--line); }

/* menu do "+" */
.tab-menu { position: absolute; z-index: 40; top: calc(100% + 6px); width: 290px; max-height: min(72vh, 580px); overflow-y: auto; display: grid; gap: 4px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.85); }
.tm-ch { display: grid; gap: 6px; padding: 4px 6px 10px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.tm-ch select { width: 100%; }
.tm-sep { padding: 8px 10px 3px; font: 500 .6rem var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: #565b66; }
.tm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--dim); font: 500 .86rem var(--f-body); text-align: left; cursor: pointer; }
.tm-item:hover, .tm-item:focus-visible { background: var(--panel-2); color: var(--fg); }
.tm-item small { margin-left: auto; font: 500 .58rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #565b66; }

/* áudio do programa (monitor-audio.js): alto-falante + medidor real + volume, à direita da faixa */
.ma-box { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 4px auto; flex: 0 0 auto; }
.ma-btn { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--dim); cursor: pointer; }
.ma-btn:hover { color: var(--fg); border-color: #3a404c; }
.ma-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ma-box:not(.on) .ma-wave, .ma-box.on .ma-off { display: none; }
.ma-box.on .ma-btn { color: var(--amber); border-color: rgba(255,178,36,.45); background: rgba(255,178,36,.08); }
.ma-box.pending .ma-btn { animation: maWait 1.4s ease-in-out infinite; } /* ligado, esperando um clique para soltar o som */
@keyframes maWait { 50% { border-color: rgba(255,178,36,.15); } }
.ma-meter { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.ma-box.on .ma-meter { display: flex; }
.ma-meter i { position: relative; width: 3px; height: 100%; border-radius: 1px; overflow: hidden; background: rgba(255,255,255,.12); }
.ma-meter i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl, 0%); background: linear-gradient(to top, var(--ok) 0 70%, var(--amber) 70% 90%, var(--live) 90%); background-size: 100% 14px; background-position: bottom; }
.ma-ch { font: 600 .64rem/1 var(--f-mono); color: var(--amber); }
.ma-ch:empty { display: none; }
#pgmAudVol { width: 84px; accent-color: var(--amber); padding: 0; border: 0; background: none; }
/* fonte do som (som-fonte.js): uma escolha só, para todas as telas; e o aviso discreto quando o som não bate com a imagem */
.ma-src { height: 28px; max-width: 230px; padding: 0 6px; font: 500 var(--text-xs, 11px) var(--f-body); color: var(--fg); background: var(--c-panel-2, #151922); border: 1px solid var(--line); border-radius: 7px; }
.ma-hint { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--c-panel, #0f1218); box-shadow: 0 6px 18px rgba(0,0,0,.35); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; max-width: 420px; padding: 3px 4px 3px 9px; border: 1px dashed rgba(255,178,36,.45); border-radius: 7px; font: 500 var(--text-xs, 11px)/1.25 var(--f-body); color: var(--dim); }
.ma-hint > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-hint-btn { flex: none; height: 22px; padding: 0 8px; border: 1px solid rgba(255,178,36,.5); border-radius: 6px; background: rgba(255,178,36,.1); color: var(--amber); font: 600 var(--text-xs, 11px) var(--f-body); cursor: pointer; }
.ma-hint-btn:hover { background: rgba(255,178,36,.2); }
@media (max-width: 1100px) { .ma-hint > span { display: none; } } /* janela estreita: só o atalho (o texto fica no title) */

/* com a faixa de abas, o título grande de cada tela repetia o nome da aba: sai da vista (continua para leitores de tela) e o
   conteúdo sobe. Cabeçalho que só tinha o título some; o que tinha pílula ou botões fica com eles à direita, como antes. */
.tabstrip:not(:empty) ~ .view > .head > h2 { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.tabstrip:not(:empty) ~ .view > .head { justify-content: flex-end; }
.tabstrip:not(:empty) ~ .view > .head:not(:has(> :not(h2))) { display: contents; }

/* computador: a faixa fica presa no topo ao rolar; o que outras telas prendem no topo desce a altura dela */
@media (min-width: 861px) {
  :root { --tabs-h: 49px; }
  .tabstrip { position: sticky; top: 0; z-index: 30; height: var(--tabs-h); }
  .gfx-pv, .cg-left, .cg-edside, .lib-side { top: calc(var(--tabs-h) + 12px); }
  .cg-savebar { top: calc(var(--tabs-h) + 6px); }
  .cg-left { max-height: calc(100vh - 40px - var(--tabs-h)); }
  .cg-edside { max-height: calc(100vh - 30px - var(--tabs-h)); }
}
/* celular/tablet: o menu de cima já fica preso; a faixa rola com a página */
@media (max-width: 860px) {
  .tabstrip { margin: -18px -16px 14px; padding: 8px 16px 0; }
  .tab { max-width: 190px; }
  .tab-chn { display: none; } /* no celular fica só o número do canal */
  .tab-x { opacity: 1; }
  .tab-menu { width: min(290px, calc(100vw - 32px)); }
  #pgmAudVol { display: none; } /* no celular o volume fica com o aparelho */
}
@media (prefers-reduced-motion: reduce) { .tab, .tab-x { transition: none; } .ma-box.pending .ma-btn { animation: none; } }
