/* F30 ponte - tela no estilo dos chats do VSCode/Claude Code e do Antigravity (escura, densa) */
:root {
	--fundo: #121212;
	--painel: #191919;
	--painel-2: #202020;
	--borda: #2d2d2d;
	--borda-forte: #3c3c3c;
	--texto: #e6e6e6;
	--mudo: #9a9a9a;
	--fraco: #6f6f6f;
	--acento: #d97757;
	--acento-forte: #e88a6a;
	--verde: #5fb878;
	--amarelo: #d6a74a;
	--vermelho: #e5675e;
	--azul: #6aa3e8;
	--raio: 10px;
	--mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
	color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
	margin: 0;
	background: var(--fundo);
	color: var(--texto);
	font: 13px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
button, input, textarea, select { font: inherit; color: inherit; }
button {
	background: var(--painel-2);
	border: 1px solid var(--borda-forte);
	border-radius: 7px;
	padding: 6px 12px;
	cursor: pointer;
}
button:hover { border-color: #555; }
button:disabled { opacity: 0.45; cursor: default; }
button.primario { background: var(--acento); border-color: var(--acento); color: #1a0f0a; font-weight: 600; }
button.primario:hover { background: var(--acento-forte); }
button.perigo { border-color: #6b2f2b; color: #f3a29b; background: #2a1715; }
button.pequeno { padding: 3px 9px; font-size: 12px; }
.icone { background: none; border: none; color: var(--mudo); font-size: 17px; padding: 2px 7px; cursor: pointer; text-decoration: none; border-radius: 6px; }
.icone:hover { color: var(--texto); background: var(--painel-2); }
.mudo { color: var(--mudo); }
.pequeno-texto { font-size: 12px; }
.erro { color: var(--vermelho); margin: 6px 0 0; }
.espaco { flex: 1; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.pilula { border: 1px solid var(--borda-forte); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--mudo); white-space: nowrap; }
.pilula.ok { color: var(--verde); border-color: #2f5a3b; }
.pilula.alerta { color: var(--amarelo); border-color: #5d4a22; }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--acento); box-shadow: 0 0 10px var(--acento); }

/* entrar */
.entrar { display: grid; place-items: center; height: 100%; padding: 16px; }
.cartao { width: min(360px, 100%); background: var(--painel); border: 1px solid var(--borda); border-radius: 14px; padding: 22px; display: grid; gap: 12px; }
.cartao input { background: var(--fundo); border: 1px solid var(--borda-forte); border-radius: 8px; padding: 9px 11px; }

/* casca */
.app { display: grid; height: 100%; grid-template-columns: 250px minmax(360px, 1fr) minmax(420px, 1.35fr); grid-template-rows: 46px 1fr; }
.topo { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--borda); background: var(--painel); }
.topo-dir { margin-left: auto; display: flex; gap: 8px; }
.lista { border-right: 1px solid var(--borda); background: var(--painel); overflow: auto; }
.lista-topo { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; font-weight: 600; color: var(--mudo); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
.grupo { padding: 8px 12px 4px; font-size: 11px; color: var(--fraco); text-transform: uppercase; letter-spacing: 0.06em; }
.item { display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 8px 12px; margin: 1px 0; }
.item:hover { background: var(--painel-2); }
.item.ativo { background: #2a2420; box-shadow: inset 2px 0 0 var(--acento); }
.item .t { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { display: flex; gap: 6px; font-size: 11.5px; color: var(--mudo); margin-top: 2px; }
.estado { font-size: 11px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--borda-forte); }
.estado.aberto { color: var(--acento-forte); border-color: #5b3a2c; }
.estado.pronto { color: var(--verde); border-color: #2f5a3b; }
.estado.descartado { color: var(--fraco); }
.trabalhando::before { content: '● '; color: var(--acento); animation: pisca 1s infinite; }
@keyframes pisca { 50% { opacity: 0.25; } }

/* centro: pedido e chat */
.centro { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--borda); }
.vazio { margin: auto; text-align: center; padding: 24px; max-width: 460px; }
.vazio h2 { margin: 0 0 8px; font-size: 18px; }
.pedido { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.pedido-topo { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--borda); }
.pedido-titulo { min-width: 0; flex: 1; }
.pedido-titulo h1 { font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.botoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.branch { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passo.commit { flex-wrap: wrap; }
.chat { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.msg-usuario { align-self: flex-end; max-width: 88%; background: var(--painel-2); border: 1px solid var(--borda); border-radius: 12px 12px 4px 12px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-usuario img { display: block; max-width: 220px; max-height: 140px; border-radius: 6px; margin-top: 6px; border: 1px solid var(--borda-forte); }
.msg-ia { display: flex; flex-direction: column; gap: 5px; }
.msg-ia .cab { font-size: 11.5px; color: var(--fraco); }
.msg-ia .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-ia .txt code { background: var(--painel-2); padding: 1px 4px; border-radius: 4px; }
.passo { font-size: 12px; color: var(--mudo); display: flex; gap: 6px; align-items: baseline; }
.passo .mono { color: #c9c9c9; overflow-wrap: anywhere; }
.passo.bloqueio, .passo.aviso { color: var(--amarelo); }
.passo.erro, .passo.falha { color: var(--vermelho); }
.passo.commit { color: var(--verde); }
.rodape { font-size: 11.5px; color: var(--fraco); }
.espera { color: var(--mudo); font-size: 12px; }
.espera::before { content: '● '; color: var(--acento); animation: pisca 1s infinite; }

/* caixa de mensagem (como a do Claude Code / Antigravity) */
.caixa { margin: 10px 14px 14px; background: var(--painel); border: 1px solid var(--borda-forte); border-radius: 14px; padding: 8px 10px; }
.caixa:focus-within { border-color: #5a4a42; }
.caixa textarea { width: 100%; background: none; border: none; outline: none; resize: none; padding: 4px 2px; min-height: 52px; max-height: 220px; }
.caixa-base { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.enviar { width: 32px; height: 32px; border-radius: 50%; padding: 0; font-size: 16px; font-weight: 700; background: var(--texto); color: #111; border: none; }
.enviar:disabled { background: #444; color: #888; }
.anexos { display: flex; gap: 6px; flex-wrap: wrap; }
.anexos .anexo { position: relative; }
.anexos img { height: 46px; border-radius: 6px; border: 1px solid var(--borda-forte); display: block; }
.anexos button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: 11px; line-height: 1; }
.seletor { position: relative; }
.seletor > button { background: none; border: 1px solid transparent; color: var(--mudo); padding: 4px 8px; border-radius: 7px; }
.seletor > button:hover { color: var(--texto); background: var(--painel-2); }
.seletor > button b { color: var(--texto); font-weight: 500; }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 280px; background: #1d1d1d; border: 1px solid var(--borda-forte); border-radius: 12px; padding: 6px; z-index: 20; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.menu .rot { padding: 6px 10px 4px; font-size: 11.5px; color: var(--fraco); }
.menu button { display: flex; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 7px 10px; gap: 8px; align-items: baseline; }
.menu button:hover { background: var(--painel-2); }
.menu button .n { white-space: nowrap; }
.menu button .d { color: var(--fraco); font-size: 11.5px; }
.menu button .v { margin-left: auto; color: var(--acento); }

/* previa */
.previa { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--painel); }
.abas { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--borda); }
.aba { background: none; border: none; color: var(--mudo); padding: 5px 10px; border-radius: 7px; }
.aba.ativa { color: var(--texto); background: var(--painel-2); }
.aba-corpo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.barra-rota { display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--borda); align-items: center; }
.barra-rota input { flex: 1; min-width: 0; background: var(--fundo); border: 1px solid var(--borda-forte); border-radius: 7px; padding: 4px 9px; font-family: var(--mono); font-size: 12px; }
.moldura { position: relative; flex: 1; background: #fff; }
.moldura iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.subindo { position: absolute; inset: 0; background: var(--painel); padding: 22px; overflow: auto; }
.subindo pre { font-family: var(--mono); font-size: 11.5px; color: var(--mudo); white-space: pre-wrap; max-height: 50vh; overflow: auto; }
.mudancas { overflow: auto; padding: 10px 14px; font-family: var(--mono); font-size: 12px; }
.mudancas .commits { font-family: system-ui, sans-serif; font-size: 12.5px; margin-bottom: 10px; }
.mudancas .commits div { padding: 2px 0; color: var(--mudo); }
.mudancas pre { margin: 0; white-space: pre; }
.d-add { color: #7fd18f; background: rgba(95, 184, 120, 0.08); display: block; }
.d-del { color: #f08a82; background: rgba(229, 103, 94, 0.08); display: block; }
.d-hunk { color: var(--azul); display: block; }
.d-arq { color: var(--texto); font-weight: 700; display: block; margin-top: 10px; }

/* novo pedido */
.dialogo { background: var(--painel); color: var(--texto); border: 1px solid var(--borda-forte); border-radius: 14px; padding: 20px; width: min(460px, calc(100% - 32px)); }
.dialogo::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialogo h2 { margin: 0 0 12px; font-size: 16px; }
.dialogo label { display: grid; gap: 4px; margin-bottom: 10px; color: var(--mudo); font-size: 12px; }
.alerta-lib { font-family: system-ui, sans-serif; font-size: 12.5px; color: var(--amarelo); border: 1px solid #5d4a22; border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; }
.dialogo select { background: var(--fundo); border: 1px solid var(--borda-forte); border-radius: 8px; padding: 8px 10px; color: var(--texto); font-size: 13px; }
.dialogo input { background: var(--fundo); border: 1px solid var(--borda-forte); border-radius: 8px; padding: 8px 10px; color: var(--texto); font-size: 13px; }
.dialogo .botoes { margin-top: 12px; }
.so-celular { display: none; }
.aviso { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2a1715; color: #f3c3be; border: 1px solid #6b2f2b; border-radius: 10px; padding: 8px 14px; z-index: 50; max-width: calc(100% - 32px); }

/* telas estreitas: a lista vira gaveta e a previa desce */
@media (max-width: 1100px) {
	.app { grid-template-columns: 220px 1fr; grid-template-rows: 46px minmax(420px, 1fr) minmax(480px, 1fr); overflow: auto; height: auto; min-height: 100%; }
	.previa { grid-column: 1 / -1; border-top: 1px solid var(--borda); }
}
@media (max-width: 720px) {
	.app { grid-template-columns: 1fr; }
	.so-celular { display: inline-block; }
	.lista { display: none; }
	.lista.aberta { display: block; position: fixed; top: 46px; left: 0; bottom: 0; width: min(300px, 85vw); z-index: 30; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
	.topo-dir .pilula:first-child { display: none; }
	.menu { min-width: 240px; }
}
