:root {
  --fundo: #f4f5f7; --cartao: #ffffff; --texto: #1c2230; --suave: #667085; --borda: #e2e5ea;
  --marca: #4f46e5; --marca-2: #eef0ff; --ok: #12805c; --ok-2: #e6f6ef; --alerta: #b54708; --alerta-2: #fff4e5;
  --erro: #c0262d; --erro-2: #fdecec; --raio: 12px; --sombra: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root { --fundo: #0f1217; --cartao: #171b22; --texto: #e7e9ee; --suave: #9aa3b2; --borda: #2a303b;
    --marca: #8b85ff; --marca-2: #23224a; --ok: #3ccf91; --ok-2: #12301f; --alerta: #f4a543; --alerta-2: #3a2a12;
    --erro: #ff6b6b; --erro-2: #3a1717; --sombra: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overflow-x: hidden; }
a { color: var(--marca); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.suave { color: var(--suave); font-size: 13px; }
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--cartao); border-bottom: 1px solid var(--borda); }
.topo .marca { font-weight: 700; white-space: nowrap; }
.topo .marca b { color: var(--marca); }
.topo select { max-width: 46vw; }
.topo .espaco { flex: 1; }
.conteudo { max-width: 980px; margin: 0 auto; padding: 16px 16px 96px; }
.abas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--cartao); border-top: 1px solid var(--borda); padding-bottom: env(safe-area-inset-bottom); }
.abas a { flex: 1; text-align: center; padding: 8px 2px 9px; font-size: 11px; color: var(--suave); text-decoration: none; }
.abas a span { display: block; font-size: 19px; line-height: 1.2; }
.abas a.ativa { color: var(--marca); font-weight: 600; }
@media (min-width: 900px) {
  .abas { top: 57px; bottom: 0; right: auto; width: 150px; flex-direction: column; border-top: 0; border-right: 1px solid var(--borda); }
  .abas a { flex: 0; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; text-align: left; }
  .abas a span { font-size: 18px; }
  .conteudo { padding-left: 166px; padding-bottom: 32px; max-width: 1146px; }
}
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; margin-bottom: 12px; box-shadow: var(--sombra); }
.linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.linha > .cresce { flex: 1; min-width: 0; }
.grade-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
label.campo { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--suave); }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 10px; background: var(--cartao); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=range] { width: auto; min-height: 0; }
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--borda); background: var(--cartao); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--texto); }
.botao.primario { background: var(--marca); border-color: var(--marca); color: #fff; }
.botao.perigo { color: var(--erro); }
.botao.pequeno { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.botao:disabled { opacity: .5; cursor: default; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.lista li:last-child { border-bottom: 0; }
.lista .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .nome small { display: block; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selo { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--marca-2); color: var(--marca); white-space: nowrap; }
.selo.ok { background: var(--ok-2); color: var(--ok); }
.selo.alerta { background: var(--alerta-2); color: var(--alerta); }
.selo.erro { background: var(--erro-2); color: var(--erro); }
.vazio { text-align: center; color: var(--suave); padding: 24px 8px; }
.subabas { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.subabas::-webkit-scrollbar { display: none; }
.subabas button { flex: 0 0 auto; border: 1px solid var(--borda); background: var(--cartao); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.subabas button.ativa { background: var(--marca); border-color: var(--marca); color: #fff; }
.aviso { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 32px); background: var(--texto); color: var(--fundo); padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.aviso.erro { background: var(--erro); color: #fff; }
.modal-fundo { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--cartao); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px; }
@media (min-width: 640px) { .modal-fundo { align-items: center; } .modal { border-radius: 16px; } }
.modal .acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.tabela-grade { overflow-x: auto; }
.tabela-grade table { border-collapse: collapse; font-size: 12px; min-width: 640px; width: 100%; }
.tabela-grade th, .tabela-grade td { border: 1px solid var(--borda); padding: 0; text-align: center; }
.tabela-grade th { padding: 4px; background: var(--fundo); position: sticky; left: 0; }
.tabela-grade td button { width: 100%; min-height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 11px; padding: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.tabela-grade td.marcada { outline: 2px solid var(--marca); outline-offset: -2px; }
.item-relogio { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--borda); }
.item-relogio select { flex: 1; min-width: 0; }
.item-relogio input { width: 64px; }
.progresso { height: 6px; background: var(--borda); border-radius: 99px; overflow: hidden; }
.progresso div { height: 100%; background: var(--marca); width: 0; transition: width .2s; }
.login { max-width: 360px; margin: 12vh auto; padding: 16px; }
.cor-musica { color: var(--marca); } .cor-voz { color: var(--alerta); }
code { font-size: 12px; word-break: break-all; }
.barra-selecao { padding-bottom: 8px; border-bottom: 1px solid var(--borda); }
.lista li > input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 auto; }
.chave { position: relative; flex: 0 0 auto; width: 44px; height: 26px; cursor: pointer; }
.chave input { position: absolute; opacity: 0; width: 0; height: 0; }
.chave span { position: absolute; inset: 0; border-radius: 99px; background: var(--borda); transition: background .2s; }
.chave span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.chave input:checked + span { background: var(--marca); }
.chave input:checked + span::after { transform: translateX(18px); }
.chave input:disabled + span { opacity: .6; }
/* ícones Lucide */
.ic { display: inline-flex; width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; }
.ic svg { width: 100%; height: 100%; }
.abas a span.ic { display: block; width: 22px; height: 22px; margin: 0 auto 2px; }
@media (min-width: 900px) { .abas a span.ic { display: inline-flex; width: 20px; height: 20px; margin: 0; } }
.com-ic { display: flex; align-items: center; gap: 8px; }
.com-ic .ic { color: var(--marca); }
mark { background: #ffe08a; color: #1c2230; border-radius: 3px; padding: 0 2px; }
.lista .nome .selo { display: inline-block; margin-top: 4px; }
/* barra "tocando agora" */
.barra-agora { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--cartao); border-top: 1px solid var(--borda); box-shadow: 0 -4px 14px rgba(0,0,0,.06); overflow: hidden; }
.barra-agora .ba-prog { position: absolute; left: 0; top: 0; height: 3px; background: var(--marca); transition: width 1s linear; }
.barra-agora .ba-play { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--marca); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.barra-agora .ba-play .ic { width: 20px; height: 20px; }
.barra-agora .ba-sem { background: var(--borda); color: var(--suave); cursor: default; }
.barra-agora .ba-info { flex: 1; min-width: 0; }
.barra-agora .ba-info small { display: block; font-size: 11px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-agora .ba-titulo { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.barra-agora .ba-titulo span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-agora .ba-titulo .ic { color: var(--marca); }
.barra-agora .ba-local { flex: 0 1 auto; width: auto; max-width: 34%; min-height: 34px; font-size: 13px; color: var(--suave); }
body.com-barra { padding-bottom: 64px; }
.mini-tv { position: fixed; right: 12px; bottom: calc(130px + env(safe-area-inset-bottom)); z-index: 8; width: min(360px, calc(100vw - 24px)); aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.mini-tv video { width: 100%; height: 100%; display: block; }
.mini-tv .fechar { position: absolute; top: 6px; right: 6px; min-height: 30px; padding: 4px 6px; background: rgba(0,0,0,.55); color: #fff; border: 0; }
@media (min-width: 900px) {
  .barra-agora { left: 150px; bottom: 0; padding: 10px 20px; }
  .barra-agora .ba-depois { display: block; }
  .mini-tv { bottom: 84px; right: 20px; }
}
@media (max-width: 899px) { .barra-agora .ba-depois { display: none !important; } }
