/* ================== FINAL CLEAN UI (NO DUPLICATION) ================== */
*{box-sizing:border-box;font-family:system-ui,-apple-system,Segoe UI,Roboto}
html,body{height:100%;margin:0}
body{overflow:hidden;background:#000}

/* Background iframe */
.bg{position:fixed;inset:0;z-index:0;pointer-events:none}
.bgFrame{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.blur{position:absolute;inset:0;background:rgba(0,0,0,.18);backdrop-filter:blur(3px)}

/* Utility */
.hidden{display:none !important}

/* Launcher */
.launcher{
  position:fixed;left:18px;bottom:22px;z-index:20;
  border:0;border-radius:999px;padding:14px 16px;
  background:#d32f2f;color:#fff;font-weight:900;
}

/* Login overlay */
.loginOverlay{
  position:fixed;inset:0;z-index:100;
  display:flex;align-items:center;justify-content:center;
  padding:18px;background:rgba(0,0,0,.55);backdrop-filter:blur(7px);
}
.loginOverlay.hidden{display:none !important}
.loginCard{
  width:min(420px,100%);border-radius:22px;padding:18px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  color:#fff;box-shadow:0 20px 70px rgba(0,0,0,.35);
}
.loginTitle{font-size:22px;font-weight:900;margin-bottom:6px}
.loginSub{font-size:13px;opacity:.85;margin-bottom:14px}
.loginLabel{display:block;font-size:12px;opacity:.85;margin-top:10px;margin-bottom:6px}
.loginInput{
  width:100%;padding:12px 14px;border-radius:16px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.20);color:#fff;outline:none
}
.loginBtn{
  margin-top:14px;width:100%;
  padding:12px 14px;border-radius:16px;border:none;
  background:rgba(255,255,255,.20);color:#fff;font-weight:900
}
.loginErr{margin-top:10px;min-height:18px;font-size:12px;color:#ffd2d2}

/* PANEL (move a bit down + slightly bigger) */
.panel{
  position:fixed;z-index:10;
  left:50%;transform:translateX(-50%);
  top:90px;
  width:min(460px,97vw);
  height:min(82vh,640px);
  border-radius:24px;overflow:hidden;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  backdrop-filter:blur(12px);
  box-shadow:0 18px 60px rgba(0,0,0,.35);

  display:flex;flex-direction:column;
}

/* HEADER (small red strip) */
.header{
  flex:0 0 auto;
  padding:10px 12px;
  background:#d32f2f;color:#fff;
  display:flex;justify-content:space-between;align-items:flex-start;gap:12px;
}
.left{display:flex;gap:10px;align-items:flex-start}
.dot{width:12px;height:12px;border-radius:999px;background:#888;margin-top:6px}
.h1{font-size:18px;line-height:1.05;font-weight:900;margin:0}
.sub{font-size:11px;opacity:.95;margin-top:2px}
.actions{display:flex;gap:8px;align-items:center}
.actions button{
  border:none;
  padding:6px 10px;
  border-radius:14px;
  background:rgba(0,0,0,.18);
  color:#fff;font-weight:800;font-size:12px;
  pointer-events:auto;
}

/* Chips */
.chips{
  flex:0 0 auto;
  padding:8px 12px;
  display:flex;gap:10px;
  background:rgba(0,0,0,.10)
}
.chip{
  background:rgba(0,0,0,.18);
  color:#fff;border-radius:999px;
  padding:8px 12px;font-size:12px;
  border:1px solid rgba(255,255,255,.12);
}

/* CHAT (scroll area, keep space for composer) */
#chat.chat,.chat{
  flex:1 1 auto;
  overflow:auto;
  padding:12px;
  padding-bottom:140px; /* IMPORTANT: space so last msg never hides under composer */
  display:flex;flex-direction:column;gap:10px;
}

/* Bubbles (incoming/outgoing different red shades) */
.bubble{
  max-width:78%;
  padding:12px 12px;
  border-radius:16px;
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
}
.in{align-self:flex-start;background:#d32f2f}
.out{align-self:flex-end;background:#b71c1c}
.meta{font-size:11px;opacity:.85;margin-top:6px;display:flex;gap:8px;justify-content:flex-end}
.meta .tick.read{color:#6bd1ff}

/* Mention + Quote */
.mention{padding:0 6px;border-radius:10px;font-weight:700;background:rgba(255,255,255,.15)}
.quoted{padding:8px 10px;border-radius:12px;margin-bottom:8px;background:rgba(0,0,0,.18)}
.quotedText{font-size:13px;opacity:.95;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Reply bar (appears above input) */
.replyBar{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;padding:10px 12px;border-radius:16px;
  width:100%;background:rgba(0,0,0,.18);border:1px solid rgba(255,255,255,.12);
}
.replyBar.hidden{display:none !important}
.replyInfo{flex:1;min-width:0}
.replyTitle{font-size:12px;opacity:.85;margin-bottom:2px}
.replyText{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.98}
.replyCancel{
  width:38px;height:38px;border-radius:14px;border:none;
  background:rgba(0,0,0,.22);color:#fff;font-size:22px;
}

/* COMPOSER (single-row GRID WhatsApp-like) */
.composer{
  position:sticky;
  bottom:0;
  z-index:50;

  margin:10px 12px 12px 12px;
  padding:10px 12px;
  border-radius:22px;

  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  backdrop-filter:blur(10px);

  display:grid;
  grid-template-columns:40px 40px 1fr auto; /* + mic input send */
  align-items:center;
  gap:8px;
}

/* Make sure hidden file input stays hidden */
#fileInput.hidden{display:none !important}

/* PLUS + MIC (small) */
.iconBtn, .composer label.iconBtn{
  width:40px;height:40px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.08);
  color:#fff;font-weight:900;
  display:flex;align-items:center;justify-content:center;
  padding:0 !important;
}

/* INPUT (big) - BLACK typing */
#text{
  width:100%;
  min-width:0;
  height:62px;
  padding:16px 18px;
  font-size:16px;

  border-radius:18px;
  background:rgba(255,255,255,.95);
  border:1px solid rgba(0,0,0,.12);

  color:#000;
  caret-color:#000;
  outline:none;
}
#text::placeholder{color:rgba(0,0,0,.55)}

/* SEND (slightly smaller, right) */
#send,.sendBtn{
  height:42px;
  padding:0 12px;
  border-radius:16px;
  border:none;
  background:#d32f2f;
  color:#fff;
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
}
/* ================== END FINAL CLEAN UI ================== */
