:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121b;
  --text:#e7eef7;
  --muted:#93a4b7;
  --border:rgba(255,255,255,.08);
  --primary:#2f80ff;
  --danger:#ff4d4f;
  --bubbleUser:#1b2a3b;
  --bubbleAsst:#101a26;
  --card:#0c1622;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Arial;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:linear-gradient(180deg,#070a0f, #0b0f14 25%, #0b0f14);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background:rgba(10,14,20,.65);
  backdrop-filter: blur(10px);
  position:sticky; top:0;
  z-index: 5;
}

.brand{font-weight:700; letter-spacing:.2px}
.right{display:flex; gap:10px; align-items:center}
.status{font-size:12px; color:var(--muted)}

* Centraliza o layout na página */
.layout{
  min-height: calc(100vh - 64px); /* se tiver topbar; ajuste se quiser */
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
}

/* Login não pode ter 920px */
.panel.login{
  width: min(420px, 100%);
  margin: 60px auto;
  padding: 22px;
}

/* Melhor espaçamento e alinhamento */
.panel.login h2{ margin: 0 0 14px; }

.panel.login input{
  margin-bottom: 10px;
}

.panel.login .btn.primary{
  margin-top: 12px;
  width: 100%;
  padding: 12px 14px;
}

label{display:block; margin-top:12px; margin-bottom:6px; color:var(--muted); font-size:13px}
input{
  width:100%;
  padding:12px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(12,18,27,.8);
  color:var(--text);
  outline:none;
}
input:focus{border-color: rgba(47,128,255,.55)}

.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.09)}
.btn.primary{
  background:var(--primary);
  border-color: rgba(0,0,0,.0);
  font-weight:600;
}
.btn.primary:hover{filter:brightness(1.05)}
.btn.ghost{background:transparent}

.error{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid rgba(255,77,79,.35);
  background: rgba(255,77,79,.12);
  color:#ffd7d7;
  border-radius:10px;
}

.muted{color:var(--muted)}
code{
  background:rgba(255,255,255,.06);
  padding:2px 6px;
  border-radius:8px;
  border:1px solid var(--border);
}

.title{font-weight:700}
.subtitle{font-size:12px; margin-top:3px}

.timeline{
  padding:16px;
  height: 62vh;
  overflow:auto;
  background:linear-gradient(180deg, rgba(12,18,27,.35), rgba(12,18,27,.15));
}

.row{
  display:flex;
  margin: 10px 0;
}
.row.user{justify-content:flex-end}
.row.assistant{justify-content:flex-start}

.bubble{
  max-width: 78%;
  border:1px solid var(--border);
  border-radius: 14px;
  padding:10px 12px;
  line-height:1.35;
  font-size:14px;
  white-space:pre-wrap;
}
.user .bubble{background: var(--bubbleUser)}
.assistant .bubble{background: var(--bubbleAsst)}

.card{
  width:min(640px, 85%);
  border:1px solid var(--border);
  background:rgba(12,22,34,.7);
  border-radius: 14px;
  padding:12px;
}
.cardTitle{font-weight:700; margin-bottom:6px}
.cardMeta{font-size:12px; color:var(--muted); margin-top:8px; display:flex; gap:10px; align-items:center}
.cardActions{margin-top:10px; display:flex; gap:10px; flex-wrap:wrap}
.btn.danger{
  background: rgba(255,77,79,.14);
  border-color: rgba(255,77,79,.35);
  color: #ffd7d7;
}
.btn.danger:hover{background: rgba(255,77,79,.18)}

.hint{padding:10px 14px; font-size:12px}

.composer{
  display:flex;
  gap:10px;
  padding:12px;
  border-top:1px solid var(--border);
  align-items:center;
}

.cmd{
  display:flex;
  align-items:center;
}

.cmdSelect{
  height:42px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(12,18,27,.8);
  color:var(--text);
  outline:none;
  cursor:pointer;
}

.cmdSelect:focus{
  border-color: rgba(47,128,255,.55);
}

/* deixa input preencher o espaço */
.composer input{
  flex:1;
}

/* opcional: aparência “combo + input” mais juntinha */
@media (min-width: 480px){
  .cmdSelect{
    border-top-right-radius:0;
    border-bottom-right-radius:0;
  }
  .composer input{
    border-top-left-radius:0;
    border-bottom-left-radius:0;
  }
  .composer{
    gap:0;
  }
  .composer .btn.primary{
    margin-left:10px;
  }
}

/* hidden SEMPRE esconde (à prova de CSS conflitante) */
#dropOverlay[hidden] { display: none !important; }

/* overlay base */
#dropOverlay{
  position: fixed;
  inset: 0;
  display: none; /* fallback */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  z-index: 9999;
}

/* quando visível */
#dropOverlay.isVisible{
  display: flex;
}

#dropOverlay .dropBox{
  width: min(520px, calc(100% - 48px));
  padding: 18px 16px;
  border: 1px dashed rgba(255,255,255,.35);
  border-radius: 14px;
  background: rgba(15,22,32,.92);
  text-align: center;
}
.dropCard{
  width:min(520px, 92vw);
  border:1px dashed rgba(255,255,255,.35);
  border-radius:16px;
  padding:22px;
  text-align:center;
  background: rgba(15,22,32,.88);
  box-shadow: var(--shadow);
}
.dropTitle{ font-size:18px; font-weight:700; }
.dropHint{ margin-top:6px; color: var(--muted); font-size:13px; }

.attachments{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:10px 12px;
  border-top:1px solid var(--border);
  background: rgba(12,18,27,.55);
}
.attChip{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(255,255,255,.06);
}
.attName{ font-size:13px; max-width:220px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.attMeta{ font-size:12px; color: var(--muted); }
.attRemove{
  border:0;
  background: transparent;
  color: var(--muted);
  cursor:pointer;
  font-size:14px;
}
.attRemove:hover{ color: var(--text); }

.attLine{ margin-top:8px; }
.attLink{ color: var(--text); text-decoration:none; }
.attLink:hover{ text-decoration:underline; }
.attImg{
  display:block;
  max-width:260px;
  border-radius:12px;
  margin:6px 0;
  border:1px solid var(--border);
}
.attMetaLine{ font-size:12px; color: var(--muted); margin-top:4px; }

#btnAttach{ width:40px; height:40px; border-radius:12px; font-size:18px; }