/* Bunker 1.8.3 — Chat & Interaction Polish */

/* Message threads: same-author lines should read as one compact conversation block. */
.phase1-shell .message:not(.v182-grouped):has(+ .message.v182-grouped){padding-bottom:2px!important}
.phase1-shell .message.v182-grouped{
  padding-top:0!important;
  padding-bottom:0!important;
  min-height:20px!important;
  margin-top:-1px;
}
.phase1-shell .message:not(.v182-grouped)+.message.v182-grouped{margin-top:-4px}
.phase1-shell .message.v182-grouped+.message.v182-grouped{margin-top:-1px}
.phase1-shell .message.v182-grouped .msg-text{line-height:1.36}
.phase1-shell .message.v182-grouped:has(.attachments),
.phase1-shell .message.v182-grouped:has(.reactions:not(:empty)){padding-top:2px!important;padding-bottom:3px!important}
.phase1-shell .message.v182-grouped+.message:not(.v182-grouped){margin-top:7px!important}
.phase1-shell .message.v182-grouped::after{top:3px!important}

/* An exclusive popover owns interaction until used or dismissed. The transparent shield
   prevents the same click from leaking into Reply/Edit/Delete behind it. */
.v183-interaction-shield{
  position:fixed;inset:0;z-index:12020;background:transparent;cursor:default;
  touch-action:none;overscroll-behavior:none;
}
.v183-exclusive-popover{z-index:12030!important}

/* Self profile quick menu, anchored to the lower-left user avatar. */
.v183-user-menu-btn{
  flex:none;width:39px;height:39px;padding:0;border:0;border-radius:12px;background:transparent;
  display:grid;place-items:center;cursor:pointer;position:relative
}
.v183-user-menu-btn:hover{background:#151d20}
.phase1-shell .userbar>.v183-user-menu-btn .avatar{width:37px;height:37px;border-radius:11px}
.v183-user-menu-btn:focus-visible{outline:2px solid var(--p1-accent);outline-offset:2px}
.v183-profile-popover{
  position:fixed;width:304px;max-width:calc(100vw - 20px);box-sizing:border-box;
  border:1px solid #293439;border-radius:15px;background:#0c1215;color:#e5ebe7;
  padding:10px;box-shadow:0 24px 64px rgba(0,0,0,.58);overflow:hidden;
}
.v183-profile-top{display:flex;align-items:center;gap:11px;padding:4px 4px 9px}
.v183-profile-avatar{position:relative;border:0;background:transparent;padding:0;cursor:pointer;flex:none}
.v183-profile-avatar .avatar.lg{width:56px;height:56px;border-radius:16px;border:1px solid #34413a}
.v183-profile-avatar .presence-dot{position:absolute;right:-1px;bottom:1px;width:11px;height:11px;border:3px solid #0c1215}
.v183-profile-avatar:hover .avatar{filter:brightness(1.08)}
.v183-profile-who{min-width:0}
.v183-profile-who>strong{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v183-profile-who>span{display:block;margin-top:2px;font-size:9px;color:#758188}
.v183-bio-card{
  width:100%;display:grid;gap:4px;text-align:left;border:1px solid #273238;border-radius:10px;
  background:#11181b;color:#cbd4cf;padding:9px 10px;margin-bottom:7px;cursor:pointer
}
.v183-bio-card:hover{border-color:#38464c;background:#141d20}
.v183-bio-card small{font-size:7px;letter-spacing:.12em;font-weight:900;color:#6c797f}
.v183-bio-card span{font-size:9px;line-height:1.45;max-height:2.9em;overflow:hidden}
.v183-bio-card em{font-style:normal;color:#68757b}
.v183-profile-actions{display:grid;gap:2px;padding:3px 0}
.v183-profile-actions>button,.v183-presence-list>button{
  width:100%;display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:8px;align-items:center;
  border:0;border-radius:9px;background:transparent;color:#dce4df;padding:8px;text-align:left;cursor:pointer
}
.v183-profile-actions>button:hover,.v183-presence-list>button:hover{background:#172024}
.v183-profile-actions i,.v183-presence-list i{width:28px;height:28px;border-radius:8px;background:#161f22;display:grid;place-items:center;font-style:normal;color:#95a2a7}
.v183-profile-actions span,.v183-presence-list span{min-width:0}
.v183-profile-actions b,.v183-profile-actions small,.v183-presence-list b,.v183-presence-list small{display:block}
.v183-profile-actions b,.v183-presence-list b{font-size:10px}
.v183-profile-actions small,.v183-presence-list small{font-size:8px;color:#718087;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v183-profile-actions>button>strong,.v183-presence-list>button>strong{font-size:13px;color:#65747b}
.v183-presence-symbol.mode-online{color:#92e44d!important}
.v183-presence-symbol.mode-away{color:#e0b84d!important}
.v183-presence-symbol.mode-busy{color:#ee6672!important}
.v183-presence-symbol.mode-invisible{color:#778288!important}
.v183-presence-list>button.active{background:#172019;box-shadow:inset 0 0 0 1px rgba(155,242,63,.12)}
.v183-presence-list>button.active>strong{color:var(--p1-accent)}
.v183-profile-separator{height:1px;background:#263035;margin:6px 3px}
.v183-profile-logout{
  width:100%;height:36px;border:0;border-radius:9px;background:transparent;color:#e28c94;
  display:flex;align-items:center;gap:9px;padding:0 10px;cursor:pointer;text-align:left;font-size:10px;font-weight:800
}
.v183-profile-logout:hover{background:#28171b;color:#ffadb5}
.v183-profile-logout span{font-size:15px}
.v183-panel-head{display:flex;align-items:center;gap:9px;padding:3px 2px 9px;border-bottom:1px solid #263035;margin-bottom:6px}
.v183-panel-head>button{width:30px;height:30px;border:0;border-radius:8px;background:#151d20;color:#93a0a6;cursor:pointer}
.v183-panel-head>button:hover{background:#202a2e;color:#fff}
.v183-panel-head b,.v183-panel-head span{display:block}
.v183-panel-head b{font-size:11px}.v183-panel-head span{font-size:8px;color:#6f7c82;margin-top:2px}
.v183-presence-list{display:grid;gap:2px}
.v183-bio-form{display:grid;gap:8px}
.v183-bio-form textarea{width:100%;box-sizing:border-box;resize:none;border:1px solid #2c383d;border-radius:10px;background:#11181b;color:#e0e6e2;padding:10px;font:inherit;font-size:10px;line-height:1.5;outline:none}
.v183-bio-form textarea:focus{border-color:#526642;box-shadow:0 0 0 2px rgba(155,242,63,.07)}
.v183-bio-form>div{display:flex;align-items:center;justify-content:flex-end;gap:6px}
.v183-bio-form>div>span{margin-right:auto;font-size:8px;color:#6b777d}
.v183-bio-form button{border-radius:8px;padding:7px 10px;font-size:9px;cursor:pointer}

@media(max-width:760px){
  .v183-profile-popover{width:min(304px,calc(100vw - 16px))}
}
