/* Cantiga 2.1 — interface no jeito do Suno: escura, campos grandes, estilos em pílulas,
   botão Criar em degradê de latão para coral. */
:root {
  --fundo: #121214;
  --painel: #18181b;
  --campo: #222226;
  --campo-hover: #2a2a2f;
  --linha: #2f2f35;
  --linha-forte: #3d3d44;
  --texto: #f4f4f5;
  --suave: #a1a1aa;
  --apagado: #71717a;
  --latao: #f5a524;
  --coral: #f0603c;
  --degrade: linear-gradient(100deg, #f5a524 0%, #f0603c 100%);
  --verde: #4ade80;
  --vermelho: #f87171;
  --r: 14px;
  --r-p: 10px;
  --fonte: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --alto-topo: 60px;
  --alto-player: 0px;
  color-scheme: dark;
}
body.com-player { --alto-player: 76px; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.5 var(--fonte);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--latao); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { fill: currentColor; }
code { background: var(--campo); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

/* ---------------- topo ---------------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  height: var(--alto-topo);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(18, 18, 20, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linha);
}
.marca { display: flex; align-items: center; gap: 10px; }
.marca-disco { width: 26px; height: 26px; fill: #26262b; }
.marca-disco .selo { fill: var(--latao); }
.marca-nome { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.conexao {
  display: flex; align-items: center; gap: 10px;
  background: var(--campo); border: 1px solid var(--linha); border-radius: 999px;
  padding: 6px 16px 6px 12px; text-align: left; max-width: 60vw;
}
.conexao:hover { background: var(--campo-hover); }
.conexao-luz { width: 9px; height: 9px; border-radius: 50%; background: var(--apagado); flex: none; }
.conexao-luz.ok { background: var(--verde); box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); }
.conexao-luz.carregando { background: var(--latao); }
.conexao-texto { display: grid; line-height: 1.2; min-width: 0; }
.conexao-texto strong { font-size: 13px; font-weight: 600; }
.conexao-texto small { font-size: 12px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creditos-baixos { color: var(--coral) !important; }

/* ---------------- layout ---------------- */
.estudio {
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  min-height: calc(100vh - var(--alto-topo));
}
.criacao {
  border-right: 1px solid var(--linha);
  background: var(--painel);
  position: sticky; top: var(--alto-topo);
  height: calc(100vh - var(--alto-topo) - var(--alto-player));
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--linha-forte) transparent;
}
#formulario { display: grid; gap: 14px; padding: 18px 18px 0; }
.biblioteca { padding: 22px 28px calc(28px + var(--alto-player)); min-width: 0; }

/* ---------------- controles do formulário ---------------- */
.barra-modo-dir { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.barra-modo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.alternador {
  display: inline-flex; width: fit-content; background: var(--campo); border-radius: 999px; padding: 3px; gap: 2px;
}
.alternador label { position: relative; }
.alternador input { position: absolute; opacity: 0; pointer-events: none; }
.alternador span {
  display: block; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  color: var(--suave); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.alternador span:hover { color: var(--texto); }
.alternador input:checked + span { background: var(--texto); color: #18181b; }
.alternador input:focus-visible + span { outline: 2px solid var(--latao); outline-offset: 1px; }
.alternador-pequeno span { padding: 5px 12px; font-size: 13px; }

.versao select {
  appearance: none; background: var(--campo); border: 1px solid var(--linha); border-radius: 999px;
  padding: 7px 30px 7px 14px; font-weight: 700; font-size: 13px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--suave) 50%), linear-gradient(135deg, var(--suave) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.versao select:hover { border-color: var(--linha-forte); }

.bloco {
  background: var(--campo); border: 1px solid transparent; border-radius: var(--r);
  padding: 12px 14px; display: grid; gap: 8px; transition: border-color .15s;
}
.bloco:focus-within { border-color: var(--linha-forte); }
.bloco-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bloco-topo label { font-weight: 700; font-size: 14px; }
.contador { color: var(--apagado); font-size: 12px; font-variant-numeric: tabular-nums; }
.bloco textarea, .bloco input:not([type=file]):not([type=checkbox]) {
  width: 100%; background: transparent; border: 0; padding: 0; resize: vertical;
  color: var(--texto); line-height: 1.55; outline: none;
}
.bloco textarea::placeholder, .bloco input::placeholder, .campo input::placeholder { color: var(--apagado); }
.bloco-titulo { padding: 12px 14px; }
.bloco-titulo input { font-weight: 600; }
.bloco-rodape { display: flex; flex-wrap: wrap; gap: 8px; }

.pilula-acao, .upload-pilula {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--campo-hover); border: 1px solid var(--linha); border-radius: 999px;
  padding: 5px 12px 5px 10px; font-size: 13px; font-weight: 600; cursor: pointer; position: relative;
}
.pilula-acao:hover, .upload-pilula:hover { border-color: var(--linha-forte); background: #303036; }
.pilula-acao svg, .upload-pilula svg { width: 16px; height: 16px; }
#btnIaLetra svg { fill: var(--latao); }
.upload-pilula input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-pilula .upload-vazio { display: inline-flex; align-items: center; gap: 6px; }
.upload-pilula.preenchido { border-color: var(--latao); }
.upload-pilula.preenchido input[type=file] { display: none; }
.upload-pilula .upload-cheio { display: inline-flex; align-items: center; gap: 8px; }
.upload-pilula .upload-nome { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-pilula .upload-remover { background: none; border: 0; color: var(--suave); font-size: 18px; line-height: 1; padding: 0 2px; }
.upload.arrastando { border-color: var(--latao); }

.tags-letra { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-letra button {
  background: transparent; border: 1px dashed var(--linha-forte); color: var(--suave);
  border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 500;
}
.tags-letra button:hover { color: var(--texto); border-color: var(--suave); }

/* instrumental */
.chave { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; width: fit-content; }
.chave input { position: absolute; opacity: 0; pointer-events: none; }
.chave-trilho {
  width: 38px; height: 22px; border-radius: 999px; background: var(--linha-forte); position: relative; transition: background .15s; flex: none;
}
.chave-trilho::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.chave input:checked + .chave-trilho { background: var(--latao); }
.chave input:checked + .chave-trilho::after { transform: translateX(16px); }
.chave input:focus-visible + .chave-trilho { outline: 2px solid var(--latao); outline-offset: 2px; }

/* sugestões de estilo */
.sugestoes { display: flex; gap: 6px; align-items: flex-start; }
.fichas { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.fichas button {
  background: transparent; border: 1px solid var(--linha-forte); color: var(--texto);
  border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 500;
}
.fichas button::before { content: "+ "; color: var(--apagado); }
.fichas button:hover { border-color: var(--suave); }
.fichas button[aria-pressed="true"] { background: var(--texto); color: #18181b; border-color: var(--texto); }
.fichas button[aria-pressed="true"]::before { content: "✓ "; color: #18181b; }
.embaralhar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--linha-forte);
  background: transparent; color: var(--suave); display: grid; place-items: center;
}
.embaralhar:hover { color: var(--texto); border-color: var(--suave); }
.embaralhar svg { width: 16px; height: 16px; }
.catalogo summary { font-size: 13px; color: var(--suave); cursor: pointer; width: fit-content; }
.catalogo summary:hover { color: var(--texto); }
.catalogo[open] summary { margin-bottom: 8px; }
.grupo-estilos { margin-top: 10px; }
.grupo-estilos h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--suave); }

/* mais opções */
.avancado { border-radius: var(--r); }
.avancado > summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: 14px; padding: 6px 2px;
  display: flex; align-items: center; gap: 8px; width: fit-content;
}
.avancado > summary::-webkit-details-marker { display: none; }
.avancado > summary::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid var(--suave); border-bottom: 2px solid var(--suave);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s;
}
.avancado[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.opcoes { display: grid; gap: 14px; padding: 8px 0 4px; }
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > label, .rotulo { font-size: 13px; font-weight: 600; color: var(--suave); }
.campo input:not([type=range]), .campo select, .trecho-tempos input {
  background: var(--campo); border: 1px solid var(--linha); border-radius: var(--r-p);
  padding: 9px 12px; width: 100%; outline: none;
}
.campo input:focus, .campo select:focus { border-color: var(--linha-forte); }
.campo-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.deslizante { grid-template-columns: 1fr auto auto; align-items: center; column-gap: 10px; }
.deslizante > label { grid-column: 1 / -1; }
.deslizante output { font-size: 13px; color: var(--texto); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
#durFixa { display: grid; margin-top: 4px; }
input[type=range] { accent-color: var(--latao); width: 100%; }
.trecho-tempos { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--suave); }
.trecho-tempos label { display: flex; align-items: center; gap: 8px; }
.trecho-tempos input { width: 84px; color: var(--texto); }

/* origem (cover / trecho) */
.faixa-origem {
  display: flex; align-items: center; gap: 12px;
  background: var(--campo); border: 1px solid var(--latao); border-radius: var(--r); padding: 10px 12px;
}
.faixa-origem-capa { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; background: var(--campo-hover); }
.faixa-origem-capa svg, .faixa-origem-capa img { width: 100%; height: 100%; display: block; object-fit: cover; }
.faixa-origem-texto { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.faixa-origem-texto small { color: var(--latao); font-weight: 600; font-size: 12px; }
.faixa-origem-texto strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fechar { background: none; border: 0; color: var(--suave); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.fechar:hover { background: var(--campo-hover); color: var(--texto); }
.fechar svg { width: 18px; height: 18px; }

/* letra por IA */
.ia-letra-caixa { border-top: 1px solid var(--linha); padding-top: 10px; display: grid; gap: 8px; }
.ia-letra-caixa label { font-size: 13px; font-weight: 600; color: var(--suave); }
.ia-letra-caixa input { background: var(--fundo) !important; border: 1px solid var(--linha) !important; border-radius: var(--r-p); padding: 9px 12px !important; }
.ia-letra-acoes { display: flex; gap: 14px; align-items: center; }
.opcoes-letra { display: grid; gap: 8px; }
.opcoes-letra:empty { display: none; }
.opcao-letra { background: var(--fundo); border-radius: var(--r-p); padding: 10px 12px; }
.opcao-letra strong { font-size: 14px; }
.opcao-letra pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 6px 0 8px; max-height: 160px; overflow: auto; color: var(--suave); }

.dica { margin: 0; font-size: 12.5px; color: var(--suave); }
.link-btn { background: none; border: 0; padding: 0; color: var(--suave); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.link-btn:hover { color: var(--texto); }

/* criar */
.gerar-barra {
  position: sticky; bottom: 0; margin: 4px -18px 0; padding: 12px 18px 18px;
  background: linear-gradient(to top, var(--painel) 78%, rgba(24, 24, 27, 0));
  display: grid; gap: 8px;
}
.botao-gerar {
  border: 0; border-radius: 999px; padding: 13px 20px; background: var(--degrade); color: #1a1206;
  font-weight: 800; font-size: 17px; display: grid; gap: 0; line-height: 1.2;
  box-shadow: 0 6px 24px -8px rgba(240, 96, 60, .55); transition: filter .15s, transform .1s;
}
.botao-gerar:hover:not(:disabled) { filter: brightness(1.06); }
.botao-gerar:active:not(:disabled) { transform: scale(.985); }
.botao-gerar:disabled { background: var(--campo-hover); color: var(--apagado); box-shadow: none; cursor: not-allowed; }
.botao-gerar-custo { font-weight: 600; font-size: 12px; opacity: .72; }
.botao-gerar-custo:empty { display: none; }
.gerar-status { margin: 0; font-size: 13px; color: var(--suave); min-height: 0; }
.gerar-status:empty { display: none; }
.gerar-status.erro { color: var(--vermelho); }

.botao-primario, .botao-secundario, .botao-perigo {
  border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px; border: 1px solid transparent;
}
.botao-primario { background: var(--texto); color: #18181b; }
.botao-primario:hover { background: #fff; }
.botao-primario:disabled { opacity: .5; }
.botao-secundario { background: var(--campo); border-color: var(--linha); }
.botao-secundario:hover { background: var(--campo-hover); }
.botao-perigo { background: #7f1d1d; color: #fff; }

/* ---------------- biblioteca ---------------- */
.biblioteca-topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.biblioteca-topo h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
#busca {
  background: var(--campo); border: 1px solid var(--linha); border-radius: 999px; padding: 8px 16px;
  width: min(280px, 50%); outline: none;
}
#busca:focus { border-color: var(--linha-forte); }
.lista-musicas, .em-producao { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.em-producao:not(:empty) { margin-bottom: 2px; }

.musica, .producao {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 8px 10px; border-radius: 12px; position: relative;
}
.musica:hover, .musica.tocando { background: var(--painel); }
.musica .disco, .producao .disco {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden; position: relative;
  border: 0; padding: 0; background: var(--campo); display: block;
}
.musica .disco svg, .producao .disco svg, .musica .disco img.capa { width: 100%; height: 100%; display: block; object-fit: cover; }
.musica .disco::after {
  content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .45) no-repeat center / 26px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  opacity: 0; transition: opacity .15s;
}
.musica .disco:hover::after, .musica .disco:focus-visible::after { opacity: 1; }
.musica.tocando .disco::after {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M7 5h4v14H7zM13 5h4v14h-4z'/%3E%3C/svg%3E");
}
.musica .duracao-capa {
  position: absolute; right: 4px; bottom: 4px; z-index: 1; font-size: 11px; font-weight: 600;
  background: rgba(0, 0, 0, .7); border-radius: 5px; padding: 0 5px; pointer-events: none;
}
.musica-texto { min-width: 0; display: grid; gap: 2px; }
.musica-titulo { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.musica-titulo .nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.musica.tocando .musica-titulo .nome { color: var(--latao); }
.selo-versao {
  flex: none; font-size: 11px; font-weight: 700; color: var(--suave); border: 1px solid var(--linha-forte);
  border-radius: 6px; padding: 0 5px; line-height: 17px;
}
.musica-estilo { margin: 0; color: var(--suave); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.musica-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--apagado); }
.musica-meta .arquivada { color: var(--suave); }
.musica-acoes { display: flex; align-items: center; gap: 2px; }
.icone-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--suave);
  display: grid; place-items: center;
}
.icone-btn:hover { background: var(--campo); color: var(--texto); }
.icone-btn svg { width: 20px; height: 20px; }

.menu { position: relative; }
.menu-lista {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 240px;
  background: #1f1f23; border: 1px solid var(--linha-forte); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); display: grid;
}
.menu-lista button {
  background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 8px; display: grid; font-size: 14px;
}
.menu-lista button small { color: var(--apagado); font-size: 12px; }
.menu-lista button:hover, .menu-lista button:focus-visible { background: var(--campo-hover); outline: none; }
.menu-lista .perigo { color: var(--vermelho); }
.menu-lista hr { border: 0; border-top: 1px solid var(--linha); margin: 4px 6px; }
.menu-grupo { font-size: 11.5px; color: var(--apagado); padding: 6px 10px 2px; font-weight: 600; }

.detalhes-musica {
  grid-column: 1 / -1; background: var(--painel); border: 1px solid var(--linha); border-radius: 12px;
  padding: 14px 16px; font-size: 14px;
}
.detalhes-musica dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; }
.detalhes-musica dt { color: var(--suave); }
.detalhes-musica dd { margin: 0; }
.detalhes-musica pre { white-space: pre-wrap; font: inherit; margin: 0; max-height: 320px; overflow: auto; }

/* em produção */
.producao { background: var(--painel); }
.producao .disco svg { animation: girar 2.4s linear infinite; animation-play-state: paused; }
.producao .disco.girando svg { animation-play-state: running; }
.producao h3 { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.producao-etapa { font-size: 13px; color: var(--suave); }
.producao.erro .producao-etapa { color: var(--vermelho); }
.producao-barra { height: 3px; background: var(--linha); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.producao-barra span { display: block; height: 100%; width: 30%; background: var(--degrade); border-radius: 3px; }
.producao-barra.indeterminada span { animation: vaivem 1.6s ease-in-out infinite; }
.producao-previa { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.producao-previa:empty { display: none; }
.producao-previa button { font-size: 12px; padding: 4px 12px; }
.producao-previa button[aria-pressed=true] { background: var(--texto); color: #18181b; }
.producao-tempo { font-size: 13px; color: var(--suave); font-variant-numeric: tabular-nums; display: flex; gap: 10px; align-items: center; }

.vazio {
  border: 1px dashed var(--linha-forte); border-radius: var(--r); padding: 28px; color: var(--suave); max-width: 560px;
}
.vazio-titulo { color: var(--texto); font-weight: 700; font-size: 17px; margin: 0 0 4px; }
.vazio p:last-child { margin: 0; }
.armazenamento { font-size: 12.5px; color: var(--apagado); margin-top: 18px; }

/* ---------------- player ---------------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: 76px;
  display: grid; grid-template-columns: 48px minmax(140px, 260px) 1fr auto; align-items: center; gap: 14px 16px;
  padding: 0 20px; background: rgba(24, 24, 27, .97); border-top: 1px solid var(--linha); backdrop-filter: blur(10px);
}
.player-disco { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; }
.player-disco svg, .player-disco img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-info { display: grid; min-width: 0; line-height: 1.3; }
.player-info strong, .player-info small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-info small { color: var(--suave); font-size: 12.5px; }
.player-controles { display: flex; align-items: center; gap: 12px; }
.player-play {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--texto); color: #18181b; display: grid; place-items: center; flex: none;
}
.player-play svg { width: 22px; height: 22px; }
.tempo { font-size: 12px; color: var(--suave); font-variant-numeric: tabular-nums; min-width: 34px; }
.player-extra { display: flex; align-items: center; gap: 8px; }
#playerVolume { width: 90px; }

/* ---------------- diálogos e aviso ---------------- */
.dialogo {
  background: #1f1f23; color: var(--texto); border: 1px solid var(--linha-forte); border-radius: 18px;
  padding: 24px; width: min(430px, calc(100vw - 32px));
}
.dialogo::backdrop { background: rgba(0, 0, 0, .65); }
.dialogo h2 { margin: 0 0 6px; font-size: 20px; }
.dialogo p { color: var(--suave); margin: 0 0 14px; }
.dialogo form { display: grid; gap: 10px; }
.dialogo form > label:not(.chave) { font-weight: 600; font-size: 13px; color: var(--suave); }
.dialogo input[type=password] {
  background: var(--campo); border: 1px solid var(--linha); border-radius: var(--r-p); padding: 11px 12px; outline: none;
}
.dialogo input[type=password]:focus { border-color: var(--latao); }
.chave-texto { font-weight: 500; }
.erro-conexao { color: var(--vermelho) !important; margin: 0 !important; font-size: 13.5px; }
.erro-conexao:empty { display: none; }
.dialogo-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dialogo-acoes #btnDesconectar { margin-right: auto; }
.dialogo-pequeno p { color: var(--texto); }

.aviso-flutuante {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--alto-player)); z-index: 40;
  background: var(--texto); color: #18181b; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8); max-width: calc(100vw - 32px); text-align: center;
}

@keyframes girar { to { transform: rotate(360deg); } }
@keyframes vaivem { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------------- telas menores ---------------- */
@media (max-width: 900px) {
  .estudio { grid-template-columns: 1fr; }
  .criacao { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--linha); }
  .biblioteca { padding: 20px 16px calc(24px + var(--alto-player)); }
  #formulario { padding: 16px 16px 0; }
  .gerar-barra { margin: 4px -16px 0; padding: 12px 16px 16px; bottom: var(--alto-player); }
}
@media (max-width: 600px) {
  .topo { padding: 0 16px; }
  .alternador > label > span { padding: 7px 13px; }
  .conexao { max-width: 64vw; }
  .marca-nome { font-size: 17px; }
  .conexao { padding: 5px 12px 5px 10px; }
  .musica, .producao { grid-template-columns: 56px 1fr auto; gap: 12px; padding: 8px 4px; }
  .musica .disco, .producao .disco { width: 56px; height: 56px; }
  .musica-acoes [data-acao="baixar"] { display: none; }
  .player { grid-template-columns: 44px 1fr auto; gap: 12px; padding: 0 12px; }
  .player-disco { width: 44px; height: 44px; }
  .player-controles .tempo, #playerBarra, #playerVolume { display: none; }
  .player-controles { order: 2; }
  .player-extra { display: none; }
  .biblioteca-topo h1 { font-size: 19px; }
  .producao-tempo { flex-direction: column; align-items: flex-end; }
}

/* ---------------- contas da Kie.ai ---------------- */
.topo-dir { display: flex; align-items: center; gap: 10px; min-width: 0; }
#btnContas svg { width: 17px; height: 17px; fill: var(--latao); }
.dialogo-contas { width: min(560px, calc(100vw - 32px)); }
.dialogo-contas h3 { margin: 4px 0 0; font-size: 15px; }
.lista-contas { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; }
.conta {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--campo); border: 1px solid transparent; border-radius: 12px;
}
.conta.ativa { border-color: var(--latao); }
.conta-texto { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.conta-texto small { color: var(--suave); font-size: 12.5px; }
.conta-texto code { background: none; padding: 0; margin-right: 6px; color: var(--apagado); }
.conta-acoes { display: flex; align-items: center; gap: 4px; flex: none; }
.conta-acoes .botao-secundario { padding: 5px 14px; font-size: 13px; }
.conta-selo { font-size: 12px; font-weight: 700; color: #1a1206; background: var(--latao); border-radius: 999px; padding: 3px 10px; }
.conta-vazia { color: var(--suave); font-size: 14px; padding: 6px 2px; }
.conta-erro { color: var(--vermelho); }
.form-conta { border-top: 1px solid var(--linha); padding-top: 14px; }
@media (max-width: 600px) {
  #btnContas { padding: 6px 10px; font-size: 0; gap: 0; }
  #btnContas svg { width: 18px; height: 18px; }
  .dialogo-contas .campo-linha { grid-template-columns: 1fr; }
}
